# Running a BigCoin Full Node / Seed Node A full node validates and relays the BigCoin blockchain. Running one strengthens the network, gives you a trustless view of the chain, and is required to operate a seed node, block explorer, pool, or exchange integration. ## Network ports | Purpose | Mainnet | Testnet | |---------------------|---------|---------| | P2P (peer traffic) | 9444 | 19555 | | RPC (control/API) | 9445 | (typically 19445) | - **P2P port 9444** must be reachable from the internet for a node to accept incoming peers and to act as a seed. - **RPC port 9445** should be kept **private** (localhost or trusted hosts only). Never expose RPC to the public internet. --- ## Sample `bigcoin.conf` Place this in the data directory: - Linux: `~/.bigcoin/bigcoin.conf` - macOS: `~/Library/Application Support/BigCoin/bigcoin.conf` - Windows: `%APPDATA%\BigCoin\bigcoin.conf` ```ini # ---- RPC / server ---- server=1 rpcuser=bigrpc rpcpassword=CHANGE_ME_to_a_long_random_string # Only allow RPC from localhost (adjust CIDR carefully if remote access needed): rpcbind=127.0.0.1 rpcallowip=127.0.0.1 rpcport=9445 # ---- P2P / networking ---- listen=1 port=9444 maxconnections=125 # ---- node behavior ---- txindex=1 # required for explorers / full tx lookups dbcache=512 # MB of DB cache; raise for faster sync if you have RAM # ---- peers to connect to at startup ---- addnode=67.205.154.64:9444 ``` > **Security:** Use a long, random `rpcpassword`. Prefer `rpcauth` (hashed > credentials generated by the `rpcauth.py` helper) over a plaintext > `rpcpassword` in shared environments. Do **not** set `rpcallowip=0.0.0.0/0`. Test it: ```bash bigcoind -daemon bigcoin-cli getblockchaininfo bigcoin-cli getpeerinfo bigcoin-cli getnetworkinfo ``` --- ## Firewall and port forwarding (P2P 9444) To accept inbound peers you must allow **TCP 9444** in. ### Linux (ufw) ```bash sudo ufw allow 9444/tcp comment "BigCoin P2P" # DO NOT open 9445 (RPC) to the internet ``` ### Linux (firewalld) ```bash sudo firewall-cmd --permanent --add-port=9444/tcp sudo firewall-cmd --reload ``` ### Home router / NAT Forward external TCP **9444 -> internal-node-IP:9444**. Give the node a static LAN IP or a DHCP reservation so the forward stays valid. Verify reachability from outside your network (e.g. an online port checker, or from another host): ```bash nc -vz your.public.ip 9444 ``` For testnet, substitute **19555** everywhere you see 9444. --- ## Running as a systemd service (Linux) Create a dedicated user and directories, then a unit file. ```bash sudo useradd -r -m -d /var/lib/bigcoind bigcoin sudo mkdir -p /etc/bigcoin sudo cp bigcoin.conf /etc/bigcoin/bigcoin.conf sudo chown -R bigcoin:bigcoin /var/lib/bigcoind /etc/bigcoin ``` `/etc/systemd/system/bigcoind.service`: ```ini [Unit] Description=BigCoin daemon After=network-online.target Wants=network-online.target [Service] User=bigcoin Group=bigcoin Type=simple ExecStart=/usr/local/bin/bigcoind \ -conf=/etc/bigcoin/bigcoin.conf \ -datadir=/var/lib/bigcoind \ -pid=/run/bigcoind/bigcoind.pid ExecStop=/usr/local/bin/bigcoin-cli -conf=/etc/bigcoin/bigcoin.conf stop Restart=on-failure TimeoutStopSec=120 RuntimeDirectory=bigcoind # hardening NoNewPrivileges=true PrivateTmp=true ProtectSystem=full ProtectHome=true [Install] WantedBy=multi-user.target ``` Enable and start: ```bash sudo systemctl daemon-reload sudo systemctl enable --now bigcoind sudo systemctl status bigcoind journalctl -u bigcoind -f ``` > Note: run `bigcoind` **without** `-daemon` under systemd (`Type=simple`), so > systemd manages the process directly. --- ## Adding DNS seeds and addnode peers Nodes discover each other through: 1. **DNS seeds** — hostnames that resolve to lists of active node IPs. These are compiled into the client's chain parameters. For a new coin you (the maintainers) run a `dnsseed`-style server or use a static host and publish its name. Once compiled in, clients query it automatically. 2. **`addnode` entries** — explicit peers, added in `bigcoin.conf` or at runtime: ```bash # add a peer at runtime bigcoin-cli addnode "203.0.113.10:9444" add # force a one-time connection attempt bigcoin-cli addnode "198.51.100.20:9444" onetry # inspect current peers bigcoin-cli getpeerinfo | grep addr ``` - Use `addnode` for peers you always want to try. - Use `connect=` (instead of `addnode=`) only if you want to connect **exclusively** to specific peers (disables automatic peer discovery — usually not what you want for a public node). --- ## Bootstrapping a small network for launch For a brand-new coin there are no peers yet. Bring up an initial mesh: 1. **Stand up 2-5 stable seed nodes** on hosts with static public IPs (VPS is ideal). Give each `listen=1`, `port=9444`, and open the firewall. 2. **Cross-connect them** so they form a mesh. In each node's config: ```ini addnode=:9444 addnode=:9444 addnode=:9444 ``` 3. **Publish DNS seed hostnames** (e.g. `seed1.bigcoin.example.com`) pointing at those IPs, and ship them in the client's chain params / default `addnode` list so new users auto-connect. 4. **Mine the early blocks** on at least one node (see [MINING.md](MINING.md)) so the chain grows and new nodes have something to sync. 5. **Monitor connectivity** with `getpeerinfo`, `getnetworkinfo`, and `getconnectioncount`. Aim for each seed to have multiple inbound + outbound peers. 6. **Document the seed list publicly** (GitHub, website) so operators and exchanges can add reliable `addnode` entries. Keep at least a couple of seed nodes running 24/7 during launch — if they all go down before the network has organic peers, new nodes cannot bootstrap.