Page MenuHomePhabricator

[Chronik] Add `Chronik`, connect it to `CValidationInterface`
ClosedPublic

Authored by tobias_ruck on Sep 22 2022, 16:40.

Details

Summary
  1. Add Chronik, which will contain all the data/handles required to run Chronik.
  2. Make setup_bridge return a boxed Chronik.
  3. Add ChronikValidationInterface, to capture all the tx/block events happening in bitcoind.
  4. Add Start-/StopChronikValidationInterface to create a Chronik and start + register / stop + unregister ChronikValidationInterface.
Test Plan
  1. ninja
  2. ./src/bitcoind -regtest -reindex -debug=chronik -> displays "Chronik: block connected" (for the genesis block)
  3. In a new window ./src/bitcoin-cli -regtest generatetoaddress ecregtest:qqmuvc70ttys4lg8se5tt7rgk53q6cmthuamcuaexg -> displays

"Chronik: block connected" in bitcoind

  1. ./src/bitcoin-cli invalidateblock <hash> -> displays "Chronik: block disconnected" in bitcoind
  2. Can also test adding/removing tx to/from mempool

A proper python-based HTTP test will be added in future diffs.

Diff Detail

Repository
rABC Bitcoin ABC
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

This revision is now accepted and ready to land.Sep 23 2022, 09:23

Rename ChronikIndexer to Chronik.

Then we can use ChronikIndexer for the stuff that only does the indexing, but e.g. none of the HTTP stuff, and Chronik then bundles
everything that’s Chronik

tobias_ruck retitled this revision from [Chronik] Add `ChronikIndexer`, connect it to `CValidationInterface` to [Chronik] Add `Chronik`, connect it to `CValidationInterface`.Sep 23 2022, 09:36
tobias_ruck edited the summary of this revision. (Show Details)