RPC API

There are three types of RPC APIs available: gRPC, REST and CometBFT RPC, that enables submitting transactions and querying data.

Comparison Table

The following table compares the differences between the gRPC, REST and CometBFT RPC endpoints.

Name
Advantages
Disadvantages

gRPC

  • can use code-generated stubs in various languages

  • supports streaming and bidirectional communication (HTTP/2)

  • small wire binary sizes, faster transmission

  • based on HTTP/2, not available in some browsers

  • learning curve (mostly due to Protobuf)

REST

  • ubiquitous

  • client libraries in all languages, faster implementation

  • only supports unary request-response communication (HTTP/1.1)

  • bigger over-the-wire message sizes (JSON)

  • heavily rate-limited by public endpoints

CometBFT RPC

  • easy to use

  • has endpoints that allow querying txs by event type

  • has websocket support for streaming data

  • bigger over-the-wire message sizes (JSON)

  • due to scalability issues, many documented endpoints may be disabled or heavily rate-limited by public endpoints

Endpoints

These public endpoints can be used to query the Demex L1 chain.

gRPC

MainNet: https://grpc.carbon.network

TestNet: https://test-grpc.carbon.network

REST

MainNet: https://api.carbon.network

TestNet: https://test-api.carbon.network

CometBFT RPC

MainNet: https://tm-api.carbon.network

TestNet: https://test-tm-api.carbon.network

Documentation

REST

The API docs for Carbon are split into two, depending on whether they are for the custom modules (e.g. broker, etc.) on Carbon, or for modules that come standard with Cosmos-SDK (e.g. auth, bank, staking etc.):

Last updated

Was this helpful?