rosetta-sdk-go
rosetta-sdk-go generates a Golang server and client package for the Rosetta Data API using the OpenAPI 3.0 Rosetta API Spec. To get started with the SDK, we recommend taking a look at the rosetta-cli repository, which provides extensive usage examples.
Packages
rosetta-sdk-go
contains a lot of additional functionality that Coinbase built to make interacting with Rosetta Data API implementations easier. If you have ideas for other packages, please open an issue!
Types
Types contains all generated Rosetta Data API types.
Client
Client is the standard generated client for the Rosetta Data API. The fetcher
package builds on the low-level client to provide automatic retries and multi-threaded block fetching.
Server
Server makes implementation of the Rosetta Data API as easy as implementing an interface. All boilerplate code to validate and route requests is provided out-of-the-box.
Fetcher
Simplified and validated communication with any Rosetta server
Asserter
Asserter is used by the server
and fetcher
packages to validate that requests and responses, respectively, are well-formed.
Parser
Parser provides a collection of helpers to make block parsing easier. The parser
can calculate all balance changes in a block, group related operations, and match an operation description with an operation in a transaction.
Syncer
Syncer is a blockchain-agnostic tool used to serially sync blocks from a Rosetta Data API implementation (automatically handles re-orgs). For example, you could use the syncer
to build a block explorer for any blockchain and not need to write any of your own logic to fetch blocks from a Rosetta Data API implementation. The syncer
is not tightly coupled to a storage backend or block-handling logic so it is possible for any developer to bring their own database for syncing and write their own logic to handle synced blocks.
Reconciler
Reconciler is used (often in conjunction with syncer
) to compare the balance computed exclusively from transaction operations with the balance returned by a Data API implementation at various heights (erroring if the "computed" and "live" balance differ).
Keys
Keys provides an implementation of cryptographic operations for Rosetta-supported curves.
SDKs in Other Languages
Currently, we support the Golang SDK.
🚧 If you build an SDK for a different language while implementing the Rosetta APIs, please reach out to rosetta@coinbase.com so that we can feature it in the
rosetta-ecosystem
repository.