dcr

Decred (DCR)

Method: POST getheaders

dropdown
POST

getheaders

Returns block headers starting with the first known block hash from the request.

Parameters

blocklocators - json array

Array of block locator hashes.

hashstop - string

Block hash to stop including block headers for, set to zero to get as many blocks as possible.

Request

curl --location --request POST 'https://dcr.getblock.io/mainnet/' 
--header 'x-api-key: YOUR-API-KEY' 
--header 'Content-Type: application/json' 
--data-raw '{"jsonrpc": "2.0",
"method": "getheaders",
"params": [["000000000000000015cf0d0da939e61d0cd7a37443a99c726ecc9cbbd61b047f"], "0"],
"id": "getblock.io"}'


Response

{
    "error": null,
    "id": "getblock.io",
    "jsonrpc": "2.0",
    "result": {
        "headers": [
            "080000007f041bd6bb9ccc6e729ca94374a3d70c1de639a90d0dcf1500000000000000008fa9966cb2b3e7747577cc3820a4afe9ada7ed97dc7d70cdfccd7be940e24963bd59531fc338e9a93e6ab11e8f1cf6c8768329c2f9ec26c798bb51f762e699cc01002659e450de9705001300da9f00004b973e18d0bf358104000000c2ff0800e22700002cdc416138ef58a0b8c730037df1730000000000000000000000000000000000000000000000000008000000",
            "08000000863461940368f9489abc267c856bea219194ff24eea17237000000000000000090973e0d18e3bec86c0301dcdf550f1310e2dcf0b6c138efdd809ff3aff0b03de682bc633687d02d1da683d477b617cc4a152dc2a1a4117feff64178d065e9af0100bff03d1964a405000300d59f00004b973e18d0bf358104000000c3ff0800ca0301003cdf4161b6107eb30000000076eefff21a352427000000000000000000000000000000000000000008000000",
            "080000001186afd45a29a9472eca65c4bf2f2a6c90db1335fb40023b0000000000000000f5c7bf857ca7562ab3f3b1ccd64a2e7aa3c8123df989fe0a9794b0406e3315414b7f873b8c8f7ad653c95d0d7da896dd8b3b1452251627292b8630a77e4298e90100e3cf0ef4f2c205000e01d09f00004b973e18d0bf358104000000c4ff0800571f0000e5df4161618be6717a02b00000f8267300000000000000000000000000000000000000000000000008000000",
            "080000008ae410106fee12aa590641d220908dc4a9789009524c972f00000000000000007b102ad548e331050bca8da0a458973a8ac1d092c227f22a839cf9614978df387c3033d8154af4953e9f3f6ea9b2154e3e62bc132869748d9d515122a2d98b9e01001c69e210111905000100cc9f00004b973e18d0bf358104000000c5ff0800390b000009e04161d2c851d3000000003de64a761d4a9c4c000000000000000000000000000000000000000008000000"
        ]
    }
}