{"id":12779,"date":"2022-02-15T11:06:46","date_gmt":"2022-02-15T19:06:46","guid":{"rendered":"https:\/\/www.couchbase.com\/blog\/?p=12779"},"modified":"2025-06-13T21:25:08","modified_gmt":"2025-06-14T04:25:08","slug":"monitor-stellar-assets-using-couchbase-python","status":"publish","type":"post","link":"https:\/\/www.couchbase.com\/blog\/pt\/monitor-stellar-assets-using-couchbase-python\/","title":{"rendered":"Monitorar ativos Stellar usando Couchbase e Python"},"content":{"rendered":"<p><span style=\"font-weight: 400;\">Esta publica\u00e7\u00e3o descreve como criar um cliente b\u00e1sico que registra a atividade no <\/span><a href=\"https:\/\/stellar.org\"><span style=\"font-weight: 400;\">Cadeia de blocos descentralizada Stellar<\/span><\/a><span style=\"font-weight: 400;\">. A Stellar hospeda uma lista crescente de tokens e moedas alternativas de criptomoedas novas e diferentes. Com o c\u00f3digo desta publica\u00e7\u00e3o, voc\u00ea pode criar uma ferramenta de consulta b\u00e1sica de ativos mantidos em uma conta Stellar, usando o Couchbase para armazenamento e consulta.<\/span><\/p>\n<h4><span style=\"font-weight: 400;\">O que voc\u00ea precisar\u00e1<\/span><\/h4>\n<h5><span style=\"font-weight: 400;\">Couchbase<\/span><\/h5>\n<p><span style=\"font-weight: 400;\">Para acompanhar, configure uma vers\u00e3o recente do Couchbase que seja igual ou superior \u00e0 7.0.2. Voc\u00ea pode fazer a maioria das coisas com vers\u00f5es anteriores, mas em postagens futuras n\u00e3o ser\u00e1 poss\u00edvel acessar os gr\u00e1ficos, escopos ou cole\u00e7\u00f5es incorporados. <\/span><a href=\"https:\/\/cloud.couchbase.com\"><span style=\"font-weight: 400;\">Couchbase Capella<\/span><\/a><span style=\"font-weight: 400;\"> O banco de dados como servi\u00e7o tamb\u00e9m est\u00e1 dispon\u00edvel com uma avalia\u00e7\u00e3o gratuita simples, ou voc\u00ea pode instalar um banco de dados local ou <\/span><a href=\"https:\/\/docs.couchbase.com\/server\/current\/install\/getting-started-docker.html\"><span style=\"font-weight: 400;\">Vers\u00e3o do Docker do Couchbase<\/span><\/a><span style=\"font-weight: 400;\">.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Usando a UI de administra\u00e7\u00e3o integrada do Couchbase - escolha a op\u00e7\u00e3o <\/span><b>Balde <\/b><span style=\"font-weight: 400;\">na barra lateral e o menu <\/span><b>Adicionar balde <\/b><span style=\"font-weight: 400;\">(canto superior direito).  Crie um bucket chamado <\/span><span style=\"font-weight: 400;\">estelar<\/span><span style=\"font-weight: 400;\">conforme mostrado na Figura 1. Ele precisa de um m\u00ednimo de mem\u00f3ria atribu\u00edda a ele; o meu padr\u00e3o \u00e9 300 MB, o que ser\u00e1 mais do que suficiente.\u00a0<\/span><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-12780\" src=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2022\/02\/Screen-Shot-2022-02-15-at-10.11.04-AM.png\" alt=\"Add a new data bucket to the Couchbase cluster\" width=\"1248\" height=\"695\" srcset=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/02\/Screen-Shot-2022-02-15-at-10.11.04-AM.png 1248w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/02\/Screen-Shot-2022-02-15-at-10.11.04-AM-300x167.png 300w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/02\/Screen-Shot-2022-02-15-at-10.11.04-AM-1024x570.png 1024w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/02\/Screen-Shot-2022-02-15-at-10.11.04-AM-768x428.png 768w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/02\/Screen-Shot-2022-02-15-at-10.11.04-AM-20x11.png 20w\" sizes=\"auto, (max-width: 1248px) 100vw, 1248px\" \/><\/p>\n<p><span style=\"font-weight: 400;\">Figura 1. Adicionar um novo bucket de dados ao cluster do Couchbase.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Ele levar\u00e1 um minuto para aquecer antes de ficar verde para mostrar que est\u00e1 dispon\u00edvel, conforme mostrado na Figura 2.<\/span><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-12781\" src=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2022\/02\/Screen-Shot-2022-02-15-at-10.12.26-AM.png\" alt=\" The new bucket is now available\" width=\"1183\" height=\"282\" srcset=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/02\/Screen-Shot-2022-02-15-at-10.12.26-AM.png 1183w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/02\/Screen-Shot-2022-02-15-at-10.12.26-AM-300x72.png 300w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/02\/Screen-Shot-2022-02-15-at-10.12.26-AM-1024x244.png 1024w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/02\/Screen-Shot-2022-02-15-at-10.12.26-AM-768x183.png 768w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/02\/Screen-Shot-2022-02-15-at-10.12.26-AM-20x5.png 20w\" sizes=\"auto, (max-width: 1183px) 100vw, 1183px\" \/><\/p>\n<p><span style=\"font-weight: 400;\">Figura 2. O novo bucket j\u00e1 est\u00e1 dispon\u00edvel.<\/span><\/p>\n<h4><span style=\"font-weight: 400;\">Endere\u00e7o da carteira Stellar<\/span><\/h4>\n<p><span style=\"font-weight: 400;\">Em seguida, voc\u00ea precisar\u00e1 de um endere\u00e7o de carteira Stellar para monitorar. Para encontrar uma conta interessante, use <\/span><a href=\"https:\/\/stellar.expert\/directory?tag[]=wallet\"><span style=\"font-weight: 400;\">Stellar.expert e seu navegador de contas<\/span><\/a><span style=\"font-weight: 400;\"> para encontrar uma carteira de identidade.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Para meus experimentos, estou usando esse endere\u00e7o, pois ele tem uma cole\u00e7\u00e3o pequena, mas interessante, de tokens:\u00a0<\/span><\/p>\n<pre class=\"\">GAF55XSX3WCHWUB6CEGSKKMLPKV56Y5MK4UCBRSSGRBBDENFEXSWWMDQ<\/pre>\n<h4><span style=\"font-weight: 400;\">SDK do Python<\/span><\/h4>\n<p><span style=\"font-weight: 400;\">Em seguida, usaremos o Python 3 e o Couchbase Python SDK. Instale o Python SDK usando o comando <\/span><span style=\"font-weight: 400;\">tubula\u00e7\u00e3o <\/span><span style=\"font-weight: 400;\">conforme descrito no comando <\/span><a href=\"https:\/\/docs.couchbase.com\/python-sdk\/current\/hello-world\/start-using-sdk.html\"><span style=\"font-weight: 400;\">documenta\u00e7\u00e3o<\/span><\/a><span style=\"font-weight: 400;\">. Inclua tamb\u00e9m o <\/span><span style=\"font-weight: 400;\">solicita\u00e7\u00f5es <\/span><span style=\"font-weight: 400;\">que precisaremos para fazer o download da API da Web do Stellar.<\/span><\/p>\n<pre class=\"\">python3 -m pip install --upgrade pip setuptools wheel<\/pre>\n<p><span style=\"font-weight: 400;\">Teste a instala\u00e7\u00e3o iniciando o Python e importando o m\u00f3dulo Couchbase:<\/span><\/p>\n<pre class=\"decode-attributes:false lang:default decode:true\">tyler@megaserv:python-stellar$ python3\r\nPython 3.8.10 (default, Nov 26 2021, 20:14:08)\r\n[GCC 9.3.0] on linux\r\nType \"help\", \"copyright\", \"credits\" or \"license\" for more information.\r\n&gt;&gt;&gt; import couchbase<\/pre>\n<p><span style=\"font-weight: 400;\">Se ele for conclu\u00eddo sem erros, ent\u00e3o estamos prontos para come\u00e7ar. Pressione <\/span><em><span style=\"font-weight: 400;\">CTRL+D<\/span><\/em><span style=\"font-weight: 400;\"> para desistir.<\/span><\/p>\n<h4><span style=\"font-weight: 400;\">Conex\u00e3o com o Couchbase<\/span><\/h4>\n<p><span style=\"font-weight: 400;\">O <\/span><a href=\"https:\/\/docs.couchbase.com\/python-sdk\/current\/hello-world\/start-using-sdk.html#hello-couchbase\"><span style=\"font-weight: 400;\">Ol\u00e1, Couchbase<\/span><\/a><span style=\"font-weight: 400;\"> na documenta\u00e7\u00e3o mostram as informa\u00e7\u00f5es b\u00e1sicas de conex\u00e3o que voc\u00ea precisa adicionar ao nosso script Python. No m\u00ednimo, para nos conectarmos ao nosso novo bucket, precisamos de:\u00a0<\/span><\/p>\n<ul>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">O nome de usu\u00e1rio\/senha do administrador (ou algu\u00e9m com direitos de acesso ao novo bucket)<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">O nome\/IP do servidor\/cluster do Couchbase<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">O nome do novo bucket (por exemplo,, <\/span><em><span style=\"font-weight: 400;\">estelar<\/span><span style=\"font-weight: 400;\">)<\/span><\/em><\/li>\n<\/ul>\n<p><span style=\"font-weight: 400;\">Crie um script chamado <\/span><em><span style=\"font-weight: 400;\">app.py<\/span><\/em><span style=\"font-weight: 400;\">:<\/span><\/p>\n<pre class=\"decode-attributes:false lang:python decode:true\">from couchbase.cluster import Cluster, ClusterOptions\r\nfrom couchbase.auth import PasswordAuthenticator\r\n\r\ncluster = Cluster('couchbase:\/\/localhost', ClusterOptions(\r\nPasswordAuthenticator('Administrator', 'Administrator')))\r\n\r\ncb = cluster.bucket('stellar')<\/pre>\n<p><span style=\"font-weight: 400;\">Voc\u00ea pode executar o script e verificar se h\u00e1 algum erro antes de continuar.<\/span><\/p>\n<h4><span style=\"font-weight: 400;\">Revis\u00e3o do esquema de contas do Stellar.org<\/span><\/h4>\n<p><span style=\"font-weight: 400;\">Para este projeto, faremos o download das informa\u00e7\u00f5es da conta diretamente do <\/span><b>API da Web estelar<\/b><span style=\"font-weight: 400;\"> e armazenar os dados JSON brutos no Couchbase para consulta posterior.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Para acessar uma conta Stellar, usaremos o servi\u00e7o Horizon e acessaremos a conta <\/span><em><span style=\"font-weight: 400;\">\/public\/asset<\/span><\/em><span style=\"font-weight: 400;\"><em> ponto final<\/em>. Por exemplo, eu uso <\/span><a href=\"https:\/\/postman.co\"><span style=\"font-weight: 400;\">Carteiro.co<\/span><\/a><span style=\"font-weight: 400;\"> para fazer uma visualiza\u00e7\u00e3o r\u00e1pida do JSON resultante para ter uma ideia do esquema, conforme mostrado na Figura 3.<\/span><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-12782\" src=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2022\/02\/Screen-Shot-2022-02-15-at-10.15.40-AM.png\" alt=\" Sample of the Stellar accounts JSON document\" width=\"742\" height=\"843\" srcset=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/02\/Screen-Shot-2022-02-15-at-10.15.40-AM.png 742w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/02\/Screen-Shot-2022-02-15-at-10.15.40-AM-264x300.png 264w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/02\/Screen-Shot-2022-02-15-at-10.15.40-AM-300x341.png 300w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/02\/Screen-Shot-2022-02-15-at-10.15.40-AM-18x20.png 18w\" sizes=\"auto, (max-width: 742px) 100vw, 742px\" \/><\/p>\n<p><span style=\"font-weight: 400;\">Figura 3. Amostra do documento JSON das contas Stellar.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Na figura, observe que eu reduzi alguns objetos e listas para ver as coisas com mais clareza. Os elementos de n\u00edvel raiz, como <\/span><em><span style=\"font-weight: 400;\">account_id<\/span><span style=\"font-weight: 400;\">,<\/span><span style=\"font-weight: 400;\"> subentry_count<\/span><\/em><span style=\"font-weight: 400;\">e<\/span><em><span style=\"font-weight: 400;\"> last_modified_time<\/span><\/em><span style=\"font-weight: 400;\"> s\u00e3o potencialmente \u00fateis. Mas a maioria das entradas est\u00e1 na se\u00e7\u00e3o <\/span><em><span style=\"font-weight: 400;\">balan\u00e7os<\/span><\/em><span style=\"font-weight: 400;\"> objeto, quase 1.700 linhas na verdade.\u00a0<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Esses s\u00e3o os elementos essenciais do detentor do ativo. Vamos examin\u00e1-los um pouco mais detalhadamente na Figura 4 abaixo.<\/span><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-12783\" src=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2022\/02\/Screen-Shot-2022-02-15-at-10.17.10-AM.png\" alt=\"Two entries from the balances list\" width=\"531\" height=\"289\" srcset=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/02\/Screen-Shot-2022-02-15-at-10.17.10-AM.png 531w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/02\/Screen-Shot-2022-02-15-at-10.17.10-AM-300x163.png 300w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/02\/Screen-Shot-2022-02-15-at-10.17.10-AM-20x11.png 20w\" sizes=\"auto, (max-width: 531px) 100vw, 531px\" \/><\/p>\n<p><span style=\"font-weight: 400;\">Figura 4. Duas entradas da lista de saldos.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Na figura acima, s\u00e3o mostrados dois tipos de balan\u00e7os. H\u00e1 dezenas de outros que n\u00e3o est\u00e3o sendo mostrados, mas todos s\u00e3o semelhantes ao primeiro mostrado aqui. Ele lista um saldo do n\u00famero de tokens (<\/span><em><span style=\"font-weight: 400;\">1.7<\/span><\/em><span style=\"font-weight: 400;\">), o asset_code (<\/span><em><span style=\"font-weight: 400;\">ZDC<\/span><\/em><span style=\"font-weight: 400;\"> s\u00e3o <\/span><a href=\"https:\/\/www.zodiactokens.org\/\"><span style=\"font-weight: 400;\">Fichas do Zod\u00edaco<\/span><\/a><span style=\"font-weight: 400;\">), e o<\/span><em><span style=\"font-weight: 400;\"> emissor de ativos<\/span><\/em><span style=\"font-weight: 400;\"> (j\u00e1 que muitas contas podem emitir o mesmo ativo). Observe tamb\u00e9m o <\/span><em><span style=\"font-weight: 400;\">tipo de ativo<\/span><\/em><span style=\"font-weight: 400;\"> (<\/span><em><span style=\"font-weight: 400;\">cr\u00e9dito_alphanum4<\/span><\/em><span style=\"font-weight: 400;\">).<\/span><\/p>\n<p><span style=\"font-weight: 400;\">A segunda entrada acima \u00e9 a \u00fanica diferente<\/span><em><span style=\"font-weight: 400;\"> tipo de ativo<\/span><\/em><span style=\"font-weight: 400;\"> na lista (<\/span><em><span style=\"font-weight: 400;\">nativo<\/span><\/em><span style=\"font-weight: 400;\">). Nesse caso, \u00e9 um saldo base no n\u00edvel da conta, o token nativo da carteira Lobstr do propriet\u00e1rio, nesse caso <\/span><a href=\"https:\/\/medium.com\/stellar-global\/xlm-he-token-of-the-future-84548b890eb2\"><span style=\"font-weight: 400;\">Lumens estelares<\/span><\/a><span style=\"font-weight: 400;\"> (<\/span><em><span style=\"font-weight: 400;\">XLM<\/span><\/em><span style=\"font-weight: 400;\">). Esse saldo pode ser trocado por saldos de qualquer outro ativo e vice-versa por meio da conta de negocia\u00e7\u00e3o de ativos.<\/span><\/p>\n<h4><span style=\"font-weight: 400;\">Planejamento do nosso fluxo de trabalho<\/span><\/h4>\n<p><span style=\"font-weight: 400;\">Com o exposto acima em mente, podemos planejar como armazenar e acessar todas as informa\u00e7\u00f5es de nosso interesse. Ent\u00e3o, no que estamos interessados?<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Primeiro, estamos interessados em uma atualiza\u00e7\u00e3o di\u00e1ria das estat\u00edsticas sobre a conta. Portanto, suponha que executaremos nosso script diariamente e atualizaremos as informa\u00e7\u00f5es no banco de dados.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Ser\u00e1 bom saber os saldos atuais, inclusive o valor nativo de XLM e os saldos de outros tokens. Desde que mantenhamos esses detalhes nos documentos que armazenamos, poderemos consult\u00e1-los a qualquer momento. Tamb\u00e9m teremos que nos certificar de que nossa chave seja uma esp\u00e9cie de carimbo de data\/hora ou ID incremental para que nossos documentos n\u00e3o sejam substitu\u00eddos por entradas mais recentes.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Tamb\u00e9m poder\u00edamos fazer alguns c\u00e1lculos intermedi\u00e1rios para manter outro documento atualizado com os totais da base, etc., mas deixaremos isso para uma postagem futura.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">As pr\u00f3ximas duas etapas s\u00e3o fazer o download desse documento JSON e carreg\u00e1-lo no Couchbase. Em seguida, veremos o resultado na interface do usu\u00e1rio do Console da Web e testaremos as consultas e os gr\u00e1ficos.<\/span><\/p>\n<h4><span style=\"font-weight: 400;\">Download de dados de contas Stellar com Python<\/span><\/h4>\n<p><span style=\"font-weight: 400;\">Este \u00e9, reconhecidamente, um exemplo muito simples que podemos desenvolver nas pr\u00f3ximas semanas.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Para acessar uma API da Web, usamos o m\u00f3dulo de solicita\u00e7\u00f5es do Python e armazenamos os resultados em um objeto JSON.<\/span><\/p>\n<pre class=\"\">import requests\r\n\r\nurl = \"https:\/\/horizon.stellar.org\/accounts\/GAF55XSX3WCHWUB6CEGSKKMLPKV56Y5MK4UCBRSSGRBBDENFEXSWWMDQ\/\"\r\n\r\nresponse = requests.request(\"GET\", url)\r\njsondoc = response.json()\r\n\r\n#for key, value in jsondoc.items():\r\n# print(key, \":\", value)<\/pre>\n<p><span style=\"font-weight: 400;\">Incluo um exemplo de loop simples para mostrar como \u00e9 f\u00e1cil se voc\u00ea quiser v\u00ea-lo impresso de uma forma bem feia. H\u00e1 t\u00e9cnicas de impress\u00e3o mais bonitas, mas usaremos as que est\u00e3o incorporadas no Couchbase para facilitar o processo, em vez de escrever mais c\u00f3digo aqui.<\/span><\/p>\n<h4><span style=\"font-weight: 400;\">Envio de documento JSON para o Couchbase<\/span><\/h4>\n<p><span style=\"font-weight: 400;\">Em seguida, usamos o objeto do nosso bucket do Couchbase e fazemos uma chamada de upsert. <\/span><em><span style=\"font-weight: 400;\">Upsert<\/span><\/em><span style=\"font-weight: 400;\"> \u00e9 o mesmo que um comando de inser\u00e7\u00e3o de documento ou banco de dados, mas atualizar\u00e1 qualquer documento existente, se ele j\u00e1 existir. No nosso caso, tamb\u00e9m queremos gerar um ID exclusivo e us\u00e1-lo como ID do documento.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Vamos adicionar um carimbo de data\/hora unix usando o <\/span><span style=\"font-weight: 400;\">tempo<\/span><span style=\"font-weight: 400;\"> e criar uma chave, conforme mostrado no guia de introdu\u00e7\u00e3o do Python SDK, que tamb\u00e9m inclui algumas capturas b\u00e1sicas de exce\u00e7\u00f5es.<\/span><\/p>\n<h4><span style=\"font-weight: 400;\">Juntando tudo<\/span><\/h4>\n<p><span style=\"font-weight: 400;\">Agora, vamos dar um passo atr\u00e1s e examinar o exemplo de c\u00f3digo consolidado criado com v\u00e1rias fun\u00e7\u00f5es para ajudar a compartimentar tudo e torn\u00e1-lo um pouco mais reutiliz\u00e1vel.<\/span><\/p>\n<pre class=\"\">import requests, time\r\nfrom couchbase.cluster import Cluster, ClusterOptions\r\nfrom couchbase.auth import PasswordAuthenticator\r\n\r\naccount = 'GAF55XSX3WCHWUB6CEGSKKMLPKV56Y5MK4UCBRSSGRBBDENFEXSWWMDQ'\r\n\r\ndef connect():\r\ncluster = Cluster('couchbase:\/\/localhost', ClusterOptions(PasswordAuthenticator('Administrator', 'Administrator')))\r\nreturn cluster.bucket('stellar')\r\n\r\ndef getjson():\r\nurl = \"https:\/\/horizon.stellar.org\/accounts\/%s\/\" % account\r\nprint(\"Fetching: \" + url)\r\nresponse = requests.request(\"GET\", url)\r\nreturn response.json()\r\n\r\ndef upsert_document(connection, doc):\r\nnow = int( time.time() )\r\ntry:\r\nkey = str(now) + \"_\" + account[:5]\r\nresult = connection.upsert(key, doc)\r\nprint(result)\r\nexcept Exception as e:\r\nprint(\"Error\",e)\r\n\r\ncb = connect()\r\njson = getjson()\r\nupsert_document(cb, json)<\/pre>\n<p><span style=\"font-weight: 400;\">O resultado listar\u00e1 o URL da API da Web que foi usado e mostrar\u00e1 um erro ou a mensagem <\/span><em><span style=\"font-weight: 400;\">Resultado da opera\u00e7\u00e3o<\/span><\/em><span style=\"font-weight: 400;\"> Detalhes:<\/span><\/p>\n<pre class=\"decode-attributes:false lang:default decode:true\">$ python app.py\r\n\r\nFetching: https:\/\/horizon.stellar.org\/accounts\/GAF55XSX3WCHWUB6CEGSKKMLPKV56Y5MK4UCBRSSGRBBDENFEXSWWMDQ\/\r\nOperationResult&lt;rc=0x0, key='1644906573_GAF55', cas=0x16d3e1d051760000, tracing_context=0, tracing_output=None&gt;<\/pre>\n<h4><span style=\"font-weight: 400;\">Ver os resultados do token no console da Web<\/span><\/h4>\n<p><span style=\"font-weight: 400;\">Depois de executar o script algumas vezes, voc\u00ea dever\u00e1 ter alguns documentos no bucket do projeto. Quando voc\u00ea tiver selecionado o <\/span><em><span style=\"font-weight: 400;\">estelar<\/span><\/em><span style=\"font-weight: 400;\"> balde, pressione o bot\u00e3o <\/span><b>Documentos <\/b><span style=\"font-weight: 400;\">(canto superior direito) para ver uma lista de documentos com os quais voc\u00ea pode interagir, um resultado \u00e9 mostrado na Figura 5.<\/span><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-12784\" src=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2022\/02\/Screen-Shot-2022-02-15-at-10.22.08-AM.png\" alt=\"Sample Stellar account document open in Couchbase web console\" width=\"797\" height=\"803\" srcset=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/02\/Screen-Shot-2022-02-15-at-10.22.08-AM.png 797w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/02\/Screen-Shot-2022-02-15-at-10.22.08-AM-298x300.png 298w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/02\/Screen-Shot-2022-02-15-at-10.22.08-AM-150x150.png 150w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/02\/Screen-Shot-2022-02-15-at-10.22.08-AM-768x774.png 768w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/02\/Screen-Shot-2022-02-15-at-10.22.08-AM-65x65.png 65w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/02\/Screen-Shot-2022-02-15-at-10.22.08-AM-50x50.png 50w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/02\/Screen-Shot-2022-02-15-at-10.22.08-AM-300x302.png 300w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/02\/Screen-Shot-2022-02-15-at-10.22.08-AM-20x20.png 20w\" sizes=\"auto, (max-width: 797px) 100vw, 797px\" \/><\/p>\n<p><span style=\"font-weight: 400;\">Figura 5. Exemplo de documento de conta Stellar aberto no console da Web do Couchbase.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Para permitir a consulta, precisamos criar alguns \u00edndices. Alterne para o \u00edndice <\/span><b>Consulta <\/b><span style=\"font-weight: 400;\">e insira o seguinte <\/span><a href=\"https:\/\/docs.couchbase.com\/files\/Couchbase-N1QL-CheatSheet.pdf\"><span style=\"font-weight: 400;\">N1QL<\/span><\/a><span style=\"font-weight: 400;\"> para configurar alguns \u00edndices. Observe que estamos usando uma cole\u00e7\u00e3o padr\u00e3o de documentos, portanto, colocamos um prefixo no nome do bucket para indicar isso. (Em uma postagem futura, separaremos nossos documentos para diferentes finalidades e usaremos cole\u00e7\u00f5es para isso).<\/span><\/p>\n<pre class=\"\">create primary index on default:stellar;\r\ncreate index idx_account_id on default:stellar(id);\r\ncreate index idx_modified on default:stellar(last_modified_time);\r\ncreate index idx_entrycount on stellar(subentry_count);<\/pre>\n<p><span style=\"font-weight: 400;\">Para cada um dos diferentes ativos:<\/span><\/p>\n<pre class=\"\">create index idx_asset_code on stellar(balances.asset_code);\r\ncreate index idx_asset_type on stellar(balances.asset_type);\r\ncreate index idx_asset_issuer on stellar(balances.asset_issuer);\r\ncreate index idx_asset_balance on stellar(balances.balance);<\/pre>\n<p><span style=\"font-weight: 400;\">Em seguida, teste o \u00edndice com uma consulta b\u00e1sica:<\/span><\/p>\n<pre class=\"decode-attributes:false lang:default decode:true\">select count(*) from stellar;<\/pre>\n<p>&nbsp;<\/p>\n<p><span style=\"font-weight: 400;\">O <\/span><b>Resultados <\/b><span style=\"font-weight: 400;\">deve mostrar uma sa\u00edda b\u00e1sica com o n\u00famero de documentos no compartimento, nesse caso, <\/span><span style=\"font-weight: 400;\">7<\/span><span style=\"font-weight: 400;\"> documentos, conforme mostrado na Figura 6.<\/span><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-12785\" src=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2022\/02\/Screen-Shot-2022-02-15-at-10.23.00-AM.png\" alt=\"Sample query to count the documents in the bucket\" width=\"287\" height=\"307\" srcset=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/02\/Screen-Shot-2022-02-15-at-10.23.00-AM.png 287w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/02\/Screen-Shot-2022-02-15-at-10.23.00-AM-280x300.png 280w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/02\/Screen-Shot-2022-02-15-at-10.23.00-AM-20x20.png 20w\" sizes=\"auto, (max-width: 287px) 100vw, 287px\" \/><\/p>\n<p><span style=\"font-weight: 400;\">Figura 6. Exemplo de consulta para contar os documentos no compartimento.<\/span><\/p>\n<h4><span style=\"font-weight: 400;\">Consulta de atributos em um conjunto de documentos JSON<\/span><\/h4>\n<p><span style=\"font-weight: 400;\">Voc\u00ea pode criar consultas facilmente, pois o N1QL \u00e9 muito semelhante ao SQL padr\u00e3o, mas com a intelig\u00eancia JSON incorporada. H\u00e1 fun\u00e7\u00f5es que nos permitem acessar entradas na tabela <\/span><span style=\"font-weight: 400;\"><em>balan\u00e7os<\/em> <\/span><span style=\"font-weight: 400;\">como se cada uma delas fosse uma coluna. Usando <\/span><em><span style=\"font-weight: 400;\">IN\u00daTIL<\/span><\/em><span style=\"font-weight: 400;\"><em>,<\/em> cada uma das subentradas se torna um nome de campo acess\u00edvel na consulta.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Por exemplo, a consulta a seguir lista todos os ativos e saldos:<\/span><\/p>\n<pre class=\"\">SELECT balances.balance AS balance, \r\n       balances.asset_code \r\nFROM stellar UNNEST balances<\/pre>\n<p><span style=\"font-weight: 400;\">A janela de consulta mostra os resultados em JSON por padr\u00e3o, mas voc\u00ea pode alternar para a op\u00e7\u00e3o Tabela e ver nossos resultados at\u00e9 o momento:<\/span><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-12786\" src=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2022\/02\/Screen-Shot-2022-02-15-at-10.24.14-AM.png\" alt=\"Table Option View\" width=\"516\" height=\"534\" srcset=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/02\/Screen-Shot-2022-02-15-at-10.24.14-AM.png 516w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/02\/Screen-Shot-2022-02-15-at-10.24.14-AM-290x300.png 290w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/02\/Screen-Shot-2022-02-15-at-10.24.14-AM-300x310.png 300w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/02\/Screen-Shot-2022-02-15-at-10.24.14-AM-20x20.png 20w\" sizes=\"auto, (max-width: 516px) 100vw, 516px\" \/><\/p>\n<h4><span style=\"font-weight: 400;\">Pr\u00f3ximas etapas<\/span><\/h4>\n<p><span style=\"font-weight: 400;\">Em nosso pr\u00f3ximo post, vamos nos aprofundar e criar alguns gr\u00e1ficos e usar mais magia de consulta.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Aqui est\u00e3o alguns links adicionais para ler sobre os t\u00f3picos que discutimos:<\/span><\/p>\n<ul>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><a href=\"https:\/\/docs.couchbase.com\/python-sdk\/current\/hello-world\/start-using-sdk.html\"><span style=\"font-weight: 400;\">Comece a usar o Couchbase Python SDK<\/span><\/a><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><a href=\"https:\/\/docs.couchbase.com\/files\/Couchbase-N1QL-CheatSheet.pdf\"><span style=\"font-weight: 400;\">Folha de verifica\u00e7\u00e3o do Couchbase N1QL (PDF)<\/span><\/a><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><a href=\"https:\/\/stellar.org\/\"><span style=\"font-weight: 400;\">Bolsa descentralizada Stellar (stellar.org)<\/span><\/a><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><a href=\"https:\/\/www.stellar.org\/learn\/blockchain-basics\"><span style=\"font-weight: 400;\">No\u00e7\u00f5es b\u00e1sicas de blockchain<\/span><\/a><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><a href=\"https:\/\/developers.stellar.org\/api\/resources\/accounts\/object\/\"><span style=\"font-weight: 400;\">Documentos da API do desenvolvedor Stellar (contas)<\/span><\/a><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><a href=\"https:\/\/medium.com\/stellar-global\/xlm-he-token-of-the-future-84548b890eb2\"><span style=\"font-weight: 400;\">Stellar Lumens - XLM - o token do futuro<\/span><\/a><\/li>\n<\/ul>","protected":false},"excerpt":{"rendered":"<p>This post describes how to build a basic client that records activity on the Stellar Decentralized Blockchain. Stellar hosts a growing list of new and different cryptocurrency alt-coins and tokens. With the code from this post you can create a [&hellip;]<\/p>","protected":false},"author":75185,"featured_media":12787,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"inline_featured_image":false,"footnotes":""},"categories":[2225,9139,2201],"tags":[8388,1519,9520],"ppma_author":[9163],"class_list":["post-12779","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-cloud","category-python","category-tools-sdks","tag-blockchain","tag-docker","tag-stellar"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v26.4 (Yoast SEO v26.4) - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Monitor Stellar Assets using Couchbase &amp; Python - The Couchbase Blog<\/title>\n<meta name=\"description\" content=\"This post describes how to build a basic client that records activity on the Stellar Decentralized Blockchain.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.couchbase.com\/blog\/pt\/monitor-stellar-assets-using-couchbase-python\/\" \/>\n<meta property=\"og:locale\" content=\"pt_BR\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Monitor Stellar Assets using Couchbase &amp; Python\" \/>\n<meta property=\"og:description\" content=\"This post describes how to build a basic client that records activity on the Stellar Decentralized Blockchain.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.couchbase.com\/blog\/pt\/monitor-stellar-assets-using-couchbase-python\/\" \/>\n<meta property=\"og:site_name\" content=\"The Couchbase Blog\" \/>\n<meta property=\"article:published_time\" content=\"2022-02-15T19:06:46+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-06-14T04:25:08+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/02\/christin-hume-mfB1B1s4sMc-unsplash-scaled.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"2560\" \/>\n\t<meta property=\"og:image:height\" content=\"1707\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Tyler Mitchell - Senior Product Marketing Manager\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@1tylermitchell\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Tyler Mitchell - Senior Product Marketing Manager\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"9 minutos\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/monitor-stellar-assets-using-couchbase-python\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/monitor-stellar-assets-using-couchbase-python\/\"},\"author\":{\"name\":\"Tyler Mitchell - Senior Product Marketing Manager\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/#\/schema\/person\/684cc0e5c60cd2e4b591db9621494ed0\"},\"headline\":\"Monitor Stellar Assets using Couchbase &#038; Python\",\"datePublished\":\"2022-02-15T19:06:46+00:00\",\"dateModified\":\"2025-06-14T04:25:08+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/monitor-stellar-assets-using-couchbase-python\/\"},\"wordCount\":1459,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/#organization\"},\"image\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/monitor-stellar-assets-using-couchbase-python\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/02\/christin-hume-mfB1B1s4sMc-unsplash-scaled.jpg\",\"keywords\":[\"blockchain\",\"docker\",\"stellar\"],\"articleSection\":[\"Couchbase Capella\",\"Python\",\"Tools &amp; SDKs\"],\"inLanguage\":\"pt-BR\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.couchbase.com\/blog\/monitor-stellar-assets-using-couchbase-python\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/monitor-stellar-assets-using-couchbase-python\/\",\"url\":\"https:\/\/www.couchbase.com\/blog\/monitor-stellar-assets-using-couchbase-python\/\",\"name\":\"Monitor Stellar Assets using Couchbase & Python - The Couchbase Blog\",\"isPartOf\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/monitor-stellar-assets-using-couchbase-python\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/monitor-stellar-assets-using-couchbase-python\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/02\/christin-hume-mfB1B1s4sMc-unsplash-scaled.jpg\",\"datePublished\":\"2022-02-15T19:06:46+00:00\",\"dateModified\":\"2025-06-14T04:25:08+00:00\",\"description\":\"This post describes how to build a basic client that records activity on the Stellar Decentralized Blockchain.\",\"breadcrumb\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/monitor-stellar-assets-using-couchbase-python\/#breadcrumb\"},\"inLanguage\":\"pt-BR\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.couchbase.com\/blog\/monitor-stellar-assets-using-couchbase-python\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"pt-BR\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/monitor-stellar-assets-using-couchbase-python\/#primaryimage\",\"url\":\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/02\/christin-hume-mfB1B1s4sMc-unsplash-scaled.jpg\",\"contentUrl\":\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/02\/christin-hume-mfB1B1s4sMc-unsplash-scaled.jpg\",\"width\":2560,\"height\":1707},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/monitor-stellar-assets-using-couchbase-python\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.couchbase.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Monitor Stellar Assets using Couchbase &#038; Python\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/#website\",\"url\":\"https:\/\/www.couchbase.com\/blog\/\",\"name\":\"The Couchbase Blog\",\"description\":\"Couchbase, the NoSQL Database\",\"publisher\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.couchbase.com\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"pt-BR\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/#organization\",\"name\":\"The Couchbase Blog\",\"url\":\"https:\/\/www.couchbase.com\/blog\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"pt-BR\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2023\/04\/admin-logo.png\",\"contentUrl\":\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2023\/04\/admin-logo.png\",\"width\":218,\"height\":34,\"caption\":\"The Couchbase Blog\"},\"image\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/#\/schema\/logo\/image\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/#\/schema\/person\/684cc0e5c60cd2e4b591db9621494ed0\",\"name\":\"Tyler Mitchell - Senior Product Marketing Manager\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"pt-BR\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/#\/schema\/person\/image\/d8a7c532bf2b94b7a2fe7a8439aafd75\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/ebec3213e756f2e1f7118fcb5722e2cd1484c9256ae34ceb8f77054b986f21ce?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/ebec3213e756f2e1f7118fcb5722e2cd1484c9256ae34ceb8f77054b986f21ce?s=96&d=mm&r=g\",\"caption\":\"Tyler Mitchell - Senior Product Marketing Manager\"},\"description\":\"Works as Senior Product Marketing Manager at Couchbase, helping bring knowledge about products into the public limelight while also supporting our field teams with valuable content.\",\"sameAs\":[\"https:\/\/linkedin.com\/in\/tylermitchell\",\"https:\/\/x.com\/1tylermitchell\",\"https:\/\/www.youtube.com\/channel\/UCBZFuoiTcg0f3lGSQwLjeTg\"],\"url\":\"https:\/\/www.couchbase.com\/blog\/pt\/author\/tylermitchell\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Monitor Stellar Assets using Couchbase & Python - The Couchbase Blog","description":"Esta publica\u00e7\u00e3o descreve como criar um cliente b\u00e1sico que registra a atividade no blockchain descentralizado da Stellar.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.couchbase.com\/blog\/pt\/monitor-stellar-assets-using-couchbase-python\/","og_locale":"pt_BR","og_type":"article","og_title":"Monitor Stellar Assets using Couchbase & Python","og_description":"This post describes how to build a basic client that records activity on the Stellar Decentralized Blockchain.","og_url":"https:\/\/www.couchbase.com\/blog\/pt\/monitor-stellar-assets-using-couchbase-python\/","og_site_name":"The Couchbase Blog","article_published_time":"2022-02-15T19:06:46+00:00","article_modified_time":"2025-06-14T04:25:08+00:00","og_image":[{"width":2560,"height":1707,"url":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/02\/christin-hume-mfB1B1s4sMc-unsplash-scaled.jpg","type":"image\/jpeg"}],"author":"Tyler Mitchell - Senior Product Marketing Manager","twitter_card":"summary_large_image","twitter_creator":"@1tylermitchell","twitter_misc":{"Written by":"Tyler Mitchell - Senior Product Marketing Manager","Est. reading time":"9 minutos"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.couchbase.com\/blog\/monitor-stellar-assets-using-couchbase-python\/#article","isPartOf":{"@id":"https:\/\/www.couchbase.com\/blog\/monitor-stellar-assets-using-couchbase-python\/"},"author":{"name":"Tyler Mitchell - Senior Product Marketing Manager","@id":"https:\/\/www.couchbase.com\/blog\/#\/schema\/person\/684cc0e5c60cd2e4b591db9621494ed0"},"headline":"Monitor Stellar Assets using Couchbase &#038; Python","datePublished":"2022-02-15T19:06:46+00:00","dateModified":"2025-06-14T04:25:08+00:00","mainEntityOfPage":{"@id":"https:\/\/www.couchbase.com\/blog\/monitor-stellar-assets-using-couchbase-python\/"},"wordCount":1459,"commentCount":0,"publisher":{"@id":"https:\/\/www.couchbase.com\/blog\/#organization"},"image":{"@id":"https:\/\/www.couchbase.com\/blog\/monitor-stellar-assets-using-couchbase-python\/#primaryimage"},"thumbnailUrl":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/02\/christin-hume-mfB1B1s4sMc-unsplash-scaled.jpg","keywords":["blockchain","docker","stellar"],"articleSection":["Couchbase Capella","Python","Tools &amp; SDKs"],"inLanguage":"pt-BR","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.couchbase.com\/blog\/monitor-stellar-assets-using-couchbase-python\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.couchbase.com\/blog\/monitor-stellar-assets-using-couchbase-python\/","url":"https:\/\/www.couchbase.com\/blog\/monitor-stellar-assets-using-couchbase-python\/","name":"Monitor Stellar Assets using Couchbase & Python - The Couchbase Blog","isPartOf":{"@id":"https:\/\/www.couchbase.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.couchbase.com\/blog\/monitor-stellar-assets-using-couchbase-python\/#primaryimage"},"image":{"@id":"https:\/\/www.couchbase.com\/blog\/monitor-stellar-assets-using-couchbase-python\/#primaryimage"},"thumbnailUrl":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/02\/christin-hume-mfB1B1s4sMc-unsplash-scaled.jpg","datePublished":"2022-02-15T19:06:46+00:00","dateModified":"2025-06-14T04:25:08+00:00","description":"Esta publica\u00e7\u00e3o descreve como criar um cliente b\u00e1sico que registra a atividade no blockchain descentralizado da Stellar.","breadcrumb":{"@id":"https:\/\/www.couchbase.com\/blog\/monitor-stellar-assets-using-couchbase-python\/#breadcrumb"},"inLanguage":"pt-BR","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.couchbase.com\/blog\/monitor-stellar-assets-using-couchbase-python\/"]}]},{"@type":"ImageObject","inLanguage":"pt-BR","@id":"https:\/\/www.couchbase.com\/blog\/monitor-stellar-assets-using-couchbase-python\/#primaryimage","url":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/02\/christin-hume-mfB1B1s4sMc-unsplash-scaled.jpg","contentUrl":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/02\/christin-hume-mfB1B1s4sMc-unsplash-scaled.jpg","width":2560,"height":1707},{"@type":"BreadcrumbList","@id":"https:\/\/www.couchbase.com\/blog\/monitor-stellar-assets-using-couchbase-python\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.couchbase.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Monitor Stellar Assets using Couchbase &#038; Python"}]},{"@type":"WebSite","@id":"https:\/\/www.couchbase.com\/blog\/#website","url":"https:\/\/www.couchbase.com\/blog\/","name":"Blog do Couchbase","description":"Couchbase, o banco de dados NoSQL","publisher":{"@id":"https:\/\/www.couchbase.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.couchbase.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"pt-BR"},{"@type":"Organization","@id":"https:\/\/www.couchbase.com\/blog\/#organization","name":"Blog do Couchbase","url":"https:\/\/www.couchbase.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"pt-BR","@id":"https:\/\/www.couchbase.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2023\/04\/admin-logo.png","contentUrl":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2023\/04\/admin-logo.png","width":218,"height":34,"caption":"The Couchbase Blog"},"image":{"@id":"https:\/\/www.couchbase.com\/blog\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/www.couchbase.com\/blog\/#\/schema\/person\/684cc0e5c60cd2e4b591db9621494ed0","name":"Tyler Mitchell - Gerente s\u00eanior de marketing de produtos","image":{"@type":"ImageObject","inLanguage":"pt-BR","@id":"https:\/\/www.couchbase.com\/blog\/#\/schema\/person\/image\/d8a7c532bf2b94b7a2fe7a8439aafd75","url":"https:\/\/secure.gravatar.com\/avatar\/ebec3213e756f2e1f7118fcb5722e2cd1484c9256ae34ceb8f77054b986f21ce?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/ebec3213e756f2e1f7118fcb5722e2cd1484c9256ae34ceb8f77054b986f21ce?s=96&d=mm&r=g","caption":"Tyler Mitchell - Senior Product Marketing Manager"},"description":"Works as Senior Product Marketing Manager at Couchbase, helping bring knowledge about products into the public limelight while also supporting our field teams with valuable content.","sameAs":["https:\/\/linkedin.com\/in\/tylermitchell","https:\/\/x.com\/1tylermitchell","https:\/\/www.youtube.com\/channel\/UCBZFuoiTcg0f3lGSQwLjeTg"],"url":"https:\/\/www.couchbase.com\/blog\/pt\/author\/tylermitchell\/"}]}},"authors":[{"term_id":9163,"user_id":75185,"is_guest":0,"slug":"tylermitchell","display_name":"Tyler Mitchell - Senior Product Marketing Manager","avatar_url":"https:\/\/secure.gravatar.com\/avatar\/876da1e4284f1832c871b3514caf7867357744b8c0a370ef6f53a79dee2f379e?s=96&d=mm&r=g","author_category":"","last_name":"Mitchell - Senior Product Marketing Manager","first_name":"Tyler","job_title":"Senior Product Marketing Manager","user_url":"","description":"Trabalha como Gerente S\u00eanior de Marketing de Produto na Couchbase, ajudando a levar o conhecimento sobre os produtos para o centro das aten\u00e7\u00f5es do p\u00fablico e, ao mesmo tempo, apoiando nossas equipes de campo com conte\u00fado valioso. Sua paix\u00e3o pessoal s\u00e3o todas as coisas geoespaciais, tendo trabalhado em GIS durante metade de sua carreira. Agora, a IA e a pesquisa vetorial est\u00e3o em sua mente."}],"_links":{"self":[{"href":"https:\/\/www.couchbase.com\/blog\/pt\/wp-json\/wp\/v2\/posts\/12779","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.couchbase.com\/blog\/pt\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.couchbase.com\/blog\/pt\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/pt\/wp-json\/wp\/v2\/users\/75185"}],"replies":[{"embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/pt\/wp-json\/wp\/v2\/comments?post=12779"}],"version-history":[{"count":0,"href":"https:\/\/www.couchbase.com\/blog\/pt\/wp-json\/wp\/v2\/posts\/12779\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/pt\/wp-json\/wp\/v2\/media\/12787"}],"wp:attachment":[{"href":"https:\/\/www.couchbase.com\/blog\/pt\/wp-json\/wp\/v2\/media?parent=12779"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/pt\/wp-json\/wp\/v2\/categories?post=12779"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/pt\/wp-json\/wp\/v2\/tags?post=12779"},{"taxonomy":"author","embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/pt\/wp-json\/wp\/v2\/ppma_author?post=12779"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}