Skip to Content
gRPC

gRPC

Galene serves the modern Sui gRPC interface (sui.rpc.v2) over the same fork state as JSON-RPC. So a gRPC client points at the local fork and reads forked mainnet state, submits transactions, and streams the fork as it changes.

It runs alongside JSON-RPC. By default on 127.0.0.1:9000.

# served with the fork galene start # gRPC on 127.0.0.1:9000 galene start --grpc-addr 0.0.0.0:9000 # bind elsewhere (also GALENE_GRPC_ADDR) galene start --no-grpc # JSON-RPC only

The gRPC and JSON-RPC servers share one fork state. A cheatcode over JSON-RPC is visible to a gRPC client immediately, and the other way around.

Services

Served from the official Sui SDK protos.

LedgerService

RPCsui.rpc.v2.LedgerService
MethodWhat it does
GetServiceInfoChain id, epoch, and server info.
GetObjectRead one object from the fork (copy-on-read on a miss).
BatchGetObjectsRead many objects in one call.
GetTransactionFetch a transaction and its effects.
GetEpochThe current epoch.
GetCheckpointA checkpoint by sequence number.

TransactionExecutionService

RPCsui.rpc.v2.TransactionExecutionService
MethodWhat it does
ExecuteTransactionSubmit a transaction. Galene forks every object it needs, then runs it.
SimulateTransactionDry-run a transaction and roll it back. The fork is untouched.

SubscriptionService

RPCsui.rpc.v2.SubscriptionService
MethodWhat it does
SubscribeCheckpointsA live stream of the fork’s transactions as they land.

Server reflection

The server registers reflection (both v1 and v1alpha), so clients discover the schema without local .proto files. grpcurl and Postman work out of the box.

# list services grpcurl -plaintext 127.0.0.1:9000 list # describe a method grpcurl -plaintext 127.0.0.1:9000 describe sui.rpc.v2.LedgerService.GetObject # read an object grpcurl -plaintext -d '{"object_id":"0x6"}' \ 127.0.0.1:9000 sui.rpc.v2.LedgerService/GetObject
Last updated on