Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs(rosetta): add Rosetta documentation page #9688

Merged
merged 14 commits into from
Jul 29, 2021
1 change: 1 addition & 0 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ aside: false
- **[Specifications](./spec/)**: Specifications of modules and other parts of the Cosmos SDK.
- **[SDK API Reference](https://godoc.org/github.com/cosmos/cosmos-sdk)**: Godocs of the Cosmos SDK.
- **[REST and RPC Endpoints](https://cosmos.network/rpc/)**: List of endpoints to interact with a `gaia` full-node.
- **[Rosetta API](./rosetta/)**: Rosetta API integration.

## Cosmos Hub

Expand Down
50 changes: 50 additions & 0 deletions docs/rosetta/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
<!--
order: false
parent:
order: 2
-->

# Rosetta

This folder contains instructions about how to use the Coinbase Rosetta API integration.
jgimeno marked this conversation as resolved.
Show resolved Hide resolved

## Motivations and design
jgimeno marked this conversation as resolved.
Show resolved Hide resolved

For the motivation an design choices refer to the [ADR 035](../architecture/adr-035-rosetta-api-support.md)
jgimeno marked this conversation as resolved.
Show resolved Hide resolved

## Usage

The Rosetta API server is a stand-alone server that connects to a node of a chain developed with the Cosmos-SDK.
jgimeno marked this conversation as resolved.
Show resolved Hide resolved

To enable the Rosetta API server support it's required to Add the `RosettaCommand` to your application root command file.
jgimeno marked this conversation as resolved.
Show resolved Hide resolved
After the

```
initRootCmd(rootCmd, encodingConfig)
```

line, add the following lines:
jgimeno marked this conversation as resolved.
Show resolved Hide resolved

```
rootCmd.AddCommand(
server.RosettaCommand(encodingConfig.InterfaceRegistry, encodingConfig.Marshaler)
)
```


The application root command file is in the server package in `github.com/cosmos/cosmos-sdk/server`.
jgimeno marked this conversation as resolved.
Show resolved Hide resolved

Since we’ve updated the Cosmos SDK to work with the Rosetta API, updating the application root command file is all you need to do.
jgimeno marked this conversation as resolved.
Show resolved Hide resolved

To run Rosetta in your application CLI, use the following command:
`appd rosetta --help`.
jgimeno marked this conversation as resolved.
Show resolved Hide resolved
To test and run Rosetta API endpoints for applications that are running and exposed, use the following command:

```
appd rosetta
--blockchain "your application name (ex: gaia)"
--network "your chain identifier (ex: testnet-1)"
--tendermint "tendermint endpoint (ex: localhost:26657)"
--grpc "gRPC endpoint (ex: localhost:9090)"
--addr "rosetta binding address (ex: :8080)"
```