The Reconciler package is used to ensure that balance changes derived from parsing Rosetta blocks are equivalent to the balance changes computed by the node. If you want to see an example of how to use this package, take a look at rosetta-cli.
- Customizable
Helper
andHandler
to define your own logic for retrieving calculated balance changes and handling successful/unsuccessful comparisons - Perform balance lookup at either historical blocks or the current block (if historical balance query is not supported)
- Provide a list of accounts to compare at each block (for quick and easy debugging)
go get github.com/foundryservices/rosetta-sdk-go/reconciler
The reconciler 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 reconciler will error.
The reconciler 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 Data API. Recall that all balance-changing operations must be returned by the Rosetta Data API.