dgb: stand up embedded coin-daemon ingest surface (interfaces::Node + header+tx wire) - #250
Merged
Merged
Conversation
Construct dgb::interfaces::Node (coin/node_interface.hpp) in run_node and subscribe BOTH the HeaderChain and the Mempool to its new_headers / new_tx feeds via the wire_header_ingest + wire_mempool_ingest SSOT connectors. This is the CONSUMER seam the embedded coin-daemon P2P node (coin/p2p_node.hpp NodeP2P) binds against: NodeP2P fires new_headers on each received headers batch and new_tx on each relayed tx; routing both through the wire_*_ingest connectors makes a live feed flow into HeaderChain::validate_and_append and Mempool::add_tx the moment the NodeP2P producer is connected (its construct + connect is the next slice). header+mempool ingest wired together. coin_iface is declared AFTER header_chain + mempool so it (and its event subscriptions, whose handlers capture chain/pool by reference) destructs first. No behavior change this slice: with no NodeP2P producer constructed yet the feeds never fire, so chain + mempool stay byte-identical to before. main_dgb.cpp links the full dgb codec, so the mempool_ingest.hpp #143 SCC note is satisfied. Single-file (src/c2pool/main_dgb.cpp). Build EXIT=0, --selftest OK.
frstrtr
added a commit
that referenced
this pull request
Jun 20, 2026
Construct dgb::coin::p2p::NodeP2P<dgb::Config> against the coin_iface ingest seam landed in #250 and dial the local digibyted. On --run with --coin-daemon HOST:PORT (+ --coin-magic / --coin-genesis), the producer speaks the DigiByte Core wire protocol (Scrypt-only consumer), completes the version/verack handshake, drives an initial getheaders from the genesis locator, and fires coin_iface.new_headers / new_tx on each live relay. The wire_*_ingest connectors route those onto HeaderChain::validate_and_append and Mempool::add_tx, so a live feed now flows end-to-end the moment the handshake completes. Coin-daemon wire MAGIC is kept distinct from the sharechain PREFIX isolation primitive; both endpoint and magic are supplied by main() so the binary targets mainnet or a dev regtest daemon without hard-coding. No behavior change when --coin-daemon is absent (coin_p2p stays null).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Phase B — embedded coin-daemon P2P node standup, consumer-seam slice (integrator directive 2026-06-20 UID:1602: proceed to ::dgb::interfaces::Node standup, header+mempool ingest together).
What
run_node() now constructs
dgb::interfaces::Node coin_ifaceand subscribes BOTH the HeaderChain and the Mempool to its feeds via the existing SSOT connectors:wire_header_ingest(coin_iface, header_chain)-> new_headers -> make_header_sample -> HeaderChain::validate_and_appendwire_mempool_ingest(coin_iface, mempool)-> new_tx -> Mempool::add_txThis is the CONSUMER seam the embedded NodeP2P (coin/p2p_node.hpp) binds against (it takes a
dgb::interfaces::Node*and fires new_headers/new_tx). NodeP2P construct + connect is the next slice.Discipline
coin_ifacedeclared AFTER header_chain + mempool so it (and its subscriptions, whose handlers capture chain/pool by ref) destructs first.Scope / verification
--selftestOKHOLD merge.