LedgerService.GetCheckpoint
Get checkpoint through sui.rpc.v2.LedgerService/GetCheckpoint on Inodra's Sui gRPC endpoint.
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/GetCheckpoint. Unary: one request, one response. Get a key from the dashboard; the same key works on every protocol.
Request: GetCheckpointRequest
| Field | Type | Description |
|---|---|---|
sequence_number | uint64 (one of checkpoint_id) | The sequence number of the requested checkpoint. |
digest | string (one of checkpoint_id) | The digest of the requested checkpoint. |
read_mask | google.protobuf.FieldMask | Mask specifying which fields to read. If no mask is specified, defaults to sequence_number,digest. |
Response: GetCheckpointResponse
| Field | Type | Description |
|---|---|---|
checkpoint | Checkpoint |
Checkpoint
| Field | Type | Description |
|---|---|---|
sequence_number | uint64 | The height of this checkpoint. |
digest | string | The digest of this Checkpoint's CheckpointSummary. |
summary | CheckpointSummary | The CheckpointSummary for this checkpoint. |
signature | ValidatorAggregatedSignature | An aggregated quorum signature from the validator committee that certified this checkpoint. |
contents | CheckpointContents | The CheckpointContents for this checkpoint. |
transactions | repeated ExecutedTransaction | List of transactions included in this checkpoint. |
objects | ObjectSet | Set of objects either referenced as inputs or produced as outputs by transactions included in this checkpoint. In order to benefit from deduplication of objects that appear in multiple transactions in this checkpoint, objects will only be present here and the transactions.objects field will not be populated. |
grpcurl
grpcurl -H "x-api-key: YOUR_API_KEY" \
-d '{
"read_mask": {
"paths": [
"sequence_number",
"digest"
]
}
}' \
mainnet-grpc.inodra.com:443 \
sui.rpc.v2.LedgerService/GetCheckpointServer reflection is enabled, so no proto files are needed for grpcurl. Field masks are written as {"paths": [...]}.
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 })
// No checkpoint id: returns the latest checkpoint
const { response } = await client.ledgerService.getCheckpoint({
checkpointId: { oneofKind: undefined },
readMask: { paths: ['sequence_number', 'digest'] }
})
console.log(response.checkpoint?.sequenceNumber)@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. Reads served from the archival tier cost 2x; the response metadata carries x-inodra-backend naming the tier that answered. See credits and billing for the full table.
JSON-RPC equivalent
Replaces sui_getCheckpoint and sui_getLatestCheckpointSequenceNumber. The JSON-RPC to gRPC migration guide has before and after code for the common calls.
Related
- LedgerService overview and the gRPC gateway
- LedgerService.GetServiceInfo
- LedgerService.GetObject
- LedgerService.BatchGetObjects
- LedgerService.GetTransaction
- LedgerService.BatchGetTransactions
- LedgerService.GetEpoch
- LedgerService.ListCheckpoints
- LedgerService.ListTransactions
- LedgerService.ListEvents
- Proto definition on GitHub