Skip to content

Commit d16a152

Browse files
authored
release: fix all-coin packaging (libsecp256k1 bundle + per-coin configs) for v0.2.3.1 (#742)
BUG A (Linux, all 5 coins): every v0.2.3 Linux tarball was dead-on-arrival. The Linux packaging step hardcoded libsecp256k1.so.2, but the runners libsecp256k1-dev provides .so.1, so the find matched nothing and the binary only dynamic non-glibc dependency (libsecp256k1.so.1) was never bundled; lib/ carried only the statically-redundant leveldb/snappy. Replace the hardcoded SONAME list with an ldd-resolved copy of the real runtime closure (SONAME-agnostic). macOS/Windows already bundle secp256k1 correctly. BUG B (all 15 packages): every coin tarball shipped the Litecoin config (LTC header, ports 9326/9327, LTC/DOGE checkpoints, embedded_ltc), so a DASH pool logged LTC and bound LTC ports. Add per-coin config/<coin>/ mainnet+testnet files with coin-correct headers and authoritative sharechain ports (btc 9333, ltc 9326/9327, dgb 5024/5025, dash 8999/7903, bch 9349); release.yml selects config/${COIN}/ on all three platforms. DASH config documents the external dashd-RPC fallback (embedded SPV unwired per #738). Guards: release.yml packaging asserts each Linux package bundles libsecp256k1 and its config header names the coin (fail-fast tripwires); start.sh/start.bat refuse to launch a binary against a mismatched-coin config. Co-authored-by: frstrtr <frstrtr@users.noreply.github.com>
1 parent 435e975 commit d16a152

13 files changed

Lines changed: 358 additions & 8 deletions

.github/workflows/release.yml

Lines changed: 19 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -182,13 +182,23 @@ jobs:
182182
mkdir -p "${PKG}/lib" "${PKG}/config" "${PKG}/web-static" "${PKG}/explorer"
183183
cp "build_${COIN}/src/c2pool/c2pool-${COIN}" "${PKG}/"
184184
strip "${PKG}/c2pool-${COIN}"
185-
for lib in libleveldb.so.1 libsecp256k1.so.2 libsnappy.so.1; do
186-
found=$(find /usr/lib -name "${lib}*" -type f 2>/dev/null | head -1)
187-
[ -n "$found" ] && cp "$found" "${PKG}/lib/"
185+
# Bundle the real runtime shared-library closure resolved from the freshly
186+
# built binary via ldd (SONAME-agnostic). v0.2.3 shipped every Linux tarball
187+
# DOA: this step hardcoded libsecp256k1.so.2 while the runner's
188+
# libsecp256k1-dev provides .so.1 — find matched nothing and the binary's
189+
# only dynamic non-glibc dependency went unbundled. Resolve, don't guess.
190+
ldd "${PKG}/c2pool-${COIN}" | awk '/=> \//{print $3}' | while read -r so; do
191+
case "$(basename "$so")" in
192+
libc.so*|libm.so*|libdl.so*|librt.so*|libpthread.so*|ld-linux*|libstdc++.so*|libgcc_s.so*|libresolv.so*) continue ;;
193+
esac
194+
cp -Lv "$so" "${PKG}/lib/"
188195
done
189196
cp start.sh "${PKG}/" && chmod +x "${PKG}/start.sh"
190-
cp config/c2pool_mainnet.yaml "${PKG}/config/c2pool_mainnet.yaml.example" || true
191-
cp config/c2pool_testnet.yaml "${PKG}/config/" || true
197+
cp "config/${COIN}/c2pool_mainnet.yaml" "${PKG}/config/c2pool_mainnet.yaml.example"
198+
cp "config/${COIN}/c2pool_testnet.yaml" "${PKG}/config/c2pool_testnet.yaml"
199+
# Fail-fast packaging tripwires (BUG A / BUG B regression guards):
200+
ls "${PKG}/lib/" | grep -q '^libsecp256k1\.so' || { echo "PKG-ASSERT FAIL: libsecp256k1 not bundled in ${PKG}/lib"; exit 1; }
201+
head -1 "${PKG}/config/c2pool_mainnet.yaml.example" | grep -qi "${COIN}" || { echo "PKG-ASSERT FAIL: ${PKG} config header does not identify ${COIN}"; exit 1; }
192202
cp -r web-static/* "${PKG}/web-static/"
193203
cp explorer/explorer.py "${PKG}/explorer/"
194204
tar czf "${PKG}.tar.gz" "${PKG}/"
@@ -304,7 +314,8 @@ jobs:
304314
install_name_tool -id "@executable_path/lib/$(basename $lib)" "$lib"
305315
done
306316
cp start.sh "${PKG}/" && chmod +x "${PKG}/start.sh"
307-
cp config/c2pool_mainnet.yaml "${PKG}/config/c2pool_mainnet.yaml.example" || true
317+
cp "config/${COIN}/c2pool_mainnet.yaml" "${PKG}/config/c2pool_mainnet.yaml.example"
318+
cp "config/${COIN}/c2pool_testnet.yaml" "${PKG}/config/c2pool_testnet.yaml"
308319
cp -r web-static/* "${PKG}/web-static/"
309320
cp explorer/explorer.py "${PKG}/explorer/"
310321
@@ -577,8 +588,8 @@ jobs:
577588
Copy-Item start.bat "${PKG}/"
578589
Copy-Item -Recurse web-static/* "${PKG}/web-static/"
579590
Copy-Item explorer/explorer.py "${PKG}/explorer/"
580-
Copy-Item config/c2pool_mainnet.yaml "${PKG}/config/c2pool_mainnet.yaml.example"
581-
Copy-Item config/c2pool_testnet.yaml "${PKG}/config/" -ErrorAction SilentlyContinue
591+
Copy-Item "config/${COIN}/c2pool_mainnet.yaml" "${PKG}/config/c2pool_mainnet.yaml.example"
592+
Copy-Item "config/${COIN}/c2pool_testnet.yaml" "${PKG}/config/c2pool_testnet.yaml"
582593
Compress-Archive -Path "${PKG}" -DestinationPath "${PKG}.zip"
583594
584595
- name: Upload package

config/bch/c2pool_mainnet.yaml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# C2Pool Bitcoin Cash [BCH] Mainnet Configuration
2+
#
3+
# Zero-config startup: run ./start.sh (Linux/macOS) or start.bat (Windows).
4+
# Miners set their payout address as the stratum username (p2pool-style).
5+
# CLI arguments always override values set here.
6+
7+
# --- Network -----------------------------------------------------------------
8+
port: 9349 # p2pool sharechain P2P port (BCH mainnet default)
9+
# stratum_port: # Stratum is opt-in for this coin: enable with --stratum [HOST:]PORT
10+
web_port: 8080 # Web dashboard / JSON-RPC API port
11+
http_host: "0.0.0.0" # HTTP bind address
12+
# external_ip: "" # Public IP/domain for stratum URL display
13+
#
14+
# Port forwarding (if behind NAT/firewall):
15+
# 9349 TCP — P2P sharechain (REQUIRED for full p2pool participation)
16+
# 8333 TCP — BCH coin P2P (recommended for faster daemon sync)
17+
18+
# --- Operating mode ----------------------------------------------------------
19+
# Deployment: EXTERNAL BCHN (bitcoind-cash) RPC for block templates.
20+
# Run a full BCHN node and set the bch_rpc_* fields below.
21+
22+
# --- Bootstrap header checkpoint (optional) ----------------------------------
23+
# Skip old headers on first sync. Format: HEIGHT:BLOCK_HASH
24+
# header_checkpoint: "HEIGHT:BLOCK_HASH" # set for faster first sync
25+
26+
# --- Coin daemon RPC (for non-embedded / daemon mode) ------------------------
27+
# bch_rpc_host: 127.0.0.1
28+
# bch_rpc_port: # your BCH daemon's RPC port
29+
# bch_rpc_user: user
30+
# bch_rpc_password: pass
31+

config/bch/c2pool_testnet.yaml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# C2Pool Bitcoin Cash [BCH] Testnet Configuration
2+
#
3+
# Zero-config startup: run ./start.sh (Linux/macOS) or start.bat (Windows).
4+
# Miners set their payout address as the stratum username (p2pool-style).
5+
# CLI arguments always override values set here.
6+
7+
# --- Network -----------------------------------------------------------------
8+
# port: # BCH testnet sharechain port — binary default applies; set to override
9+
# stratum_port: # Stratum is opt-in for this coin: enable with --stratum [HOST:]PORT
10+
web_port: 8080 # Web dashboard / JSON-RPC API port
11+
http_host: "0.0.0.0" # HTTP bind address
12+
# external_ip: "" # Public IP/domain for stratum URL display
13+
14+
# --- Operating mode ----------------------------------------------------------
15+
# Deployment: EXTERNAL BCHN (bitcoind-cash) RPC for block templates.
16+
# Run a full BCHN node and set the bch_rpc_* fields below.
17+
18+
# --- Bootstrap header checkpoint (optional) ----------------------------------
19+
# Skip old headers on first sync. Format: HEIGHT:BLOCK_HASH
20+
# header_checkpoint: "HEIGHT:BLOCK_HASH" # set for faster first sync
21+
22+
# --- Coin daemon RPC (for non-embedded / daemon mode) ------------------------
23+
# bch_rpc_host: 127.0.0.1
24+
# bch_rpc_port: # your BCH daemon's RPC port
25+
# bch_rpc_user: user
26+
# bch_rpc_password: pass
27+

config/btc/c2pool_mainnet.yaml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# C2Pool Bitcoin [BTC] Mainnet Configuration
2+
#
3+
# Zero-config startup: run ./start.sh (Linux/macOS) or start.bat (Windows).
4+
# Miners set their payout address as the stratum username (p2pool-style).
5+
# CLI arguments always override values set here.
6+
7+
# --- Network -----------------------------------------------------------------
8+
port: 9333 # p2pool sharechain P2P port (BTC mainnet default)
9+
# stratum_port: # Stratum is opt-in for this coin: enable with --stratum [HOST:]PORT
10+
web_port: 8080 # Web dashboard / JSON-RPC API port
11+
http_host: "0.0.0.0" # HTTP bind address
12+
# external_ip: "" # Public IP/domain for stratum URL display
13+
#
14+
# Port forwarding (if behind NAT/firewall):
15+
# 9333 TCP — P2P sharechain (REQUIRED for full p2pool participation)
16+
# 8333 TCP — BTC coin P2P (recommended for faster daemon sync)
17+
18+
# --- Operating mode ----------------------------------------------------------
19+
# Deployment: EXTERNAL bitcoind RPC for block templates (getblocktemplate).
20+
# Run a full bitcoind and set the btc_rpc_* fields below.
21+
22+
# --- Bootstrap header checkpoint (optional) ----------------------------------
23+
# Skip old headers on first sync. Format: HEIGHT:BLOCK_HASH
24+
# header_checkpoint: "HEIGHT:BLOCK_HASH" # set for faster first sync
25+
26+
# --- Coin daemon RPC (for non-embedded / daemon mode) ------------------------
27+
# btc_rpc_host: 127.0.0.1
28+
# btc_rpc_port: # your BTC daemon's RPC port
29+
# btc_rpc_user: user
30+
# btc_rpc_password: pass
31+

config/btc/c2pool_testnet.yaml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# C2Pool Bitcoin [BTC] Testnet Configuration
2+
#
3+
# Zero-config startup: run ./start.sh (Linux/macOS) or start.bat (Windows).
4+
# Miners set their payout address as the stratum username (p2pool-style).
5+
# CLI arguments always override values set here.
6+
7+
# --- Network -----------------------------------------------------------------
8+
# port: # BTC testnet sharechain port — binary default applies; set to override
9+
# stratum_port: # Stratum is opt-in for this coin: enable with --stratum [HOST:]PORT
10+
web_port: 8080 # Web dashboard / JSON-RPC API port
11+
http_host: "0.0.0.0" # HTTP bind address
12+
# external_ip: "" # Public IP/domain for stratum URL display
13+
14+
# --- Operating mode ----------------------------------------------------------
15+
# Deployment: EXTERNAL bitcoind RPC for block templates (getblocktemplate).
16+
# Run a full bitcoind and set the btc_rpc_* fields below.
17+
18+
# --- Bootstrap header checkpoint (optional) ----------------------------------
19+
# Skip old headers on first sync. Format: HEIGHT:BLOCK_HASH
20+
# header_checkpoint: "HEIGHT:BLOCK_HASH" # set for faster first sync
21+
22+
# --- Coin daemon RPC (for non-embedded / daemon mode) ------------------------
23+
# btc_rpc_host: 127.0.0.1
24+
# btc_rpc_port: # your BTC daemon's RPC port
25+
# btc_rpc_user: user
26+
# btc_rpc_password: pass
27+

config/dash/c2pool_mainnet.yaml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# C2Pool Dash [DASH] Mainnet Configuration
2+
#
3+
# Zero-config startup: run ./start.sh (Linux/macOS) or start.bat (Windows).
4+
# Miners set their payout address as the stratum username (p2pool-style).
5+
# CLI arguments always override values set here.
6+
7+
# --- Network -----------------------------------------------------------------
8+
port: 8999 # p2pool sharechain P2P port (DASH mainnet default)
9+
stratum_port: 7903 # Stratum mining port
10+
web_port: 8080 # Web dashboard / JSON-RPC API port
11+
http_host: "0.0.0.0" # HTTP bind address
12+
# external_ip: "" # Public IP/domain for stratum URL display
13+
#
14+
# Port forwarding (if behind NAT/firewall):
15+
# 8999 TCP — P2P sharechain (REQUIRED for full p2pool participation)
16+
# 7903 TCP — Stratum mining (REQUIRED for miners to connect)
17+
# 9999 TCP — DASH coin P2P (recommended for faster daemon sync)
18+
19+
# --- Operating mode ----------------------------------------------------------
20+
# Deployment: EXTERNAL dashd RPC fallback. Embedded Dash SPV is NOT wired
21+
# on this release (tracked in #738) — do not rely on embedded mode. Point
22+
# the dash_rpc_* fields below at a running dashd for block templates.
23+
# embedded_dash: false # (unavailable this release)
24+
25+
# --- Bootstrap header checkpoint (optional) ----------------------------------
26+
# Skip old headers on first sync. Format: HEIGHT:BLOCK_HASH
27+
# header_checkpoint: "HEIGHT:BLOCK_HASH" # set for faster first sync
28+
29+
# --- Coin daemon RPC (for non-embedded / daemon mode) ------------------------
30+
# dash_rpc_host: 127.0.0.1
31+
# dash_rpc_port: # your DASH daemon's RPC port
32+
# dash_rpc_user: user
33+
# dash_rpc_password: pass
34+

config/dash/c2pool_testnet.yaml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# C2Pool Dash [DASH] Testnet Configuration
2+
#
3+
# Zero-config startup: run ./start.sh (Linux/macOS) or start.bat (Windows).
4+
# Miners set their payout address as the stratum username (p2pool-style).
5+
# CLI arguments always override values set here.
6+
7+
# --- Network -----------------------------------------------------------------
8+
port: 18999 # p2pool sharechain P2P port (DASH testnet default)
9+
stratum_port: 17903 # Stratum mining port
10+
web_port: 8080 # Web dashboard / JSON-RPC API port
11+
http_host: "0.0.0.0" # HTTP bind address
12+
# external_ip: "" # Public IP/domain for stratum URL display
13+
#
14+
# Port forwarding (if behind NAT/firewall):
15+
# 18999 TCP — P2P sharechain (REQUIRED for full p2pool participation)
16+
# 17903 TCP — Stratum mining (REQUIRED for miners to connect)
17+
# 9999 TCP — DASH coin P2P (recommended for faster daemon sync)
18+
19+
# --- Operating mode ----------------------------------------------------------
20+
# Deployment: EXTERNAL dashd RPC fallback. Embedded Dash SPV is NOT wired
21+
# on this release (tracked in #738) — do not rely on embedded mode. Point
22+
# the dash_rpc_* fields below at a running dashd for block templates.
23+
# embedded_dash: false # (unavailable this release)
24+
25+
# --- Bootstrap header checkpoint (optional) ----------------------------------
26+
# Skip old headers on first sync. Format: HEIGHT:BLOCK_HASH
27+
# header_checkpoint: "HEIGHT:BLOCK_HASH" # set for faster first sync
28+
29+
# --- Coin daemon RPC (for non-embedded / daemon mode) ------------------------
30+
# dash_rpc_host: 127.0.0.1
31+
# dash_rpc_port: # your DASH daemon's RPC port
32+
# dash_rpc_user: user
33+
# dash_rpc_password: pass
34+

config/dgb/c2pool_mainnet.yaml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# C2Pool DigiByte [DGB] Mainnet Configuration
2+
#
3+
# Zero-config startup: run ./start.sh (Linux/macOS) or start.bat (Windows).
4+
# Miners set their payout address as the stratum username (p2pool-style).
5+
# CLI arguments always override values set here.
6+
7+
# --- Network -----------------------------------------------------------------
8+
port: 5024 # p2pool sharechain P2P port (DGB mainnet default)
9+
stratum_port: 5025 # Stratum mining port
10+
web_port: 8080 # Web dashboard / JSON-RPC API port
11+
http_host: "0.0.0.0" # HTTP bind address
12+
# external_ip: "" # Public IP/domain for stratum URL display
13+
#
14+
# Port forwarding (if behind NAT/firewall):
15+
# 5024 TCP — P2P sharechain (REQUIRED for full p2pool participation)
16+
# 5025 TCP — Stratum mining (REQUIRED for miners to connect)
17+
# 12024 TCP — DGB coin P2P (recommended for faster daemon sync)
18+
19+
# --- Operating mode ----------------------------------------------------------
20+
# Deployment: DigiByte daemon RPC. Run digibyted and set the dgb_rpc_*
21+
# fields below. See `./c2pool-dgb --help` for algo/mode options.
22+
23+
# --- Bootstrap header checkpoint (optional) ----------------------------------
24+
# Skip old headers on first sync. Format: HEIGHT:BLOCK_HASH
25+
# header_checkpoint: "HEIGHT:BLOCK_HASH" # set for faster first sync
26+
27+
# --- Coin daemon RPC (for non-embedded / daemon mode) ------------------------
28+
# dgb_rpc_host: 127.0.0.1
29+
# dgb_rpc_port: # your DGB daemon's RPC port
30+
# dgb_rpc_user: user
31+
# dgb_rpc_password: pass
32+

config/dgb/c2pool_testnet.yaml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# C2Pool DigiByte [DGB] Testnet Configuration
2+
#
3+
# Zero-config startup: run ./start.sh (Linux/macOS) or start.bat (Windows).
4+
# Miners set their payout address as the stratum username (p2pool-style).
5+
# CLI arguments always override values set here.
6+
7+
# --- Network -----------------------------------------------------------------
8+
# port: # DGB testnet sharechain port — binary default applies; set to override
9+
# stratum_port: # Stratum is opt-in for this coin: enable with --stratum [HOST:]PORT
10+
web_port: 8080 # Web dashboard / JSON-RPC API port
11+
http_host: "0.0.0.0" # HTTP bind address
12+
# external_ip: "" # Public IP/domain for stratum URL display
13+
14+
# --- Operating mode ----------------------------------------------------------
15+
# Deployment: DigiByte daemon RPC. Run digibyted and set the dgb_rpc_*
16+
# fields below. See `./c2pool-dgb --help` for algo/mode options.
17+
18+
# --- Bootstrap header checkpoint (optional) ----------------------------------
19+
# Skip old headers on first sync. Format: HEIGHT:BLOCK_HASH
20+
# header_checkpoint: "HEIGHT:BLOCK_HASH" # set for faster first sync
21+
22+
# --- Coin daemon RPC (for non-embedded / daemon mode) ------------------------
23+
# dgb_rpc_host: 127.0.0.1
24+
# dgb_rpc_port: # your DGB daemon's RPC port
25+
# dgb_rpc_user: user
26+
# dgb_rpc_password: pass
27+

config/ltc/c2pool_mainnet.yaml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# C2Pool Litecoin [LTC] Mainnet Configuration
2+
#
3+
# Zero-config startup: run ./start.sh (Linux/macOS) or start.bat (Windows).
4+
# Miners set their payout address as the stratum username (p2pool-style).
5+
# CLI arguments always override values set here.
6+
7+
# --- Network -----------------------------------------------------------------
8+
port: 9326 # p2pool sharechain P2P port (LTC mainnet default)
9+
stratum_port: 9327 # Stratum mining port
10+
web_port: 8080 # Web dashboard / JSON-RPC API port
11+
http_host: "0.0.0.0" # HTTP bind address
12+
# external_ip: "" # Public IP/domain for stratum URL display
13+
#
14+
# Port forwarding (if behind NAT/firewall):
15+
# 9326 TCP — P2P sharechain (REQUIRED for full p2pool participation)
16+
# 9327 TCP — Stratum mining (REQUIRED for miners to connect)
17+
# 9333 TCP — LTC coin P2P (recommended for faster daemon sync)
18+
19+
# --- Operating mode ----------------------------------------------------------
20+
# Default: integrated P2P pool with EMBEDDED LTC + DOGE SPV nodes.
21+
# Zero-config — no litecoind/dogecoind daemon required.
22+
embedded_ltc: true # Embedded LTC SPV (default)
23+
embedded_doge: true # Embedded DOGE SPV for merged mining (default)
24+
25+
# --- Bootstrap header checkpoint (optional) ----------------------------------
26+
# Skip old headers on first sync. Format: HEIGHT:BLOCK_HASH
27+
header_checkpoint: "3088000:4a7fc8d4668c69db4f40fcdeb99ad3dbd85545b742b48e1529ebbec641e547d1"
28+
doge_header_checkpoint: "6160000:51efd04daebddba43ae403662098524d99abf3edad3bddc3ea7b2938c6799939"
29+
30+
# --- Coin daemon RPC (for non-embedded / daemon mode) ------------------------
31+
# ltc_rpc_host: 127.0.0.1
32+
# ltc_rpc_port: # your LTC daemon's RPC port
33+
# ltc_rpc_user: user
34+
# ltc_rpc_password: pass
35+

0 commit comments

Comments
 (0)