Skip to main content

Cosmos APIs

Artela Network built on CosmosSDK and CometBft.

Cosmos gRPC and CometBFT RPC also supported in our network.

Cosmos gRPC

Artela provides gRPC endpoints for all integrated modules within the Cosmos SDK. This streamlines the interaction process for wallets and blockchain explorers, enabling them to easily engage with Proof-of-Stake mechanisms and native Cosmos transactions and queries.

Cosmos Tool is also applicable to Artela.

EVM Module

Queries

VerbMethodDescription
gRPCartela.evm.v1.Query/AccountGet an Ethereum account
gRPCartela.evm.v1.Query/CosmosAccountGet an Ethereum account's Cosmos Address
gRPCartela.evm.v1.Query/ValidatorAccountGet an Ethereum account's from a validator consensus Address
gRPCartela.evm.v1.Query/BalanceGet the balance of a the EVM denomination for a single EthAccount.
gRPCartela.evm.v1.Query/StorageGet the balance of all coins for a single account
gRPCartela.evm.v1.Query/CodeGet the balance of all coins for a single account
gRPCartela.evm.v1.Query/ParamsGet the parameters of x/evm module
gRPCartela.evm.v1.Query/EthCallImplements the eth_call rpc api
gRPCartela.evm.v1.Query/EstimateGasImplements the eth_estimateGas rpc api
gRPCartela.evm.v1.Query/TraceTxImplements the debug_traceTransaction rpc api
gRPCartela.evm.v1.Query/TraceBlockImplements the debug_traceBlockByNumber and debug_traceBlockByHash rpc api
GET/artela/evm/v1/account/{address}Get an Ethereum account
GET/artela/evm/v1/cosmos_account/{address}Get an Ethereum account's Cosmos Address
GET/artela/evm/v1/validator_account/{cons_address}Get an Ethereum account's from a validator consensus Address
GET/artela/evm/v1/balances/{address}Get the balance of a the EVM denomination for a single EthAccount.
GET/artela/evm/v1/storage/{address}/{key}Get the balance of all coins for a single account
GET/artela/evm/v1/codes/{address}Get the balance of all coins for a single account
GET/artela/evm/v1/paramsGet the parameters of x/evm module
GET/artela/evm/v1/eth_callImplements the eth_call rpc api
GET/artela/evm/v1/estimate_gasImplements the eth_estimateGas rpc api
GET/artela/evm/v1/trace_txImplements the debug_traceTransaction rpc api
GET/artela/evm/v1/trace_blockImplements the debug_traceBlockByNumber and debug_traceBlockByHash rpc api

Transactions

VerbMethodDescription
gRPCartela.evm.v1.Msg/EthereumTxSubmit an Ethereum transactions
POST/artela/evm/v1/ethereum_txSubmit an Ethereum transactions

FEE Module

Queries

VerbMethodDescription
gRPCartela.fee.v1.Query/ParamsGet the module params
gRPCartela.fee.v1.Query/BaseFeeGet the block base fee
gRPCartela.fee.v1.Query/BlockGasGet the block gas used
GET/artela/fee/v1/paramsGet the module params
GET/artela/fee/v1/base_feeGet the block base fee
GET/artela/fee/v1/block_gasGet the block gas used

CometBFT RPC

CometBFT supports the following RPC protocols:

  • URI over HTTP
  • JSONRPC over HTTP
  • JSONRPC over WebSockets

Configuration

RPC can be configured by tuning parameters under [rpc] section in the $CMTHOME/config/config.toml file or by using the --rpc.X command-line flags.

The default RPC listen address is tcp://127.0.0.1:26657. To set another address, set the laddr config parameter to desired value. CORS (Cross-Origin Resource Sharing) can be enabled by setting cors_allowed_origins, cors_allowed_methods, cors_allowed_headers config parameters.

For local RPC node testing, update the cors_allowed_origins property under the [rpc] section. Add the URL where this OpenAPI document is hosted, for example:

cors_allowed_origins = ["http://localhost:8088"]

Or, if testing from the official documentation site:

cors_allowed_origins = ["https://docs.cometbft.com"]

Parameters

For parameters expecting strings or byte arrays, you can use quoted strings like "abc" or 0x-prefixed strings such as 0x616263.

Arguments which expect strings or byte arrays may be passed as quoted strings, like "abc" or as 0x-prefixed strings, like 0x616263.

URI/HTTP

A REST-like interface.

curl localhost:26657/block?height=5

JSONRPC/HTTP

JSONRPC requests can be POST'd to the root RPC endpoint via HTTP.

curl --header "Content-Type: application/json" --request POST --data '{"method": "block", "params": ["5"], "id": 1}' localhost:26657

Artela TestNet example:

curl --header "Content-Type: application/json" --request POST --data '{"method": "block", "params": ["5"], "id": 1}' 47.251.14.47:26657

JSONRPC/WebSockets

JSONRPC requests can also be made via WebSockets. The WebSocket endpoint is located at /websocket, e.g. localhost:26657/websocket. Asynchronous RPC functions like event subscribe and unsubscribe are available only via websockets.

For example using the websocat tool, you can subscribe for 'NewBlock` events with this command:

echo '{ "jsonrpc": "2.0","method": "subscribe","id": 0,"params": {"query": "tm.event='"'NewBlock'"'"} }' | websocat -n -t ws://127.0.0.1:26657/websocket

List of Available APIs: Cometbft APIs