I wonder how Rosetta works. I know Data API is used for querying data from the blockchain, and Construction API is used for constructing and submitting a transaction(mainly for withdraw or deposit).
Rosetta-cli is used for guaranteeing the correctness of the APIs, both data-format and reconciliation.
This is exactly right! I want to call out that we also use the Construction API for creating staking transactions and invoking smart contracts.
Must someone deploy a Rosetta-cli in the production-env? As I known Rosetta-cli is just a test tool for helping devs develop their program. Is it right?
You do not need to deploy the rosetta-cli in the production environment. We use the rosetta-cli to test an implementation prior to moving it to production but don’t deploy it in production.
If Rosetta-cli is not necessary, how Coinbase check the account balance, or just skip the check and receive the data that rosetta-node provide?
The rosetta-cli is built on the rosetta-sdk-go. We use this SDK to access Rosetta implementations. Take a look at the fetcher example for some code demonstrating how we do this.
We may not parse every transaction that affects the balance of an account because some smart contracts do not support retrieve the detail. Can we skip the Reconciliation check?
You can skip reconciliation when beginning your implementation work (just to make sure basic responses are working correctly). However, we require reconciliation to work prior to any integration at Coinbase (this may not be the case for other integrators).