You are setting up a self-sovereign mining stack on this Ubuntu machine for a beginner: a Bitcoin Knots full node (the Bitcoin BLAKE2b chain) plus a DATUM Gateway pointed at the AlphaPool DATUM pool. The user's own node builds the blocks; the pool splits the coinbase and pays the user's address directly inside each block. Non-custodial. No signup. Work step by step. Run the commands yourself, verify each step, and STOP AND ASK if anything is ambiguous or fails. Explain briefly what you are doing as you go. Be idempotent: if a step is already done, verify it and move on instead of redoing it. Never run anything as root except via sudo where shown. Never open RPC to the network. Never modify any Bitcoin wallet or data directory except the ones this guide creates. ================================================================================== FACTS — use exactly, do not "improve" them ================================================================================== Chain: Bitcoin BLAKE2b (Bitcoin Knots 29.4.1 mainnet). Last SHA256d block 961639; first BLAKE2b block 961640. Do NOT set chain=testnet4/regtest. Node software: Bitcoin Knots 29.4.1.knots20260508 (official build) Download base: https://bitcoinknots.org/files/29.x/29.4.1.knots20260508/ x86_64 file: bitcoin-29.4.1.knots20260508-x86_64-linux-gnu.tar.gz aarch64 file: bitcoin-29.4.1.knots20260508-aarch64-linux-gnu.tar.gz checksums: SHA256SUMS (same folder) — verification is MANDATORY Gateway software: CONVOY DATUM Gateway (BLAKE2b + header-v2 build) repo: https://github.com/CONVOYMining/datum_gateway.git PINNED COMMIT: b9ea7dc3eb91352565ab487ec55ed6ee5964a440 Build exactly this commit. Do NOT build whatever master happens to be: upstream changes the pool protocol without notice, and a newer build can refuse to talk to the pool (it exits with "Bad configuration version"). required: history MUST contain commit 56c31f4 (older builds produce invalid shares) AlphaPool DATUM: host us2.alphapool.tech port 28916 pool pubkey: b831b2d6f1eaedb3da5b9e3702728edea0a32d6ce783a1452b2861c4d1b74d6b4c2ad5461bcf43485a6bac2cedf8da43d51164262ef6bcdb27f2242ada066d29 fee: 1.00% pool ops, flat 8×D window split, paid in-block to the miner's address Ports: node P2P 8333 (optional inbound), node RPC 8332 (localhost ONLY), gateway stratum 23334 (LAN), gateway UI/API 7152 (localhost ONLY) Disk/time: ~20 GB free (node is pruned). First sync downloads the chain's history: plan on 1–3 days depending on connection/CPU. Mining starts automatically once the node is synced — the gateway simply waits. ================================================================================== STEP 0 — Ask the user (do not proceed with placeholders) ================================================================================== Ask for ONE thing: the payout address the coinbase should pay. - Recommended: a native-SegWit address starting with bc1q from a wallet dedicated to THIS chain (the fork's Knots bitcoin-qt wallet, Shrike, or Sparrow-BLAKE2b). Legacy 1... and 3... addresses are also valid. NEVER use a seed/wallet that also holds real Bitcoin. - If the user has no address, offer to create one in a fresh wallet on the node they are about to run (Step 5 describes how). Only do this if they explicitly say yes. Optionally ask for a short coinbase tag (their name/handle, max ~20 chars). Default: AlphaPool. Confirm they know: this machine should stay on and connected; first sync takes 1–3 days. ================================================================================== STEP 1 — Prerequisites ================================================================================== sudo apt update sudo apt install -y git build-essential cmake pkgconf libcurl4-openssl-dev libjansson-dev \ libsodium-dev libmicrohttpd-dev psmisc curl jq Confirm: 64-bit Ubuntu (uname -m prints x86_64 or aarch64), >= 20 GB free (df -h ~), RAM (free -g). Record the login username (whoami) — call it $U below. ================================================================================== STEP 2 — Install Bitcoin Knots 29.4.1 (verify checksums — mandatory) ================================================================================== mkdir -p ~/knots-dl && cd ~/knots-dl ARCH=$(uname -m) # x86_64 or aarch64 F="bitcoin-29.4.1.knots20260508-${ARCH}-linux-gnu.tar.gz" curl -fLO "https://bitcoinknots.org/files/29.x/29.4.1.knots20260508/${F}" curl -fLO "https://bitcoinknots.org/files/29.x/29.4.1.knots20260508/SHA256SUMS" sha256sum --ignore-missing --check SHA256SUMS # MUST print ": OK". If not: STOP. tar -xzf "$F" sudo install -m 0755 bitcoin-*/bin/bitcoind bitcoin-*/bin/bitcoin-cli /usr/local/bin/ bitcoind --version | head -1 # expect "Bitcoin Knots version v29.4.1.knots20260508" ================================================================================== STEP 3 — Configure the node (pruned mainnet, RPC on localhost) ================================================================================== mkdir -p ~/.bitcoin && chmod 700 ~/.bitcoin If ~/.bitcoin/bitcoin.conf already exists, STOP and show it to the user before changing it. Generate credentials: RPCUSER=datum ; RPCPASS=$(openssl rand -hex 24) Pick dbcache: 2048 if RAM >= 8 GB, else 1024. Write ~/.bitcoin/bitcoin.conf (mode 600) with exactly: server=1 daemon=0 rpcbind=127.0.0.1 rpcallowip=127.0.0.1 rpcuser= rpcpassword= prune=4000 dbcache=<2048 or 1024> blockmaxweight=785000 blocknotify=curl -fsS -o /dev/null http://127.0.0.1:7152/NOTIFY # Optional: forward TCP 8333 on the router to this machine so other nodes can reach you. Create /etc/systemd/system/knots-node.service (via sudo tee): [Unit] Description=Bitcoin Knots node (BLAKE2b chain) After=network-online.target Wants=network-online.target [Service] Type=simple User=$U ExecStart=/usr/local/bin/bitcoind -conf=/home/$U/.bitcoin/bitcoin.conf -datadir=/home/$U/.bitcoin Restart=on-failure RestartSec=15 TimeoutStopSec=900 KillSignal=SIGTERM [Install] WantedBy=multi-user.target sudo systemctl daemon-reload && sudo systemctl enable --now knots-node Wait ~30 s, then: bitcoin-cli getblockchaininfo | jq '{chain,blocks,headers,verificationprogress,pruned}' Expect chain "main", pruned true, and blocks/headers climbing. (verificationprogress reaches ~1.0 only when fully synced — that is the 1–3 day part. Continue with the remaining steps now.) ================================================================================== STEP 4 — Validate the payout address with the node (protects against stranded coins) ================================================================================== bitcoin-cli validateaddress "" | jq '{isvalid,address,iswitness}' "isvalid" MUST be true. If false: STOP and ask the user for a correct address. Coins mined to an invalid address cannot be paid out. ================================================================================== STEP 5 — (ONLY if the user asked) create a fresh payout wallet on this node ================================================================================== bitcoin-cli -named createwallet wallet_name="alphapool-payout" descriptors=true bitcoin-cli -rpcwallet=alphapool-payout getnewaddress "" bech32 # this is the payout address bitcoin-cli -rpcwallet=alphapool-payout backupwallet "/home/$U/alphapool-payout-BACKUP.dat" Tell the user in bold: copy /home/$U/alphapool-payout-BACKUP.dat to a safe place offline NOW. If this file and ~/.bitcoin/wallets/alphapool-payout are lost, the coins are lost. Then run Step 4 on the new address. ================================================================================== STEP 6 — Build the CONVOY DATUM Gateway (BLAKE2b build) ================================================================================== cd ~ && ( [ -d datum_gateway ] || git clone https://github.com/CONVOYMining/datum_gateway.git ) cd ~/datum_gateway && git fetch origin && git checkout b9ea7dc3eb91352565ab487ec55ed6ee5964a440 # Pinned deliberately. Do NOT run "git pull" here. git merge-base --is-ancestor 56c31f4 HEAD && echo "COMMIT CHECK OK" || echo "COMMIT CHECK FAILED" If it prints FAILED: STOP. Do not mine with this build. cmake . && make -j"$(nproc)" ls -l ~/datum_gateway/datum_gateway # the built binary must exist ================================================================================== STEP 7 — Gateway config (pool mode → AlphaPool) ================================================================================== APIPASS=$(openssl rand -hex 16) Write ~/datum_gateway/datum_gateway_config.json (mode 600) with exactly this, filling the <...> values (RPC creds from Step 3, payout address from Step 4, tag from Step 0): { "bitcoind": { "rpcuser": "", "rpcpassword": "", "rpcurl": "http://127.0.0.1:8332" }, "stratum": { "listen_addr": "0.0.0.0", "listen_port": 23334, "vardiff_min": 4096, "vardiff_target_shares_min": 8 }, "api": { "listen_addr": "127.0.0.1", "listen_port": 7152, "admin_password": "", "modify_conf": true }, "mining": { "pool_address": "", "coinbase_tag_primary": "AlphaPool", "coinbase_tag_secondary": "", "allow_hasher_time_rolling": false }, "datum": { "pool_host": "us2.alphapool.tech", "pool_port": 28916, "pool_pubkey": "b831b2d6f1eaedb3da5b9e3702728edea0a32d6ce783a1452b2861c4d1b74d6b4c2ad5461bcf43485a6bac2cedf8da43d51164262ef6bcdb27f2242ada066d29", "pool_pass_workers": true, "pool_pass_full_users": true, "pooled_mining_only": true } } Validate JSON: jq . ~/datum_gateway/datum_gateway_config.json >/dev/null && echo JSON OK ================================================================================== STEP 8 — Run the gateway as a service (it waits for the node to finish syncing) ================================================================================== Create /etc/systemd/system/datum-gateway.service (via sudo tee): [Unit] Description=DATUM Gateway → AlphaPool After=knots-node.service network-online.target Wants=knots-node.service [Service] Type=simple User=$U WorkingDirectory=/home/$U/datum_gateway ExecStart=/home/$U/datum_gateway/datum_gateway -c /home/$U/datum_gateway/datum_gateway_config.json Restart=always RestartSec=10 [Install] WantedBy=multi-user.target sudo systemctl daemon-reload && sudo systemctl enable --now datum-gateway systemctl status datum-gateway --no-pager | head -12 NOTE: until the node is fully synced the gateway will log that templates are unavailable and retry — that is expected. Do not "fix" it. ================================================================================== STEP 9 — Let miners on the LAN reach the gateway ================================================================================== LANIP=$(ip -4 route get 1.1.1.1 | awk '{print $7; exit}') If ufw is active (sudo ufw status): sudo ufw allow 23334/tcp The miners will use: stratum+tcp://$LANIP:23334 ================================================================================== STEP 10 — Verify (run all, report results) ================================================================================== systemctl is-active knots-node datum-gateway # both "active" bitcoin-cli getblockchaininfo | jq '{blocks,headers,verificationprogress}' bitcoin-cli getdeploymentinfo | jq '.deployments.blake2b' # active:true once synced past 961640 journalctl -u datum-gateway -n 15 --no-pager curl -s -o /dev/null -w "gateway UI http %{http_code}\n" http://127.0.0.1:7152/ Once synced, also: bitcoin-cli getblocktemplate '{"rules":["segwit","blake2b"]}' | jq -r '.rules[]' → must include "!blake2b". ================================================================================== FINAL REPORT — print this for the user, filled in ================================================================================== ✅ Node: Bitcoin Knots 29.4.1 running as service knots-node (pruned). Sync: % — mining starts automatically when this reaches 100% (est. 1–3 days). Check anytime: bitcoin-cli getblockchaininfo | jq .verificationprogress ✅ Gateway: datum-gateway service running, pointed at us2.alphapool.tech:28916 (AlphaPool DATUM). ✅ Payout address (validated by your node): ➡️ Point every BLAKE2b miner (Antminer A3, Innosilicon S11, Obelisk SC1, iBeLink, …) at: URL: stratum+tcp://:23334 Worker: (or .rigname) Password: x 📊 Your stats: https://knots.alphapool.tech/tides/miner (enter the payout address) 🔧 Gateway UI (this machine only): http://127.0.0.1:7152 (admin password saved in the config) 🔒 RPC stays on localhost. Keep this machine on. Back up any wallet you created.