[chronik] implement blockchain.block.header electrum method
Summary:
Return the block header at the given height. If cp_height is zero, return the raw block header as a hexadecimal string. Otherwise a dictionary with the raw block header, the merkle root of all headers up to and including cp_height, and the merkle branch of header up to root.
See https://electrum-cash-protocol.readthedocs.io/en/latest/protocol-methods.html#blockchain-block-header
Depends on D17496
Test Plan:
ninja check-functional
On mainnet, check results against fulcrum:
./src/bitcoind -chronik -chronikelectrumbind="127.0.0.1:50001" echo '{"jsonrpc": "2.0", "method": "blockchain.block.header", "params": [400000, 800000], "id": "test"}' | nc 127.0.0.1 50001 echo '{"jsonrpc": "2.0", "method": "blockchain.block.header", "params": [400000, 800000], "id": "test"}' | nc electrum.bitcoinabc.org 50001
Reviewers: #bitcoin_abc, Fabien
Reviewed By: #bitcoin_abc, Fabien
Subscribers: Fabien
Differential Revision: https://reviews.bitcoinabc.org/D17485