Skip to content

dgb: stand up embedded coin-daemon P2P producer in run-loop (Phase B) - #256

Merged
frstrtr merged 1 commit into
masterfrom
dgb/embedded-coin-p2p-producer
Jun 20, 2026
Merged

dgb: stand up embedded coin-daemon P2P producer in run-loop (Phase B)#256
frstrtr merged 1 commit into
masterfrom
dgb/embedded-coin-p2p-producer

Conversation

@frstrtr

@frstrtr frstrtr commented Jun 20, 2026

Copy link
Copy Markdown
Owner

Phase B — embedded coin-daemon P2P producer standup (binds the #250 consumer seam)

Constructs dgb::coin::p2p::NodeP2P<dgb::Config> in run_node and dials the local digibyted. With --coin-daemon HOST:PORT (+ --coin-magic / --coin-genesis) the producer speaks the DigiByte Core wire protocol (Scrypt-only consumer), completes version/verack, drives an initial getheaders from the genesis locator, and fires coin_iface.new_headers / new_tx on each live relay. The wire_*_ingest connectors from #250 route those onto HeaderChain::validate_and_append and Mempool::add_tx — live feed flows end-to-end the moment the handshake completes. No behavior change when --coin-daemon is absent (coin_p2p stays null).

Fence

  • Touches src/c2pool/main_dgb.cpp ONLY — the DGB-specific binary entry. Does NOT touch shared run_node, bitcoin_family/, or src/core/. Outside src/impl/dgb/ (it is the dgb binary main), so flagged for operator tap per integrator — live consensus-relevant ingest is not auto-merge.

Live regtest chain-advance evidence (against reachable digibyted /DigiByte:8.26.2/, proto 70019)

[DGB-CoinP2P] Connected to 127.0.0.1:18554
[DGB-CoinP2P] version: start_height=8 services=0x409 subver=/DigiByte:8.26.2/
[DGB] coin-daemon handshake OK — sending initial getheaders, locator=4598a0f2b823aaf9
# mined 3 blocks on the daemon (height 8 -> 11); producer pulled them live:
[DGB-CoinP2P] Full block received: 22c612a09a0be7f0... txs=1
[DGB-CoinP2P] Full block received: a58658b5be0de063... txs=1
[DGB-CoinP2P] Full block received: d8c14ddb36d66d45... txs=1
[DGB] io_context stopped — clean exit

HOLD merge — operator tap.

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).
@frstrtr
frstrtr merged commit e5c12cb into master Jun 20, 2026
27 checks passed
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