HomePhabricator

[Chronik] Add `ChronikBridge` to access the node from Rust

Description

[Chronik] Add ChronikBridge to access the node from Rust

Summary:
Chronik needs to be able to read data from the node. We add ChronikBridge (which stores a reference to NodeContext), which currently exposes get_chain_tip to get the tip of the chain.

Since for Rust this is an opaque C++ type, we need to pass it around as std::unique_ptr, using make_bridge. Eventually, this will be part of the Chronik struct so we can access the node when we need.

Test Plan:

  1. ninja test_bitcoin
  2. ./src/test/test_bitcoin -t chronikbridge_tests

Reviewers: Fabien, #bitcoin_abc

Reviewed By: Fabien, #bitcoin_abc

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

Details

Provenance
tobias_ruckAuthored on Sep 28 2022, 16:32
tobias_ruckPushed on Sep 29 2022, 16:16
Reviewer
Restricted Project
Differential Revision
D12059: [Chronik] Add `ChronikBridge` to access the node from Rust
Parents
rABC2fa1cd84083c: Switch scheduler to steady_clock
Branches
Unknown
Tags
Unknown