Skip to main content

gRPC API

The gRPC API provides high-performance, strongly-typed access to the Basalt node. It is suitable for backend services, indexers, and any client that benefits from Protocol Buffer serialization and HTTP/2 transport.

Default port: 5001

Service name: BasaltNode

Max concurrent streams: 100

Methods

RPCRequestResponseTypeDescription
GetStatusEmptyStatusResponseUnaryReturns node status including block height, peer count, and sync state.
GetBlockBlockRequestBlockResponseUnaryReturns a block by number or hash.
GetAccountAccountRequestAccountResponseUnaryReturns account state (balance, nonce, account type).
GetTransactionTxRequestTxResponseUnaryReturns a transaction by hash.
SubmitTransactionSubmitTxRequestSubmitTxResponseUnarySubmits a signed transaction for inclusion.
SubscribeBlocksEmptystream BlockResponseServer streamingStreams new blocks as they are finalized.

Proto Definition

The service is defined in basalt_node.proto within the Basalt.Api.Grpc project. Client stubs can be generated from this file for any language with gRPC support.

Usage Example

Using grpcurl:

grpcurl -plaintext localhost:5001 basalt.BasaltNode/GetStatus

Streaming Blocks

grpcurl -plaintext localhost:5001 basalt.BasaltNode/SubscribeBlocks

This command opens a server-streaming connection and prints each new block as it is finalized. Press Ctrl+C to disconnect.

Transport Security

The gRPC endpoint runs unencrypted by default, which is appropriate for local development and devnet deployments.

warning

Production deployments should terminate TLS in front of the gRPC port using a reverse proxy or load balancer. Do not expose unencrypted gRPC endpoints to the public internet.