Skip to content

Analog-Labs/chain-connectors

Repository files navigation

Rosetta SDK

Repository structure

  • rosetta-types: initially autogenerated using the openapi-generator contains the request and response structs used by the client and server.
  • rosetta-crypto: cryptographic primitives used by the rosetta-client.
  • rosetta-client: client to interact with a rosetta server.
  • rosetta-wallet: command line interface built with the rosetta-client.
  • rosetta-cli: command line interface built with the rosetta-client.
  • dioxus-wallet: multichain mobile wallet
  • rosetta-server-substrate: rosetta implementation for substrate chains
  • rosetta-server-polkadot: rosetta implementation for polkadot using rosetta-server-substrate
  • rosetta-indexer: generic block indexer for a rosetta connector

Getting started

Install cli tools

cargo install --path rosetta-cli
cargo install --path rosetta-wallet

Bitcoin example

rosetta-wallet --chain btc --keyfile /tmp/alice faucet 1000
rosetta-wallet --chain btc --keyfile /tmp/bob account
rosetta-wallet --chain btc --keyfile /tmp/alice transfer bob_acc_key 1000
rosetta-wallet --chain btc --keyfile /tmp/alice faucet 1
rosetta-wallet --chain btc --keyfile /tmp/bob balance

Ethereum example

rosetta-wallet --chain eth --keyfile /tmp/alice faucet 100000000000000
rosetta-wallet --chain eth --keyfile /tmp/alice balance
rosetta-wallet --chain eth --keyfile /tmp/bob account
rosetta-wallet --chain eth --keyfile /tmp/alice transfer bob_acc_key 10000000000000
rosetta-wallet --chain eth --keyfile /tmp/bob balance

Substrate example

rosetta-wallet --chain dot --keyfile /tmp/alice faucet 3000000000000000
rosetta-wallet --chain dot --keyfile /tmp/bob account
rosetta-wallet --chain dot --keyfile /tmp/alice transfer bob_acc_key 1500000000000000
rosetta-wallet --chain dot --keyfile /tmp/bob balance

Indexer example

To Run indexer we need indexer url which we need pass with --indexer-url flag e.g. For local run we can use below commands

rosetta-cli --chain=btc search --indexer-url=http://localhost:8083 --type=Transfer --success=true

rosetta-cli --chain=eth search --indexer-url=http://localhost:8084 --type=Transfer --success=true

rosetta-cli --chain=dot search --indexer-url=http://localhost:8085 --type=Transfer --success=true

Block Explorer

Open in your web browser http://rosetta.analog.one:3000

Run local testnet

Running a local testnet with docker compose up will start a bunch of containers:

Override the default url in rosetta-cli and rosetta-wallet with the --url flag.

Update AWS deployment

Create a new tag, push to master and use it to create a new github release.