체크포인트
Prover 노드에서 생성된 암호화 동기화 체크포인트 목록을 검색하여 클라이언트가 특정 블록 높이에 대한 데이터 무결성을 확인할 수 있도록 합니다.
엔드포인트
POST https://indexer.pivx.name/v1.0/checkpoints
요청 본문
요청 본문은 다음 매개변수를 포함하는 JSON 객체여야 합니다.
| 매개변수 | 유형 | 기본값 | 설명 |
|---|---|---|---|
count | integer | 100 | 단일 응답으로 반환되는 최대 체크포인트 수를 제한합니다. |
from_block | integer | 없음 | 이 특정 블록 높이부터 시작하여 체크포인트 데이터를 요청합니다. |
order | string | desc | 체크포인트 정렬 순서입니다. 허용되는 값: asc 또는 desc. |
코드 예
- cURL
- JavaScript
- Python
- PHP
curl -X POST https://indexer.pivx.name/v1.0/checkpoints \
-H "Content-Type: application/json" \
-d '{
"count": 2,
"from_block": 5361212,
"order": "asc"
}'
const url = 'https://indexer.pivx.name/v1.0/checkpoints';
const data = {
count: 2,
from_block: 5361212,
order: 'asc'
};
fetch(url, {
method: 'POST',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify(data)
})
.then(response => response.json())
.then(result => console.log(result))
.catch(error => console.error('Error:', error));
import requests
url = "https://indexer.pivx.name/v1.0/checkpoints"
payload = {
"count": 2,
"from_block": 5361212,
"order": "asc"
}
headers = {
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
<?php
$url = 'https://indexer.pivx.name/v1.0/checkpoints';
$data = [
'count' => 2,
'from_block' => 5361212,
'order' => 'asc'
];
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data));
curl_setopt($ch, CURLOPT_HTTPHEADER, [
'Content-Type: application/json'
]);
$response = curl_exec($ch);
curl_close($ch);
$result = json_decode($response, true);
print_r($result);
응답 예
{
"response": [
{
"block_id": 5432535,
"smt_root": "b4c9dacf8e194e353dce7638d76f282fe40399f7b0ad74a2229a6d4f5be774de",
"evm_block_id": 272705819,
"evm_tx_hash": "0x7af621b112cc009e65ac66cd9f589f24908efad28bd3451297050824bbb46af4"
},
{
"block_id": 5434368,
"smt_root": "98cbb0d3cecb4b18105f6406bf473c9b92c11b670ee7071d47fd155dc1e9cfda",
"evm_block_id": 272706827,
"evm_tx_hash": "0x491c52ce65e2a6a32956a5aec01ac0b903641b1ee6e79e0bb49d88739b50159e"
}
]
}
| 필드 | 유형 | 설명 |
|---|---|---|
block_id | 정수 | 체크포인트에 포함된 마지막 PIVX block_id |
smt_root | 문자열 | 체크포인트의 SMT 루트 |
evm_block_id | 문자열 | 체크포인트 생성의 EVM block_id |
evm_tx_hash | 문자열 | 체크포인트 생성의 EVM tx_hash |