ROSETTA-SOLANA IS CONSIDERED ALPHA SOFTWARE. USE AT YOUR OWN RISK!
rosetta-solana-go
provides a reference implementation of the Rosetta API for
Solana in Go. If you haven't heard of the Rosetta API, you can find more
information here.
- Rosetta API implementation (both Data API and Construction API)
- Stateless, offline, curve-based transaction construction
As specified in the Rosetta API Principles,
all Rosetta implementations must be deployable via Docker and support running via either an
online
or offline
mode.
After cloning this repository, run:
go build -o rosettasolanago
docker build -t rosetta-sol-go .
RPC_URL=https://api.mainnet-beta.solana.com PORT=8080 NETWORK=MAINNET MODE=ONLINE docker-compose up
To validate rosetta-solana
, install rosetta-cli
and run one of the following commands:
rosetta-cli check:data --configuration-file rosetta-cli-conf/testnet/devnet.json
rosetta-cli check:construction --configuration-file rosetta-cli-conf/testnet/devnet.json
RPC_URL=https://devnet.solana.com PORT=8080 NETWORK=TESTNET MODE=ONLINE go run *.go run
to run server
/network/list (network_list)
/network/options (network_options)
/network/status (network_status)
/account/balance (account_balance)
/block (get_block)
/block/transaction (block_transaction)
/construction/combine (construction_combine)
/construction/derive (construction_derive)
/construction/hash (construction_hash)
/construction/metadata (construction_metadata)
/construction/payloads (construction_payloads)
/construction/preprocess (construction_preprocess)
/construction/submit (construction_submit)
/construction/parse (construction_parse)
/call (call)
RPC_URL = "https://api.mainnet-beta.solana.com" (optional)
NETWORK = "MAINNET" //MAINNET/TESTNET/DEVNET (required)
PORT = "8080" (optional)
MODE = "ONLINE" //ONLINE/OFFLINE (required)
See types::OperationType
to see full list of current operations supported . This list might not be up to date.
System__Transfer,
System__CreateAccount,
System__Assign,
System__CreateNonceAccount,
System__AdvanceNonce,
System__WithdrawFromNonce,
System__AuthorizeNonce,
System__Allocate,
SplToken__Transfer,
SplToken__InitializeMint,
SplToken__InitializeAccount,
SplToken__CreateToken,
SplToken__CreateAccount,
SplToken__Approve,
SplToken__Revoke,
SplToken_MintTo,
SplToken_Burn,
SplToken_CloseAccount,
SplToken_FreezeAccount,
SplToken__TransferChecked,
Unknown,
See https://github.com/imerkle/rosetta-solana-go/blob/master/USAGE.md for examples of request body for every operations
- Add more ops
- Write tests
This is a go port of https://github.com/imerkle/rosetta-solana originally written in rust.
This project is available open source under the terms of the Apache 2.0 License.