diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 16d7336d1..4b4f513cb 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -5,7 +5,7 @@ on: branches: [master, btc-embedded, dash-spv-embedded, windows-build, service-update] tags: ['v*'] pull_request: - branches: [master, btc-embedded, dash-spv-embedded] + branches: [master, btc-embedded, dash-spv-embedded, dgb/slice4-skeleton] jobs: # ════════════════════════════════════════════════════════════════════════════ diff --git a/.github/workflows/coin-matrix.yml b/.github/workflows/coin-matrix.yml index ce3213609..ecdf5b248 100644 --- a/.github/workflows/coin-matrix.yml +++ b/.github/workflows/coin-matrix.yml @@ -15,7 +15,7 @@ on: push: branches: [master, btc-embedded, dash-spv-embedded, windows-build, service-update] pull_request: - branches: [master, btc-embedded, dash-spv-embedded] + branches: [master, btc-embedded, dash-spv-embedded, dgb/slice4-skeleton] jobs: coin: diff --git a/src/c2pool/CMakeLists.txt b/src/c2pool/CMakeLists.txt index 540b94124..5e5f07409 100644 --- a/src/c2pool/CMakeLists.txt +++ b/src/c2pool/CMakeLists.txt @@ -155,6 +155,33 @@ target_link_libraries(c2pool-btc ${Boost_LIBRARIES} ) +# c2pool-dgb: DigiByte Scrypt-only (V36) — slice #4 minimal COMPILING SKELETON. +# Mirrors the c2pool-btc add_executable shape, pruned to a stub entry. The body +# (embedded daemon + pool pillars) is M3/Phase B; this target only proves the +# binary builds + links off master. It compiles impl/dgb/node.cpp directly +# rather than linking a dgb / dgb_coin / impl_dgb lib on purpose: the top-level +# OBJECT-lib registration of src/impl/dgb is ci-steward's convention PR and is +# intentionally NOT raced here. The skeleton reads only header constexpr +# constants from impl/dgb/config_{coin,pool}.hpp; those headers #include +# core/netaddress.hpp, which #includes . So the target needs +# yaml-cpp's INCLUDE DIR to compile — but NOT core's symbols: it never +# instantiates the Fileconfig-derived configs nor calls any core function. +# Linking the `core` library instead would drag in core/web_server.o + +# stratum_server.o, which reference merged/payout/hashrate/ltc symbols (the +# self-link tangle that forces c2pool-btc to drag in ltc/payout/merged) and +# would pull Phase B forward. We therefore add ONLY yaml-cpp (header path). +# Link deps stay at yaml-cpp + json + Boost until Phase B. +add_executable(c2pool-dgb + main_dgb.cpp + ${CMAKE_SOURCE_DIR}/src/impl/dgb/node.cpp +) +target_compile_definitions(c2pool-dgb PRIVATE C2POOL_VERSION="${C2POOL_GIT_VERSION}") +target_link_libraries(c2pool-dgb + yaml-cpp::yaml-cpp # include dir only: config_{coin,pool}.hpp -> core/netaddress.hpp -> + nlohmann_json::nlohmann_json + ${Boost_LIBRARIES} +) + # Windows: Boost.Asio requires Winsock libraries; /bigobj for large translation units if(WIN32) target_link_libraries(c2pool ws2_32 mswsock bcrypt dbghelp) diff --git a/src/c2pool/main_dgb.cpp b/src/c2pool/main_dgb.cpp new file mode 100644 index 000000000..042b3eb82 --- /dev/null +++ b/src/c2pool/main_dgb.cpp @@ -0,0 +1,56 @@ +// c2pool-dgb — DigiByte Scrypt-only (V36) p2pool node entry point. +// +// SLICE #4 (Option B): genuinely minimal COMPILING SKELETON. This wires the +// CMake c2pool-dgb target so the binary builds + links off master; it does +// NOT yet run a node. The embedded-daemon + pool/sharechain body is M3 / +// Phase B (DGB = PORT-not-activation; Phase A p2p+mempool already landed under +// impl/dgb/coin/). When the pool-pillars node.cpp lands it replaces the +// skeleton via a clean dgb-only re-cut off master. +// +// V36 scope: Scrypt blocks validated; the other 4 DGB algos (SHA256d, Skein, +// Qubit, Odocrypt) are accept-by-continuity / ignored — full 5-algo support +// is V37. Compatibility target: frstrtr/p2pool-merged-v36 (share format, +// sharechain rules, PPLNS, Stratum, block submission). See +// c2pool-dgb-embedded-impl-plan.md (frstrtr/the docs/v36). +// +// Mirrors src/c2pool/main_btc.cpp's target shape, pruned to a stub entry. + +#include + +#include +#include + +#ifndef C2POOL_VERSION +#define C2POOL_VERSION "dev" +#endif + +namespace { + +void print_banner(const char* argv0) +{ + std::cout + << "c2pool-dgb " << C2POOL_VERSION << " — DigiByte Scrypt-only (V36)\n\n" + << "Usage: " << argv0 << " [--version] [--help]\n\n" + << "Status: skeleton (slice #4). The node run-loop (embedded daemon +\n" + << " pool pillars) lands in M3 / Phase B.\n" + << "Network: " << dgb::network_summary() << "\n"; +} + +} // namespace + +int main(int argc, char** argv) +{ + for (int i = 1; i < argc; ++i) { + if (std::strcmp(argv[i], "--version") == 0) { + std::cout << "c2pool-dgb " << C2POOL_VERSION << "\n"; + return 0; + } + if (std::strcmp(argv[i], "--help") == 0) { + print_banner(argv[0]); + return 0; + } + } + + print_banner(argv[0]); + return dgb::run_skeleton(); +} diff --git a/src/impl/dgb/node.cpp b/src/impl/dgb/node.cpp new file mode 100644 index 000000000..8ea40e7b5 --- /dev/null +++ b/src/impl/dgb/node.cpp @@ -0,0 +1,41 @@ +#include "node.hpp" + +#include + +// c2pool-dgb node skeleton (slice #4, Option B). +// +// COMPILING SKELETON ONLY. The real embedded-daemon + pool/sharechain body +// (DensePPLNSWindow / PPLNS, p2p run-loop, template builder, broadcaster) is +// M3 / Phase B per the embedded-daemon roadmap: DGB is PORT-not-activation — +// Phase A p2p + mempool already landed under impl/dgb/coin/, and Phase B +// brings the pool pillars. When the pool-pillars node.cpp lands it REPLACES +// this file via a clean dgb-only re-cut off master; see +// c2pool-dgb-embedded-impl-plan.md (frstrtr/the docs/v36). +// +// Deliberately free of pool logic so c2pool-dgb LINKS today without dragging +// Phase B forward, instantiating the Fileconfig-derived config classes (whose +// load()/get_default() bodies are Phase B), or touching the shared +// bitcoin_family / DOGE-aux surface. + +namespace dgb +{ + +// One-line summary of the DGB-Scrypt network this binary targets. Reads the +// compile-time constants from config_{coin,pool}.hpp (header-only) — no +// Fileconfig instantiation. +std::string network_summary() +{ + return std::string("DigiByte Scrypt-only (V36) — ") + + "pool_p2p_port=" + std::to_string(PoolConfig::P2P_PORT) + + " coin_p2p_port=" + std::to_string(CoinParams::MAINNET_P2P_PORT) + + " block_period=" + std::to_string(CoinParams::BLOCK_PERIOD) + "s" + + " gbt_algo=" + std::string(CoinParams::GBT_ALGO); +} + +// Skeleton entry point. Phase B replaces this with the real node run-loop. +int run_skeleton() +{ + return 0; +} + +} // namespace dgb diff --git a/src/impl/dgb/node.hpp b/src/impl/dgb/node.hpp index d4980df4b..d8f777502 100644 --- a/src/impl/dgb/node.hpp +++ b/src/impl/dgb/node.hpp @@ -15,6 +15,8 @@ #include "config_pool.hpp" #include "config_coin.hpp" +#include + // DGB Scrypt shares use the same format as LTC shares. // The share type, validation logic, tracker, and protocol are shared. // Only config_pool and config_coin differ between LTC and DGB networks. @@ -27,4 +29,17 @@ namespace dgb using PoolConfigType = dgb::PoolConfig; using CoinParamsType = dgb::CoinParams; +// --------------------------------------------------------------------------- +// Skeleton entry points (slice #4, Option B). Defined in node.cpp. +// COMPILING SKELETON ONLY — the real node run-loop is M3 / Phase B. +// --------------------------------------------------------------------------- + +// One-line summary of the DGB-Scrypt network from the header-only config +// constants (no Fileconfig instantiation). +std::string network_summary(); + +// Skeleton run entry. Returns a process exit code. Phase B replaces this with +// the embedded-daemon + pool/sharechain run-loop. +int run_skeleton(); + } // namespace dgb