Skip to content

dgb: stand up embedded coin-daemon ingest surface (interfaces::Node + header+tx wire) - #250

Merged
frstrtr merged 1 commit into
masterfrom
dgb/embedded-iface-ingest-standup
Jun 20, 2026
Merged

dgb: stand up embedded coin-daemon ingest surface (interfaces::Node + header+tx wire)#250
frstrtr merged 1 commit into
masterfrom
dgb/embedded-iface-ingest-standup

Conversation

@frstrtr

@frstrtr frstrtr commented Jun 20, 2026

Copy link
Copy Markdown
Owner

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_iface and 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_append
  • wire_mempool_ingest(coin_iface, mempool) -> new_tx -> Mempool::add_tx

This 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

  • No behavior change: with no NodeP2P producer constructed yet, new_headers/new_tx never fire -> chain + mempool stay byte-identical to before. Non-consensus seam standup.
  • Lifetime: coin_iface declared AFTER header_chain + mempool so it (and its subscriptions, whose handlers capture chain/pool by ref) destructs first.
  • main_dgb.cpp links the full dgb codec, satisfying mempool_ingest.hpp ci: build test_dgb_subsidy in both Linux test jobs (fix master-red NOT_BUILT) #143 SCC note.

Scope / verification

  • Single file: src/c2pool/main_dgb.cpp
  • Build c2pool-dgb EXIT=0; --selftest OK
  • GPG-signed; src/impl/dgb + exe only; no shared-base / bitcoin_family touch

HOLD merge.

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
frstrtr merged commit 0eca6f6 into master Jun 20, 2026
35 of 36 checks passed
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).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant