[EOSIO/eos] error for “get_block_header_state” (#4485)

I copied the following snippet from your previous comments:
“`
sam@sam-machine:~$ cleos get info
{
“server_version”: “5875549c”,
“chain_id”: “c40a90d6bcb4b9b2c2d4c0916ee97a29af42a420372af44fa4f538ddef9e6b83”,
“head_block_num”: 2228,
“last_irreversible_block_num”: 2227,
“last_irreversible_block_id”: “000008b351c16d86dbed624a36111cbc091402194a9d908b8c5000c05c699471”,
“head_block_id”: “000008b4a7a2da7d7a35834b2fe68ab9cf3ecdcad4c4db761ffb3336d4dbae5c”,
“head_block_time”: “2018-07-05T21:20:55.500”,
“head_block_producer”: “eosio”,
“virtual_block_cpu_limit”: 1852309,
“virtual_block_net_limit”: 9729146,
“block_cpu_limit”: 199900,
“block_net_limit”: 1048576
}
sam@sam-machine:~$ cleos get block –header-state 2226
Error 3100002: unknown block
sam@sam-machine:~$ cleos get info
{
“server_version”: “5875549c”,
“chain_id”: “c40a90d6bcb4b9b2c2d4c0916ee97a29af42a420372af44fa4f538ddef9e6b83”,
“head_block_num”: 2250,
“last_irreversible_block_num”: 2249,
“last_irreversible_block_id”: “000008c9beb42e8a8819add64951014ce2a28534e79964b5261664201be907f8”,
“head_block_id”: “000008ca0f9ee04dc61e75fca610e705fd93fda2f3e17e745b5ca7478a256cb7”,
“head_block_time”: “2018-07-05T21:21:06.500”,
“head_block_producer”: “eosio”,
“virtual_block_cpu_limit”: 1893521,
“virtual_block_net_limit”: 9945656,
“block_cpu_limit”: 199900,
“block_net_limit”: 1048576
}
“`

If the above snippet is what you mean by not working in your local node, it’s because you are trying to query header state of an irreversible block. Notice that your last irreversible block is 2227 there and you query block 2226, which for sure has been deemed irreversible. If you only have one producer in your local node, your last irreversible block is just one block behind your head block, so you can only use `–header-state` on your head block.

This post was last modified on July 6, 2018, 4:16 am