Skip to main content

Checkpoints

Retrieves the list of sync checkpoints this indexer has read from the anchor contract — each a state root with the PIVX block height it covers — allowing clients to verify data integrity against specific block heights.

Endpoint​

POST https://indexer.pivx.name/v1.0/checkpoints

Request Body​

The request body must be a JSON object containing the following parameters:

ParameterTypeDefaultDescription
countinteger100Limit the maximum number of checkpoints returned in a single response, up to 500: a larger count is cut to 500.
from_blockintegerNoneReturn only checkpoints past this block height: at later heights with asc, at earlier ones with desc; the block itself is left out. Without it, the list starts at the oldest checkpoint (asc) or the newest (desc).
orderstringdescThe sorting order of the checkpoints. Accepted values: asc or desc.

Code Examples​

curl -X POST https://indexer.pivx.name/v1.0/checkpoints \
-H "Content-Type: application/json" \
-d '{
"count": 2,
"from_block": 1,
"order": "asc"
}'

Response Example

{
"response": [
{
"idx": 41,
"block_id": 5537048,
"smt_root": "b4c9dacf8e194e353dce7638d76f282fe40399f7b0ad74a2229a6d4f5be774de"
},
{
"idx": 42,
"block_id": 5537335,
"smt_root": "eba675788f0fbf1df8a3c32e83da3e71dfd9337cca5a7c8ae2f51e963d03be17"
}
]
}
FieldTypeDescription
idxintIndex of the root in the anchor contract’s rootAt mapping (0 is the genesis root); the resume cursor for checkpoint discovery
block_idintThe last PIVX block_id included in the checkpoint
smt_rootstringCheckpoint's SMT Root