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
make SERVER_URL=<server URL> validate
. - Examine processed blocks using
make watch-blocks
. You can also print transactions by settingLOG_TRANSACTIONS="true"
in the environment or as amake
argument. - Watch for errors in the processing logs. Any error will cause the validator to stop.
- Analyze benchmarks from
validator-data/block_benchmarks.csv
andvalidator-data/account_benchmarks.csv
by settingLOG_BENCHMARKS="true"
in the environment or as amake
argument.
The validator needs the URL of the Rosetta server configured. This can be set
as an environment variable named SERVER_URL
, passed as an argument to make
(ex: make SERVER_URL=<server url> validate
) or editing Makefile
itself.
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
.
There is no additional setting required to support blockchains with reorgs. This is handled automatically!
make deps
to install dependenciesmake test
to run testsmake lint
to lint the source code (included generated code)
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