Once you create a Rosetta Server, you'll need to test its performance and correctness. This validation tool makes that easy!
Rosetta is a new project from Coinbase to standardize the process of deploying and interacting with blockchains. With an explicit specification to adhere to, all parties involved in blockchain development can spend less time figuring out how to integrate with each other and more time working on the novel advances that will push the blockchain ecosystem forward. In practice, this means that any blockchain project that implements the requirements outlined in this specification will enable exchanges, block explorers, and wallets to integrate with much less communication overhead and network-specific work.
- Start your Rosetta Server (and the blockchain node it connects to if it is not a single binary.
- Start the validator using
makevalidate
. - Examine processed blocks using
make watch-blocks
. - Watch for errors in the processing logs. Any error will cause validation to stop.
All configuration options can be set in the call to make validate
(ex: make SERVER_URL=http://localhost:9999 validate
) or altered in
the Makefile
itself.
There is no additional setting required to support blockchains with reorgs. This is handled automatically!
Default: http://localhost:8080
The URL the validator will use to access the Rosetta Server.
Default: true
Computed balances will be reconciled against balances returned by the node.
Default: true
All processed transactions will be logged to transactions.txt
. You can tail
these logs using watch-transactions
.
Default: true
All processed balance changes will be logged to balances.txt
. You can tail
these logs using watch-balances
.
Default: true
All reconciliation checks will be logged to reconciliations.txt
. You can tail
these logs using watch-reconciliations
.
Default: false
Blockchains that set balances in genesis must create a bootstrap_balances.csv
file in the /validator-data
directory and pass BOOTSTRAP_BALANCES=true
as an
argument to make. If balances are not bootsrapped and balances are set in genesis,
reconciliation will fail.
There is an example file in examples/bootstrap_balances.csv
.
Default: false
It can be useful to observe performance characteristics of a Rosetta Server. When enabled, it is possible to view the latency of block and account fetches. Note, this naive implementation of benchmarks does not factor in request latency due to multithreaded requests.
make deps
to install dependenciesmake test
to run testsmake lint
to lint the source code (included generated code)make release
to run one last check before opening a PR
This tool performs a variety of correctness checks using the Rosetta Server. If any correctness check fails, the validator will exit and print out a detailed message explaining the error.
The validator uses the autogenerated Go Client package to communicate with the Rosetta Server and assert that responses adhere to the Rosetta Standard.
The validator checks that a block hash or transaction hash is never duplicated.
The validator checks that an account balance does not go negative from any operations.
The validator checks that the balance of an account computed by its operations is equal to the balance of the account according to the node. If this balance is not identical, the validator will exit.
The validator randomly checks the balances of accounts that aren't involved in any transactions. The balances of accounts could change on the blockchain node without being included in an operation returned by the Rosetta Server. Recall that ALL balance-changing operations must be returned by the Rosetta Server.
- Automatically test the correctness of a Rosetta Client SDK by constructing, signing, and submitting a transaction. This can be further extended by ensuring broadcast transactions eventually land in a block.
- Change logging to utilize a more advanced output mechanism than CSV.
This project is available open source under the terms of the Apache 2.0 License.
© 2020 Coinbase