git / moonbite-network / deploy/README.md · raw
# BigCoin Seed-Node Deployment KitThis is what turns "BigCoin runs on my machine" into "a public network anyone on theinternet can join." A **seed node** is a permanently-online full node with a stablepublic IP that new nodes contact first to discover the rest of the peer network.You need **at least 2–3 seed nodes on separate VPS hosts** (different providers/regionsis best) before a credible mainnet launch.## Files| File | Purpose ||------|---------|| `setup-seednode.sh` | One-shot provisioner for a fresh Ubuntu 22.04 VPS || `bigcoind.service` | systemd unit (auto-start, restart-on-failure, hardened) || `bigcoin.conf` | Seed-node config (public P2P, private RPC) |## Quick deploy (per VPS)```bash# 1. Copy the release binaries + this deploy/ folder to the VPS, then:sudo bash setup-seednode.sh ./bigcoind ./bigcoin-cli# 2. Confirm it's running and reachablesystemctl status bigcoindbigcoin-cli -conf=/etc/bigcoin/bigcoin.conf getnetworkinfo```The script installs binaries to `/usr/local/bin`, creates an unprivileged `bigcoin`system user, generates **random RPC credentials**, installs the systemd service,and opens **only** the P2P port (9444) in the firewall — RPC stays on localhost.## Wiring the seeds together1. Deploy the script on each VPS. Note each host's **public IP**.2. On every node, uncomment the `addnode=` lines in `/etc/bigcoin/bigcoin.conf` and fill in the *other* seeds' IPs, then `systemctl restart bigcoind`.3. Verify mesh connectivity: ```bash bigcoin-cli -conf=/etc/bigcoin/bigcoin.conf getpeerinfo | grep addr ```## Baking seeds into the client (before public release)So that *end users* auto-discover the network without manual `addnode`, add your seedIPs to `src/chainparams.cpp` in `CMainParams`:- `vSeeds.emplace_back("seed1.bigcoin.org");` (if you run a DNS seeder), and/or- hard-coded IPs via `vFixedSeeds` (see `contrib/seeds/` upstream tooling).Then rebuild and re-release binaries.## Linux binaries must carry RUNPATH=/opt/moonbite/libThe seeds run Ubuntu 24.04 but the node is built natively on 22.04; the 22.04runtime libs (boost 1.74, libevent, db5.3, zmq, fmt8) live on each seed in`/opt/moonbite/lib` (shipped once by `ship_libs.sh`). Build with ./configure ... LDFLAGS="-Wl,-rpath,/opt/moonbite/lib"and check `readelf -d moonbited | grep -i runpath` before staging. A binary builtwithout it fails with `libboost_filesystem.so.1.74.0: not found` and needs`patchelf --set-rpath /opt/moonbite/lib` on-host (`deploy-droplet-node.sh` keepsthat fallback as a safety net; `publish-node-binaries.sh` now warns when theRUNPATH is missing). Full note: moonbite-core `doc/linux-runpath.md`.## Security notes- **Never expose RPC (9445) to the internet.** The config binds it to 127.0.0.1 only.- Prefer `rpcauth=` (hashed) over a plaintext `rpcpassword=` — generate with `share/rpcauth/rpcauth.py` from the source tree.- Keep the OS patched; the systemd unit already applies `NoNewPrivileges`, `ProtectSystem`, `ProtectHome`, and `PrivateTmp`.- Seed nodes hold **no wallet** — they route blocks/transactions only, so a compromise cannot steal coins, but keep them patched to protect the network.## Cost realityA small VPS (1–2 GB RAM) per seed is enough at launch (~$5–10/mo each). Budget for3 seeds + 1 explorer host. This is infrastructure you must keep running indefinitely —if all seeds go down, new users can't find the network.