HomePhabricator

[Chronik] Add empty HTTP server

Description

[Chronik] Add empty HTTP server

Summary:

  1. Add chronik-http crate to run an HTTP server using axum within bitcoind. It currently has no routes, so every request will result in a 404.
  2. Use tokio runtime; outstanding HTTP requests and ports are automatically dropped when Chronik is dropped.
  3. Add abort_node ffi function to gracefully shut down the node with an error message.
  4. Add "chronik_" prefix as allowed prefix for tests.

Test Plan:

  1. ninja
  2. ninja check-functional
  3. Running ./src/bitcoind -regtest, and then ./src/bitcoind -datadir=/tmp/regtest -regtest -listen=0 -server=0 results in: Error: Chronik failed binding to 127.0.0.1:18442: error creating server listener: Address already in use (os error 48)

Or in a similar OS error.

Reviewers: Fabien, #bitcoin_abc

Reviewed By: Fabien, #bitcoin_abc

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

Details

Provenance
tobias_ruckAuthored on Dec 5 2022, 14:35
tobias_ruckPushed on Dec 6 2022, 13:29
Reviewer
Restricted Project
Differential Revision
D12673: [Chronik] Add empty HTTP server
Parents
rABC31595faa0358: [Cashtab] Prevent .map error in TxHistory
Branches
Unknown
Tags
Unknown
Reverted By
rABC71ca5718d140: Revert "[Chronik] Add empty HTTP server"
D12782: Revert "[Chronik] Add empty HTTP server"