HomePhabricator

[chronik] Electrum: add the blockchain.headers.subscribe endpoint

Description

[chronik] Electrum: add the blockchain.headers.subscribe endpoint

Summary:
Subscribe to get the new header when a block is connected.

This requires karyon version 0.2.2 so we can inject our own custom notification encoding function.
The format has been fixed since D18068.

Test Plan:

./test/functional/test_runner.py chronik_electrum_*

In terminal 1:

./src/bitcoind -regtest -debug=chronik -chronik -chronikscripthashindex -chronikelectrumbind="127.0.0.1:50001"

In terminal 2 (can be done in several terminals):

echo '{"jsonrpc": "2.0", "method": "blockchain.headers.subscribe", "params": [], "id": "test"}' | nc 127.0.0.1 50001 | jq

in terminal 3:

./src/bitcoin-cli -regtest createwallet regtest
./src/bitcoin-cli -regtest -generate 1

Reviewers: #bitcoin_abc, PiRK

Reviewed By: #bitcoin_abc, PiRK

Subscribers: PiRK

Differential Revision: https://reviews.bitcoinabc.org/D18080

Details

Provenance
FabienAuthored on Thu, May 8, 21:05
FabienPushed on Mon, May 12, 22:24
Reviewer
Restricted Project
Differential Revision
D18080: [chronik] Electrum: add the blockchain.headers.subscribe endpoint
Parents
rABC0b231a78864e: More clang-tidy fixes
Branches
Unknown
Tags
Unknown