Skip to content

Commit 607ee17

Browse files
authored
Merge pull request #151 from frstrtr/dgb/m3-rpc-transport-wire
dgb: M3 wire external-daemon RPC transport into build + real ctor
2 parents 6c1f7c1 + 167d374 commit 607ee17

2 files changed

Lines changed: 14 additions & 5 deletions

File tree

src/impl/dgb/coin/CMakeLists.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,9 @@
77

88
set(dgb_coin_impl
99
rpc_data.hpp
10-
rpc.hpp
10+
rpc.hpp rpc.cpp
11+
rpc_request.hpp
12+
softfork_check.hpp
1113
p2p_connection.hpp p2p_connection.cpp
1214
p2p_node.cpp p2p_node.hpp
1315
p2p_messages.hpp

src/impl/dgb/coin/node.hpp

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64,18 +64,25 @@ class Node : public dgb::interfaces::Node
6464

6565
config_t* m_config = nullptr;
6666

67+
// Real io_context for the M3 NodeRPC transport (mirrors btc node.hpp).
68+
// rpc.hpp brings boost::asio in transitively; no extra include needed.
69+
boost::asio::io_context* m_context = nullptr;
70+
6771
std::unique_ptr<NodeRPC> m_rpc;
6872

6973
public:
70-
Node(auto* /*context*/, auto* config) : m_config(config)
74+
Node(auto* context, auto* config) : m_config(config), m_context(context)
7175
{
7276
}
7377

7478
void run()
7579
{
76-
// Stub NodeRPC: constructed so has-rpc presence wiring can be
77-
// exercised, but no transport connect until M3.
78-
m_rpc = std::make_unique<NodeRPC>(this);
80+
// M3: real NodeRPC transport (external-daemon FALLBACK path that V36
81+
// mandates persist alongside the embedded daemon). Mirrors btc
82+
// node.hpp; testnet drives the chain-identity genesis probe in
83+
// NodeRPC::check(). connect() (transport bring-up) is driven by the
84+
// pool-layer seam once an RPC endpoint is configured.
85+
m_rpc = std::make_unique<NodeRPC>(m_context, this, m_config->m_testnet);
7986
}
8087

8188
NodeRPC* rpc() { return m_rpc.get(); }

0 commit comments

Comments
 (0)