How does Rosetta work?

I wonder how Rosseta 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).

Rosseta-cli is used for guaranteeing the correctness of the APIs, both data-format and reconciliation.

I have some questions:

  1. Must someone deploy a Rosseta-cli in the production-env? As I known Rosseta-cli is just a test tool for helping devs develop their program. Is it right?
  2. If Rosseta-cli is not necessary, how Coinbase check the account balance, or just skip the check and receive the data that rosseta-node provide?
  3. 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?
  4. runCheckConstructionCmd seems has not been implemented, when it will be completed?

Hope someone can answer the questions.

Welcome to the community @ray.wu!

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).

I wrote a little about this here: Can the endpoints /block and /account/balance not be implemented?

runCheckConstructionCmd seems has not been implemented, when it will be completed?

We just put out a release last night that added support for this testing! Good eye!

Get it, Thank you for your relay