[Chronik] Add Chronik, connect it to CValidationInterface
Summary:
- Add Chronik, which will contain all the data/handles required to run Chronik.
- Make setup_bridge return a boxed Chronik.
- Add ChronikValidationInterface, to capture all the tx/block events happening in bitcoind.
- Add Start-/StopChronikValidationInterface to create a Chronik and start + register / stop + unregister ChronikValidationInterface.
Test Plan:
- ninja
- ./src/bitcoind -regtest -reindex -debug=chronik -> displays "Chronik: block connected" (for the genesis block)
- In a new window ./src/bitcoin-cli -regtest generatetoaddress ecregtest:qqmuvc70ttys4lg8se5tt7rgk53q6cmthuamcuaexg -> displays
"Chronik: block connected" in bitcoind
- ./src/bitcoin-cli invalidateblock <hash> -> displays "Chronik: block disconnected" in bitcoind
- Can also test adding/removing tx to/from mempool
A proper python-based HTTP test will be added in future diffs.
Reviewers: Fabien, #bitcoin_abc
Reviewed By: Fabien, #bitcoin_abc
Differential Revision: https://reviews.bitcoinabc.org/D12035