Yoxlama məntəqələri
Prover nodu tərəfindən yaradılan kriptoqrafik sinxronizasiya yoxlama nöqtələrinin siyahısını alır, müştərilərə xüsusi blok hündürlüklərinə qarşı məlumatların bütövlüyünü yoxlamağa imkan verir.
Son nöqtə
POST https://indexer.zcashnames.co/v1.0/checkpoints
Sorğu orqanı
Sorğu orqanı aşağıdakı parametrləri ehtiva edən JSON obyekti olmalıdır:
| Parametr | Növ | Defolt | Təsvir |
|---|---|---|---|
count | integer | 100 | Tək cavabda qaytarılan yoxlama məntəqələrinin maksimum sayını məhdudlaşdırın. |
from_block | integer | Heç biri | Bu xüsusi blok hündürlüyündən başlayaraq yoxlama nöqtəsi məlumatlarını tələb edin. |
order | string | desc | Nəzarət məntəqələrinin çeşidlənməsi qaydası. Qəbul edilmiş dəyərlər: asc və ya desc. |
Kod Nümunələri
- cURL
- JavaScript
- Python
- PHP
curl -X POST https://indexer.zcashnames.co/v1.0/checkpoints \
-H "Content-Type: application/json" \
-d '{
"count": 2,
"from_block": 1,
"order": "asc"
}'
const url = 'https://indexer.zcashnames.co/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.zcashnames.co/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.zcashnames.co/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);
Cavab nümunəsi
{
"response": [
{
"block_id": 3422048,
"smt_root": "b4c9dacf8e194e353dce7638d76f282fe40399f7b0ad74a2229a6d4f5be774de",
"evm_block_id": 290453948,
"evm_tx_hash": "0xcfc86b34ad55450b73511d9ce5b5d33e5e0e2366ceb7ae7e81bdcce62f57de38"
},
{
"block_id": 3422335,
"smt_root": "eba675788f0fbf1df8a3c32e83da3e71dfd9337cca5a7c8ae2f51e963d03be17",
"evm_block_id": 290504572,
"evm_tx_hash": "0x9f943993b6e6430fe3da448c52b122342c0a629e7eca520d1d22df063c22002b"
}
]
}
| Sahə | Növ | Təsvir |
|---|---|---|
block_id | int | Sonuncu ZCash blok identifikatoru keçid məntəqəsinə daxil edilmişdir |
smt_root | simli | Yoxlama məntəqəsinin SMT Kökü |
evm_block_id | simli | Yoxlama məntəqəsinin yaradılmasının EVM blok_id |
evm_tx_hash | simli | Yoxlama məntəqəsinin yaradılmasının EVM tx_hash |