Code Monkey home page Code Monkey logo

indexer's Introduction

Algorand

CircleCI CircleCI Github Contribute

Algorand Indexer

The Indexer is an API that provides search capabilities for Algorand on-chain data. Data is written by Conduit to populate a PostgreSQL compatible database.

Building from source

Development is done using the Go Programming Language, the version is specified in the project's go.mod file.

Run make to build Indexer, the binary is located at cmd/algorand-indexer/algorand-indexer.

Requirements

All recommendations here should be used as a starting point. Further benchmarking should be done to verify performance is acceptible for any application using Indexer.

Versions

System

For a simple deployment the following configuration works well:

  • Network: Indexer, Conduit, Algod and PostgreSQL should all be on the same network.
  • Indexer: 1 CPU and 1GB of ram. Scale up for systems with high query volume.
  • Conduit + Algod: 4 CPU and 8 GB of ram.
    • Storage: algod follower nodes, 40 GiB, 3000 IOPS minimum.
    • Deployments allocating less ram might work in conjunction with GOMEMLIMIT for Algod (and even Conduit). This configuration is not tested, so use with caution and monitor closely.
  • Database: When hosted on AWS a db.r5.xlarge instance works well.

A database with replication can be used to scale read volume. Configure a single Conduit writer with multiple Indexer readers.

Quickstart

Indexer is part of the sandbox private network configurations, which you can use to get started.

Features

  • Search and filter accounts, transactions, assets, and asset balances with many different parameters.
  • Pagination of results.
  • Enriched transaction and account data:
    • Confirmation round (block containing the transaction)
    • Confirmation time
    • Signature type
    • Close amounts
    • Create/delete rounds.
  • Human readable field names instead of the space optimized protocol level names.

Contributing

Contributions welcome! Please refer to our CONTRIBUTING document.

Usage

Configure Indexer with a PostgreSQL compatible database. Conduit should be used to populate the database and one or more Indexer daemons can be run to serve the API. For further isolation, a readonly user can be created for the database.

~$ algorand-indexer daemon --data-dir /tmp --postgres "user=readonly password=YourPasswordHere {other connection string options for your database}"

The Postgres backend does specifically note the username "readonly" and changes behavior to avoid writing to the database. But the primary benefit is that Postgres can enforce restricted access to this user. This can be configured with:

CREATE USER readonly LOGIN PASSWORD 'YourPasswordHere';
REVOKE ALL ON ALL TABLES IN SCHEMA public FROM readonly;
GRANT SELECT ON ALL TABLES IN SCHEMA public TO readonly;

Authorization

When --token your-token is provided, an authentication header is required. For example:

~$ curl localhost:8980/transactions -H "X-Indexer-API-Token: your-token"

Disabling Parameters

The Indexer has the ability to selectively enable or disable parameters for endpoints. Disabling a "required" parameter will result in the entire endpoint being disabled while disabling an "optional" parameter will cause an error to be returned only if the parameter is provided.

Viewing the Current Configuration

The Indexer has a default set of disabled parameters. To view the disabled parameters issue:

~$ algorand-indexer api-config

This will output ONLY the disabled parameters in a YAML configuration. To view all parameters (both enabled and disabled) issue:

~$ algorand-indexer api-config --all

Interpreting The Configuration

Below is a snippet of the output from algorand-indexer api-config:

/v2/accounts:
    optional:
        - currency-greater-than: disabled
        - currency-less-than: disabled
/v2/assets/{asset-id}/transactions:
    optional:
        - note-prefix: disabled
        - tx-type: disabled
        - sig-type: disabled
        - before-time: disabled
        - after-time: disabled
        - currency-greater-than: disabled
        - currency-less-than: disabled
        - address-role: disabled
        - exclude-close-to: disabled
        - rekey-to: disabled
    required:
        - asset-id: disabled

Seeing this we know that the /v2/accounts endpoint will return an error if either currency-greater-than or currency-less-than is provided. Additionally, because a "required" parameter is provided for /v2/assets/{asset-id}/transactions then we know this entire endpoint is disabled. The optional parameters are provided so that you can understand what else is disabled if you enable all "required" parameters.

NOTE: An empty parameter configuration file results in all parameters being ENABLED.

For more information on disabling parameters see the Disabling Parameters Guide.

Metrics

The /metrics endpoint is configured with the --metrics-mode option and configures if and how Prometheus formatted metrics are generated.

There are different settings:

Setting Description
ON Metrics for each REST endpoint in addition to application metrics.
OFF No metrics endpoint.
VERBOSE Separate metrics for each combination of query parameters. This option should be used with caution, there are many combinations of query parameters which could cause extra memory load depending on usage patterns.

Connection Pool Settings

One can set the maximum number of connections allowed in the local connection pool by using the --max-conn setting. It is recommended to set this number to be below the database server connection pool limit.

If the maximum number of connections/active queries is reached, subsequent connections will wait until a connection becomes available, or timeout according to the read-timeout setting.

Settings

Settings can be provided from the command line, a configuration file, or an environment variable

Command Line Flag (long) (short) Config File Environment Variable
postgres P postgres-connection-string INDEXER_POSTGRES_CONNECTION_STRING
data-dir i data INDEXER_DATA
pidfile pidfile INDEXER_PIDFILE
server S server-address INDEXER_SERVER_ADDRESS
token t api-token INDEXER_API_TOKEN
metrics-mode metrics-mode INDEXER_METRICS_MODE
logfile f logfile INDEXER_LOGFILE
loglevel l loglevel INDEXER_LOGLEVEL
max-conn max-conn INDEXER_MAX_CONN
write-timeout write-timeout INDEXER_WRITE_TIMEOUT
read-timeout read-timeout INDEXER_READ_TIMEOUT
max-api-resources-per-account max-api-resources-per-account INDEXER_MAX_API_RESOURCES_PER_ACCOUNT
max-transactions-limit max-transactions-limit INDEXER_MAX_TRANSACTIONS_LIMIT
default-transactions-limit default-transactions-limit INDEXER_DEFAULT_TRANSACTIONS_LIMIT
max-accounts-limit max-accounts-limit INDEXER_MAX_ACCOUNTS_LIMIT
default-accounts-limit default-accounts-limit INDEXER_DEFAULT_ACCOUNTS_LIMIT
max-assets-limit max-assets-limit INDEXER_MAX_ASSETS_LIMIT
default-assets-limit default-assets-limit INDEXER_DEFAULT_ASSETS_LIMIT
max-balances-limit max-balances-limit INDEXER_MAX_BALANCES_LIMIT
default-balances-limit default-balances-limit INDEXER_DEFAULT_BALANCES_LIMIT
max-applications-limit max-applications-limit INDEXER_MAX_APPLICATIONS_LIMIT
default-applications-limit default-applications-limit INDEXER_DEFAULT_APPLICATIONS_LIMIT
enable-all-parameters enable-all-parameters INDEXER_ENABLE_ALL_PARAMETERS

Command line

The command line arguments always take priority over the config file and environment variables.

~$ ./algorand-indexer daemon --data-dir /tmp --pidfile /var/lib/algorand/algorand-indexer.pid --postgres "host=mydb.mycloud.com user=postgres password=password dbname=mainnet"`

Data Directory

The Indexer data directory is the location where the Indexer can store and/or load data needed for configuration. The data directory is effectively stateless, so it does not need to be persisted across deployments as long as the configuration is supplied.

It is a required argument for Indexer daemon operation. Supply it to the Indexer via the --data-dir/-i flag.

For more information on the data directory see Indexer Data Directory.

Auto-Loading Configuration

The Indexer will scan the data directory at startup and load certain configuration files if they are present. The files are as follows:

  • indexer.yml - Indexer Configuration File
  • api_config.yml - API Parameter Enable/Disable Configuration File

NOTE: It is not allowed to supply both the command line flag AND have an auto-loading configuration file in the data directory. Doing so will result in an error.

To see an example of how to use the data directory to load a configuration file check out the Disabling Parameters Guide.

Example environment variable

Environment variables are also available to configure indexer. Environment variables override settings in the config file and are overridden by command line arguments.

The same indexer configuration from earlier can be made in bash with the following:

~$ export INDEXER_POSTGRES_CONNECTION_STRING="host=mydb.mycloud.com user=postgres password=password dbname=mainnet"
~$ export INDEXER_PIDFILE="/var/lib/algorand/algorand-indexer.pid"
~$ export INDEXER_DATA="/tmp"
~$ ./algorand-indexer daemon

Configuration file

Default values are placed in the configuration file. They can be overridden with environment variables and command line arguments.

The configuration file must named indexer.yml and placed in the data directory (see above). The filepath may be set on the CLI using --configfile or -c but this functionality is deprecated.

Here is an example indexer.yml file:

postgres-connection-string: "host=mydb.mycloud.com user=postgres password=password dbname=mainnet"
pidfile: "/var/lib/algorand/algorand-indexer.pid"

Place this file in the data directory (/tmp/data-dir in this example) and supply it to the Indexer daemon:

~$ ./algorand-indexer daemon --data-dir /tmp/data-dir

Systemd

/lib/systemd/system/algorand-indexer.service can be partially overridden by creating /etc/systemd/system/algorand-indexer.service.d/local.conf. The most common things to override will be the command line and pidfile. The overriding local.conf file might be this:

[Service]
ExecStart=
ExecStart=/usr/bin/algorand-indexer daemon --data-dir /tmp --pidfile /var/lib/algorand/algorand-indexer.pid --postgres "host=mydb.mycloud.com user=postgres password=password dbname=mainnet"
PIDFile=/var/lib/algorand/algorand-indexer.pid

The systemd unit file can be found in source at misc/systemd/algorand-indexer.service

Note that the service assumes an algorand group and user. If the Algorand package has already been installed on the same machine, this group and user has already been created. However, if the Indexer is running stand-alone, the group and user will need to be created before starting the daemon:

adduser --system --group --home /var/lib/algorand --no-create-home algorand

Once configured, turn on your daemon with:

sudo systemctl enable algorand-indexer
sudo systemctl start algorand-indexer

If you wish to run multiple indexers on one server under systemd, see the comments in /lib/systemd/system/[email protected] or misc/systemd/[email protected]

Unique Database Configurations

Load balancing

If Conduit is deployed with a clustered database using multiple readers behind a load balancer, query discrepancies are possible due to database replication lag. Users should check the current-round response field and be prepared to retry queries when stale data is detected.

Custom indices

Different application workloads will require different custom indices in order to make queries perform well. More information is available in PostgresqlIndexes.md.

Transaction results order

The order transactions are returned in depends on whether or not an account address filter is used.

When searching by an account, results are returned most recent first. The intent being that a wallet application would want to display the most recent transactions. A special index is used to make this case performant.

For all other transaction queries, results are returned oldest first. This is because it is the physical order they would normally be written in, so it is going to be faster.

Migrating from Indexer v2

If you were previously using Indexer 2.x you will need to reconfigure your deployment to include Conduit. The data loading component has moved from Indexer 2.x to Conduit.

See the Indexer 2.x to 3.x Migration FAQ for common questions.

Additional info around configuring Conduit can be found here.

indexer's People

Contributors

algo-devops-service avatar algobarb avatar algobolson avatar algochoi avatar algojack avatar algojohnlee avatar algorandskiy avatar algorotem avatar algostephenakiki avatar barnjamin avatar bbroder-algo avatar brianolson avatar bricerisingalgorand avatar btoll avatar cce avatar dependabot[bot] avatar egieseke avatar eric-warehime avatar gmalouf avatar jannotti avatar jasonpaulos avatar michaeldiamant avatar ohill avatar onetechnical avatar psjoe avatar shiqizng avatar tolikzinovyev avatar tsachiherman avatar tzaffi avatar winder avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

indexer's Issues

Transaction searches on Assets fails

curl "localhost:8980/v2/assets/2044572/transactions?address-role=receiver&address=UF7ATOM6PBLWMQMPUQ5QLA5DZ5E35PXQ2IENWGZQLEJJAAPAPGEGC3ZYNI" | json_pp

returns

"message" : "invalid input: unable to parse address 'address': illegal base32 data at input byte 0"

Seems to only happen with the address-role parameter

Indexer Limit Constant Testing

Indexer currently has a number of constants to define default limits, and max limits. The value of these were based on pure intuition and checked with a couple people who agreed that they "seem alright".

We could instead create a small performance test and define some requirements like "a query with default limits should never take more than 200ms, and with maximum limits it should never take more than 1 second". With that information we can run some tests and find the actual limits to achieve this performance.

In addition we should make them configurable so that indexer runners can reconfigure them based on their use cases.

The constants in question are at the top of the API handlers file:

const maxTransactionsLimit = 10000
const defaultTransactionsLimit = 1000

// Accounts
const maxAccountsLimit = 1000
const defaultAccountsLimit = 100

// Assets
const maxAssetsLimit = 1000
const defaultAssetsLimit = 100

// Asset Balances
const maxBalancesLimit = 10000
const defaultBalancesLimit = 1000

Acceptance criteria:

  • Run those tests
  • Update those constants
  • Make the constants configurable

Add 'pretty' parameter for pretty-printed JSON in REST API

Echo provides support for a pretty parameter out of the box, but our strict parameter checking rejects it.

We need to either add pretty to the spec, or update our oapi-codegen generator fork to add in pretty to the generated code.

Indexer Default / Maximum Values

Make sure there are sensible default values for indexer parameters.

For example, "Limit" cannot default to unlimited, returning all transactions doesn't make sense.

Add /swagger.json endpoint to provide specfile

Similar to the go-algorand repo, we should provide an endpoint for fetching the open api specfile.

Unlike the old swagger.json endpoint, the v2 endpoints are split into multiple pieces. We need to find a way to merge them together.

SDK / Cucumber - Tag Whitelist

The SDKs should whitelist which tests they run to avoid breaking every time a new test is added.

  • Go
  • Java
  • Javascript
  • Python

The current whitelists
unit: @unit.offline or @unit.algod or @unit.indexer
integration: @algod or @assets or @auction or @kmd or @send or @template or @indexer

Stateful TEAL Indexer V2 Backend - Add new endpoints for Apps to indexer

@ian-algorand commented on Mon May 04 2020

	--- Update Specs - 1
	--- /application/<app-id>?round application info (incl. GlobalState + ApprovalProgram + ClearStateProgram) for app ID at round - 1
	--- /applications list applications - 1
	--- /accounts?include-global-state all LocalStates for some account at round ?include-global=<appid> Fuzed per-account state and global-state fetch operation. (optional) - 1
	--- /transactions  filter transactions by app ID - 1

DEB package missing user/group creation script

The DEB package for indexer-2.0 is missing a post-install script that creates the algorand user and group, as well as the home directory. If you install it on a node that's all ready got the algorand package installed, that's all ready handled. But if you install the indexer on its own, the default systemd init scripts won't work. They assume a user "algorand" and group "algorand".

The following command creates the user correctly (at least on Ubuntu):

useradd -r -m -d "/var/lib/algorand" algorand

Update Spec with new Rekeying options

Add new parameters and fields to spec:

  1. Parameters:
  • /account endpoints - new auth-addr parameter.
  • /transaction endpoints - new rekey-to boolean filter filter.
  1. Fields:
  • Account has a new spend field, a.k.a. SpendingKey a.k.a. AuthAddr.
  • Transaction has a new RekeyTo field
The need - Given an account `A` that was rekeyed to account `B`, I want to be able to find `A` by searching for `B`.

Motivation - If someone lost his wallet and the only thing he has left is his private key, he needs to be able to find the association of `B` to `A` in order to recover it completely. 

How we achieve it -
Adding an option to filter `/accounts` by the `AuthAddr` field.
The need - Given an account A, I want to know the list of all historical verifiers.

How we achieve it -
Adding an option to filter /transactions by weather a transaction has the RekeyTo field.

Implement IndexerDB Rekey Filters

Add any query and DB updates required to support new rekeying filters.

type TransactionFilter struct {
+	RekeyTo    *bool // nil for no filter
        ...
}

type AccountQueryOptions struct {
+	// return any accounts with this spending key
+	EqualToAuthAddr []byte
        ...
}

track account type [2]

When a txn is sent from an address, record what the signature reveals about that type of account

Connect new Rekeying parameters and fields

Connect the new parameters in these endpoints:

  • /accounts?auth-addr={addr}
  • /transactions?rekey-to={true|false}
  • /accounts/{id}/transactions?rekey-to={true|false}
  • /assets/{id}/transactions?rekey-to={true|false}

Make sure the new RekeyTo and SpendingKey fields are populated in the Transaction/Account objects.

The need - Given an account `A` that was rekeyed to account `B`, I want to be able to find `A` by searching for `B`.

Motivation - If someone lost his wallet and the only thing he has left is his private key, he needs to be able to find the association of `B` to `A` in order to recover it completely. 

How we achieve it -
Adding an option to filter `/accounts` by the `AuthAddr` field.
The need - Given an account A, I want to know the list of all historical verifiers.

How we achieve it -
Adding an option to filter /transactions by weather a transaction has the RekeyTo field.

Database: Postgres [1]

Implement Postgres as first SQL database for Indexer
Store blocks, transactions, accounts, assets, and maintenance process state

[3] automated e2e test

Indexer has mainly been manually tested by running it against mainnet blocks and comparing the end result account balances of algod vs indexer. Make a small test case and script to automatically test Indexer.

track asset opt-ins?

Currently the Indexer ignores zero balances of assets created in the 'opt-in' transaction where an account allows itself to receive a balance of an asset. It's probably a useful stat to know how many accounts have opted in to an asset.

Health Check Endpoint [1]

Probably a text/plain or tiny json return of IndexerDb.GetMaxRound() and IndexerDb.GetMetastate() -> 'account_round' just to prove we can read the db and also tell how much data we've loaded and indexed.

This includes updating the SDKs

Design a migration plan

Looks like it should simply "install on archival and let it sync" but would be good to verify and write down clear instructions.

Config File

We should have a config file to make it easy to start indexer with the same configuration every time.

This config file may also be useful for the systemd config, as we could install a config file in /etc and configure the service without changing the systemd script.

import is slow, bugs in rewind

a test on 40%-full blocks ran at just over 1000 TPS
some account rewinds around asset creation or algo close-to have bugs.

backend: rewind Application state

Given data from #61 implement 'rewind' state-at-round functionality.
Local state rewind for an account works with just the txns on that account.
Global state rewind for an app fetches all txns on the appid.
Fuzed global+local rewind does global state rewind but also filters all those txns into doing rewind on an account's local state.

track rekeying [1]

when a txn has the RekeyTo "rekey" field, record that into AccountData.SpendingKey "spend"

Accounting Logic [3]

Re-implement accounting logic enough to start with the genesis config and walk forward through blocks and transactions to get to current account state (algo and asset balances, freeze status, etc.)
Validate against mainnet and testnet history.

Database: Sqlite3 [2]

For easier development and testing, make an Sqlite3 back end equivalent to Postgres

backend: import Applications data

  • add reverse-state-change to state change Txns
  • implement schema migration framework
  • add indexed appid column to txn table
  • add accounts referenced in txn to txn_participation

Stateful TEAL Indexer V2 Backend - Add new endpoints for Apps to indexer

  • /applications/<app-id> application info (incl. GlobalState + ApprovalProgram + ClearStateProgram)
    • round - rewind to a given round
  • /applications list applications
    • application-id filter
    • round - rewind to a given round (this should be disabled by default)
  • /accounts all LocalStates for some account at round
    • application-id filter
    • include-global-state={appid} - Fuzed per-account state and global-state fetch operation.
  • /transactions, /assets/{id}/transactions, /accounts/{id}/transactions
    • application-id filter
    • created-application-id model response - if a transaction creates an application, return the ID

record asset close amounts for rewind [1]

so that we can walk-back an asset transfer with close, record the amount that moved.
Transactions in Algos already record this on the block, but Asset txns don't, so we need to work it up in the indexer.

Query API [5]

Replicate/embrace/extend queries from algod API for looking up historical transactions and blocks.
Add new APIs we expect to need?

Indexer Forget Me Not's

  • account status isn't set, and there is no account type. Expected "online|offline", and "sig|msig|lsig"
      {
         "amount-without-pending-rewards" : 300000000000000,
         "status" : "",
         "round" : 5963692,
         "rewards" : 0,
         "address" : "7NQED6NJ4NZU7B5HGGFU2ZEC2UZQYU2SA5S4QOE2EXBVAR4CNAHIXV2XYY",
         "pending-rewards" : 34694700000000,
         "amount" : 334694700000000
      }
  • Transaction "amount" field always seems to be zero
{
   "current-round" : 5963720,
   "next-token" : "9wZaAAAAAAAAAAAA",
   "transactions" : [
      {
         "note" : "GUD3NYf1FJM=",
         "type" : "pay",
         "receiver-rewards" : 0,
         "first-valid" : 5900019,
         "payment-transaction" : {
            "receiver" : "UN5FBY2AMO7IVHS65RULQ4M5GXFABC2FK6JFFJOI2H2ZM5H4FDGX4BQPMY",
            "amount" : 0,
            "close-amount" : 0
         },
         "signature" : {
            "sig" : "oXEO2ESbGo09aIMKHkqZerbGbVYOIHi0dJS4mz85wKfFrnCpkN9Yiz3pYgwqk9jaRZ4didnCzHRiEe5GnYIcCg=="
         },
         "close-rewards" : 0,
         "intra-round-offset" : 0,
         "fee" : 1000,
         "round-time" : 1586167166,
         "closing-amount" : 0,
         "genesis-id" : "mainnet-v1.0",
         "sender-rewards" : 11029242,
         "last-valid" : 5901019,
         "confirmed-round" : 5900023,
         "id" : "3D3XH5RBOY54UO4WA3IEEQEBGWYMEC37Y6XEJZEPM76PAFISUE5A",
         "sender" : "SP745JJR4KPRQEXJZHVIEN736LYTL2T2DFMG3OIIFJBV66K73PHNMDCZVM"
      }
   ]
}

Account balance at a specific round (this seems to work, but for some reason when tested before the account wasn't changing. Closed account?)

will@will-algorand:~/algorand/indexer$ curl -s "localhost:8980/accounts/UN5FBY2AMO7IVHS65RULQ4M5GXFABC2FK6JFFJOI2H2ZM5H4FDGX4BQPMY?round=5900023" | json_pp
{
   "current-round" : 5963754,
   "account" : {
      "rewards" : 0,
      "status" : "",
      "pending-rewards" : 0,
      "round" : 5900023,
      "address" : "UN5FBY2AMO7IVHS65RULQ4M5GXFABC2FK6JFFJOI2H2ZM5H4FDGX4BQPMY",
      "amount-without-pending-rewards" : 4874200000,
      "amount" : 4874200000
   }
}
will@will-algorand:~/algorand/indexer$ curl -s "localhost:8980/accounts/UN5FBY2AMO7IVHS65RULQ4M5GXFABC2FK6JFFJOI2H2ZM5H4FDGX4BQPMY?round=5900022" | json_pp
{
   "current-round" : 5963755,
   "account" : {
      "status" : "",
      "address" : "UN5FBY2AMO7IVHS65RULQ4M5GXFABC2FK6JFFJOI2H2ZM5H4FDGX4BQPMY",
      "amount" : 200000,
      "round" : 5900022,
      "pending-rewards" : 0,
      "amount-without-pending-rewards" : 200000,
      "rewards" : 0
   }
}

Moved to separate ticket
algorand/go-algorand#975
Error for unknown parameters. If there is a typo in a parameter, or just something completely wrong the endpoint ignores it. Should there be an error for unknown parameters? For example tx-type is a parameter and txtype is not. If you provide txtype=pay it will be ignored and the responses wont be filtered as expected. Should this be an error?

Asset search case sensitivity. Something weird is going on here that needs to be understood.

curl -s "localhost:8980/assets?name=USDt"|json_pp

{
   "assets" : [
      {
         "params" : {
            "freeze" : "KNVSPA2ADOFZ4Q4OQMRAM2Y7V7IUQ3SICY2DSOACK5U7RXXP6LZNBV5A3I",
            "reserve" : "KNVSPA2ADOFZ4Q4OQMRAM2Y7V7IUQ3SICY2DSOACK5U7RXXP6LZNBV5A3I",
            "default-frozen" : false,
            "decimals" : 2,
            "name" : "USDt",
            "manager" : "KNVSPA2ADOFZ4Q4OQMRAM2Y7V7IUQ3SICY2DSOACK5U7RXXP6LZNBV5A3I",
            "unit-name" : "usdt",
            "clawback" : "KNVSPA2ADOFZ4Q4OQMRAM2Y7V7IUQ3SICY2DSOACK5U7RXXP6LZNBV5A3I",
            "total" : 1844674407370955,
            "metadata-hash" : "dGhpc0lzU29tZUxlbmd0aDMySGFzaENvbW1pdG1lbnQ=",
            "creator" : "KNVSPA2ADOFZ4Q4OQMRAM2Y7V7IUQ3SICY2DSOACK5U7RXXP6LZNBV5A3I",
            "url" : "https://path/to/my/asset/details"
         },
         "index" : 385599
      }
   ],
   "current-round" : 5963852
}


curl -s "localhost:8980/assets?name=usdt"|json_pp

{
   "current-round" : 5963865,
   "assets" : []
}

hook indexer tests with Travis

build:
make

test:
go test ./...

integration test:
setup postgres with local admin account.
setup AWS credentials
python3 misc/e2etest.py

release:

python3 -m venv ve3
ve3/bin/pip install markdown2
ve3/bin/python misc/release.py

Database: CockroachDB [5]

For eventually indexing and serving multiple terabytes of data, make a CockroachDB backend equivalent to Postgres.

OR

Extend Postgres to use their hierarchical table structures or application level sharding to get around 32 TB table limit there.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.