{"id":13562920,"url":"https://github.com/cosmos/rosetta","last_synced_at":"2025-07-23T19:03:47.276Z","repository":{"id":182262268,"uuid":"656255729","full_name":"cosmos/rosetta","owner":"cosmos","description":"Rosetta implementation for cosmos zones","archived":false,"fork":false,"pushed_at":"2025-04-07T01:09:21.000Z","size":823,"stargazers_count":6,"open_issues_count":5,"forks_count":8,"subscribers_count":10,"default_branch":"main","last_synced_at":"2025-04-07T02:36:15.906Z","etag":null,"topics":["coinbase","cosmos","cosmos-sdk","rosetta"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cosmos.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-06-20T15:09:15.000Z","updated_at":"2025-04-04T03:57:14.000Z","dependencies_parsed_at":"2023-09-26T00:14:22.077Z","dependency_job_id":"c424a9b0-9ef4-48d9-814f-1b277e55f71c","html_url":"https://github.com/cosmos/rosetta","commit_stats":{"total_commits":51,"total_committers":6,"mean_commits":8.5,"dds":0.5490196078431373,"last_synced_commit":"bc4233d745e626ea82679ed417523abdd746e25e"},"previous_names":["cosmos/rosetta"],"tags_count":16,"template":false,"template_full_name":null,"purl":"pkg:github/cosmos/rosetta","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cosmos%2Frosetta","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cosmos%2Frosetta/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cosmos%2Frosetta/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cosmos%2Frosetta/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cosmos","download_url":"https://codeload.github.com/cosmos/rosetta/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cosmos%2Frosetta/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266737568,"owners_count":23976389,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-07-23T02:00:09.312Z","response_time":66,"last_error":null,"robots_txt_status":null,"robots_txt_updated_at":null,"robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["coinbase","cosmos","cosmos-sdk","rosetta"],"created_at":"2024-08-01T13:01:13.400Z","updated_at":"2025-07-23T19:03:47.250Z","avatar_url":"https://github.com/cosmos.png","language":"Go","funding_links":[],"categories":["Go"],"sub_categories":[],"readme":"# Rosetta\n\nThe `rosetta` project implements Coinbase's [Rosetta API](https://www.rosetta-api.org). This document provides instructions on how to use the Rosetta API integration. For information about the motivation and design choices, refer to [ADR 035](https://docs.cosmos.network/main/architecture/adr-035-rosetta-api-support).\n\n## Installing Rosetta\n\nThe Rosetta API server is a stand-alone server that connects to a node of a chain developed with Cosmos SDK.\n\nRosetta can be added to any cosmos chain node. standalone or natively.\n\n### Standalone \n\nRosetta can be executed as a standalone service, it connects to the node endpoints and expose the required endpoints.\n\nInstall Rosetta standalone server with the following command:\n\n```bash\ngo install github.com/cosmos/rosetta\n```\n\nAlternatively, for building from source, simply run `make build`. The binary will be located in the root folder.\n\n### Native - As a node command\n\nTo enable Native Rosetta API support, it's required to add the `RosettaCommand` to your application's root command file (e.g. `simd/cmd/root.go`).\n\nImport the `rosettaCmd` package:\n\n```go\nimport \"github.com/cosmos/rosetta/cmd\"\n```\n\nFind the following line:\n\n```go\ninitRootCmd(rootCmd, encodingConfig)\n```\n\nAfter that line, add the following:\n\n```go\nrootCmd.AddCommand(\n  rosettaCmd.RosettaCommand(encodingConfig.InterfaceRegistry, encodingConfig.Codec)\n)\n```\n\nThe `RosettaCommand` function builds the `rosetta` root command and is defined in the `rosettaCmd` package (`github.com/cosmos/rosetta/cmd`).\n\nSince we’ve updated the Cosmos SDK to work with the Rosetta API, updating the application's root command file is all you need to do.\n\nAn implementation example can be found in `simapp` package.\n\n## Use Rosetta Command\n\nTo run Rosetta in your application CLI, use the following command:\n\n\u003e **Note:** if using the native approach, add your node name before any rosetta command.\n\n```shell\nrosetta --help\n```\n\nTo test and run Rosetta API endpoints for applications that are running and exposed, use the following command:\n\n```shell\nrosetta\n     --blockchain \"your application name (ex: gaia)\"\n     --network \"your chain identifier (ex: testnet-1)\"\n     --tendermint \"tendermint endpoint (ex: localhost:26657)\"\n     --grpc \"gRPC endpoint (ex: localhost:9090)\"\n     --addr \"rosetta binding address (ex: :8080)\"\n     --grpc-types-server (optional) \"gRPC endpoint for message descriptor types\"\n```\n\n## Plugins - Multi chain connections\n\nRosetta will try to reflect the node types trough reflection over the node gRPC endpoints, there may be cases were this approach is not enough. It is possible to extend or implement the required types easily through plugins.\n\nTo use Rosetta over any chain, it is required to set up prefixes and registering zone specific interfaces through plugins.\n\nEach plugin is a minimalist implementation of `InitZone` and `RegisterInterfaces` which allow Rosetta to parse chain specific data. There is an example for cosmos-hub chain under `plugins/cosmos-hun/` folder\n- **InitZone**: An empty method that is executed first and defines prefixes, parameters and other settings.\n- **RegisterInterfaces**: This method receives an interface registry which is were the zone specific types and interfaces will be loaded\n\nIn order to add a new plugin: \n1. Create a folder over `plugins` folder with the name of the desired zone\n2. Add a `main.go` file with the mentioned methods above.\n3. Build the code binary through `go build -buildmode=plugin -o main.so main.go` \n\nThe plugin folder is selected through the cli `--plugin` flag and loaded into the Rosetta server.\n\n## Extensions\n\nThere are two ways in which you can customize and extend the implementation with your custom settings.\n\n### Message extension\n\nIn order to make an `sdk.Msg` understandable by rosetta the only thing which is required is adding the methods to your messages that satisfy the `rosetta.Msg` interface. Examples on how to do so can be found in the staking types such as `MsgDelegate`, or in bank types such as `MsgSend`.\n\n### Client interface override\n\nIn case more customization is required, it's possible to embed the Client type and override the methods which require customizations.\n\nExample:\n\n```go\npackage custom_client\nimport (\n\n\"context\"\n\"github.com/coinbase/rosetta-sdk-go/types\"\n\"github.com/cosmos/rosetta/lib\"\n)\n\n// CustomClient embeds the standard cosmos client\n// which means that it implements the cosmos-rosetta-gateway Client\n// interface while at the same time allowing to customize certain methods\ntype CustomClient struct {\n    *rosetta.Client\n}\n\nfunc (c *CustomClient) ConstructionPayload(_ context.Context, request *types.ConstructionPayloadsRequest) (resp *types.ConstructionPayloadsResponse, err error) {\n    // provide custom signature bytes\n    panic(\"implement me\")\n}\n```\n\nNOTE: when using a customized client, the command cannot be used as the constructors required **may** differ, so it's required to create a new one. We intend to provide a way to init a customized client without writing extra code in the future.\n\n### Error extension\n\nSince rosetta requires to provide 'returned' errors to network options. In order to declare a new rosetta error, we use the `errors` package in cosmos-rosetta-gateway.\n\nExample:\n\n```go\npackage custom_errors\nimport crgerrs \"github.com/cosmos/rosetta/lib/errors\"\n\nvar customErrRetriable = true\nvar CustomError = crgerrs.RegisterError(100, \"custom message\", customErrRetriable, \"description\")\n```\n\nNote: errors must be registered before cosmos-rosetta-gateway's `Server`.`Start` method is called. Otherwise the registration will be ignored. Errors with same code will be ignored too.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcosmos%2Frosetta","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcosmos%2Frosetta","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcosmos%2Frosetta/lists"}