From 167d374b1e9a3cc70b5eb8a6216ed80b73c36c61 Mon Sep 17 00:00:00 2001 From: frstrtr Date: Thu, 18 Jun 2026 08:19:52 +0000 Subject: [PATCH] dgb: M3 wire external-daemon RPC transport into build + real ctor The M3 RPC transport (rpc.cpp + rpc_request/softfork SSOTs) landed as additive coin-layer source in #149 but was never registered in CMake, so it never compiled into the build, and the node owner still constructed the 1-arg stub ctor. This closes that deferred Option-B wiring. - coin/CMakeLists.txt: add rpc.cpp + rpc_request.hpp + softfork_check.hpp to dgb_coin_impl so the transport TU is compiled and linked. - coin/node.hpp: capture the io_context in the Node ctor and construct the real NodeRPC(m_context, this, m_config->m_testnet), replacing the stub. This is the external-daemon FALLBACK path V36 mandates persists alongside the embedded daemon; testnet drives NodeRPC::check()s chain-identity --- src/impl/dgb/coin/CMakeLists.txt | 4 +++- src/impl/dgb/coin/node.hpp | 15 +++++++++++---- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/src/impl/dgb/coin/CMakeLists.txt b/src/impl/dgb/coin/CMakeLists.txt index 3fb1f0f48..70b2cdb7d 100644 --- a/src/impl/dgb/coin/CMakeLists.txt +++ b/src/impl/dgb/coin/CMakeLists.txt @@ -7,7 +7,9 @@ set(dgb_coin_impl rpc_data.hpp - rpc.hpp + rpc.hpp rpc.cpp + rpc_request.hpp + softfork_check.hpp p2p_connection.hpp p2p_connection.cpp p2p_node.cpp p2p_node.hpp p2p_messages.hpp diff --git a/src/impl/dgb/coin/node.hpp b/src/impl/dgb/coin/node.hpp index 18e58ad07..01ab209ec 100644 --- a/src/impl/dgb/coin/node.hpp +++ b/src/impl/dgb/coin/node.hpp @@ -64,18 +64,25 @@ class Node : public dgb::interfaces::Node config_t* m_config = nullptr; + // Real io_context for the M3 NodeRPC transport (mirrors btc node.hpp). + // rpc.hpp brings boost::asio in transitively; no extra include needed. + boost::asio::io_context* m_context = nullptr; + std::unique_ptr m_rpc; public: - Node(auto* /*context*/, auto* config) : m_config(config) + Node(auto* context, auto* config) : m_config(config), m_context(context) { } void run() { - // Stub NodeRPC: constructed so has-rpc presence wiring can be - // exercised, but no transport connect until M3. - m_rpc = std::make_unique(this); + // M3: real NodeRPC transport (external-daemon FALLBACK path that V36 + // mandates persist alongside the embedded daemon). Mirrors btc + // node.hpp; testnet drives the chain-identity genesis probe in + // NodeRPC::check(). connect() (transport bring-up) is driven by the + // pool-layer seam once an RPC endpoint is configured. + m_rpc = std::make_unique(m_context, this, m_config->m_testnet); } NodeRPC* rpc() { return m_rpc.get(); }