LedgerService.GetServiceInfo
Query the service for general information about its current state.
Endpoint
| Network | Host | Authentication |
|---|---|---|
| Mainnet | mainnet-grpc.inodra.com:443 | x-api-key metadata |
| Testnet | testnet-grpc.inodra.com:443 | x-api-key metadata |
Full method name: sui.rpc.v2.LedgerService/GetServiceInfo. Unary: one request, one response. Get a key from the dashboard; the same key works on every protocol.
Request: GetServiceInfoRequest
No fields.
Response: GetServiceInfoResponse
| Field | Type | Description |
|---|---|---|
chain_id | string | The chain identifier of the chain that this node is on. The chain identifier is the digest of the genesis checkpoint, the checkpoint with sequence number 0. |
chain | string | Human-readable name of the chain that this node is on. This is intended to be a human-readable name like mainnet, testnet, and so on. |
epoch | uint64 | Current epoch of the node based on its highest executed checkpoint. |
checkpoint_height | uint64 | Checkpoint height of the most recently executed checkpoint. |
timestamp | google.protobuf.Timestamp | Unix timestamp of the most recently executed checkpoint. |
lowest_available_checkpoint | uint64 | The lowest checkpoint for which checkpoints and transaction data are available. |
lowest_available_checkpoint_objects | uint64 | The lowest checkpoint for which object data is available. |
server | string | Software version of the service. Similar to the server http header. |
grpcurl
bash
grpcurl -H "x-api-key: YOUR_API_KEY" \
-d '{}' \
mainnet-grpc.inodra.com:443 \
sui.rpc.v2.LedgerService/GetServiceInfoServer reflection is enabled, so no proto files are needed for grpcurl. Field masks are written as {"paths": [...]}.
TypeScript
typescript
import { GrpcWebFetchTransport, SuiGrpcClient } from '@mysten/sui/grpc'
const transport = new GrpcWebFetchTransport({
baseUrl: 'https://mainnet-grpc.inodra.com',
meta: { 'x-api-key': process.env.INODRA_API_KEY! }
})
const client = new SuiGrpcClient({ network: 'mainnet', transport })
const { response } = await client.ledgerService.getServiceInfo({})
console.log(response.chainId, response.checkpointHeight)@mysten/sui v2 has no typed method for this RPC, so the sample calls the generated client.ledgerService service client. Install with npm install @mysten/sui and set INODRA_API_KEY. The gRPC gateway guide covers native gRPC transport for backends.
Credits
1 credit per call. See credits and billing for the full table.
Related
- LedgerService overview and the gRPC gateway
- LedgerService.GetObject
- LedgerService.BatchGetObjects
- LedgerService.GetTransaction
- LedgerService.BatchGetTransactions
- LedgerService.GetCheckpoint
- LedgerService.GetEpoch
- LedgerService.ListCheckpoints
- LedgerService.ListTransactions
- LedgerService.ListEvents
- Proto definition on GitHub