For the complete documentation index, see llms.txt. This page is also available as Markdown.

LedgerService/GetCheckpoint - SUI

Example code for the LedgerService/GetCheckpoint gRPC method. Complete guide on how to use LedgerService/GetCheckpoint gRPC method in GetBlock Web3 documentation.

Returns a checkpoint by sequence number or digest. Checkpoints are Sui's primary unit of progress — they're produced every ~400ms and group together all transactions executed in that window. Equivalent in spirit to blocks on other chains.

Service: sui.rpc.v2.LedgerService Proto file: sui/rpc/v2/ledger_service.proto Full method path: sui.rpc.v2.LedgerService/GetCheckpoint

Request Fields

Field
Type
Required
Description

sequence_number

uint64 (one of)

Yes*

Checkpoint sequence number (provide either this OR digest)

digest

string (one of)

Yes*

Checkpoint digest (Base58) (provide either this OR sequence_number)

read_mask

FieldMask

No

Field paths — e.g. ["sequence_number", "digest", "summary"]. Use ["*"] for all fields

Request Example

# Clone the official proto files first (one-time setup):
#   git clone https://github.com/MystenLabs/sui-apis.git && cd sui-apis

grpcurl \
  -import-path proto \
  -proto sui/rpc/v2/ledger_service.proto \
  -H "x-grpc-web: 1" \
  -d '{
    "sequence_number": "260411497",
    "read_mask": {
        "paths": [
            "*"
        ]
    }
}' \
  go.getblock.io:443/<ACCESS-TOKEN> \
  sui.rpc.v2.LedgerService/GetCheckpoint
import * as grpc from '@grpc/grpc-js';
import * as protoLoader from '@grpc/proto-loader';
import * as path from 'path';

const PROTO_PATH = path.join(__dirname, 'protos/proto/sui/rpc/v2/ledger_service.proto');
const ACCESS_TOKEN = '<ACCESS-TOKEN>';

const packageDef = protoLoader.loadSync(PROTO_PATH, {
    includeDirs: [path.join(__dirname, 'protos/proto')],
    keepCase: true, longs: String, enums: String, defaults: true,
});
const proto = grpc.loadPackageDefinition(packageDef) as any;
const ServiceClient = proto.sui.rpc.v2.LedgerService;

const metadata = new grpc.Metadata();
metadata.add('authorization', `Bearer ${ACCESS_TOKEN}`);

const client = new ServiceClient('go.getblock.io:443', grpc.credentials.createSsl());

const request = {
    "sequence_number": "260411497",
    "read_mask": {
        "paths": [
            "*"
        ]
    }
};

client.GetCheckpoint(request, metadata, (err: any, response: any) => {
    if (err) {
        console.error('Error:', err);
        return;
    }
    console.log(JSON.stringify(response, null, 2));
});

Response Example

Responses are encoded in Protocol Buffers binary format on the wire. The example below shows the protobuf JSON encoding for readability.

Response Fields

Field
Type
Description

checkpoint.sequence_number

string

Checkpoint sequence number

checkpoint.digest

string

Checkpoint digest

checkpoint.summary.epoch

string

Epoch this checkpoint belongs to

checkpoint.summary.network_total_transactions

string

Cumulative transaction count on the network as of this checkpoint

checkpoint.summary.previous_digest

string

Digest of the previous checkpoint — used by light clients to walk the chain

checkpoint.summary.timestamp_ms

string

Checkpoint timestamp in milliseconds

checkpoint.transactions

repeated string

Digests of all transactions included in this checkpoint

Use Cases

  • Block-by-block (checkpoint-by-checkpoint) indexing

  • Light client verification — walking checkpoints via previous_digest

  • Analytics on network throughput over time

  • Detecting epoch boundaries from checkpoint metadata

Error Handling

gRPC uses status codes rather than JSON-RPC numeric error codes. The most relevant for this method:

Status Code
Numeric
Cause

UNAUTHENTICATED

16

Missing or invalid <ACCESS-TOKEN> in the URL path

INVALID_ARGUMENT

3

Request fields are missing, malformed, or fail validation

UNAVAILABLE

14

Node is overloaded or temporarily unable to handle the request — retry with backoff

DEADLINE_EXCEEDED

4

Request did not complete within the timeout window

RESOURCE_EXHAUSTED

8

Rate limit exceeded for your plan

NOT_FOUND

5

Checkpoint sequence number is above the current chain tip, or below the node's earliest retained checkpoint

INVALID_ARGUMENT

3

Neither sequence_number nor digest was provided, or both were provided

SDK Integration

Was this helpful?