체크포인트
증명 생성기 노드가 만들어 낸 암호학적 동기화 체크포인트 목록을 반환하여, 클라이언트가 특정 블록 높이를 기준으로 데이터 무결성을 검증할 수 있게 합니다.
엔드포인트
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": 1,
"order": "asc"
}'
const url = 'https://indexer.pivx.name/v1.0/checkpoints';
const data = {
count: 2,
from_block: 1,
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": 1,
"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' => 1,
'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": [
{
"idx": 41,
"block_id": 3422048,
"smt_root": "b4c9dacf8e194e353dce7638d76f282fe40399f7b0ad74a2229a6d4f5be774de"
},
{
"idx": 42,
"block_id": 3422335,
"smt_root": "eba675788f0fbf1df8a3c32e83da3e71dfd9337cca5a7c8ae2f51e963d03be17"
}
]
}
| 필드 | 타입 | 설명 |
|---|---|---|
idx | int | 앵커 컨트랙트 rootChain 배열에서의 위치. 체크포인트 탐색의 재개 커서 |
block_id | int | 해당 체크포인트에 포함된 마지막 PIVX block_id |
smt_root | string | 체크포인트의 SMT 루트 |