Skip to content

Bootnode Hosting

A Backdit Bootstrap node (BACKDIT_NODE_PROFILE=bootstrap, BACKDIT_OFFERED_STORAGE_GB=0) provides Kademlia DHT routing, Identify, AutoNAT reachability probing, and signaling-only libp2p Circuit Relay v2 (256 KiB / 120s per circuit) while refusing all incoming shard and capsule placements. Zero user backup data touches a pure bootnode’s disk, and the embedded Web UI is disabled automatically.

  • Expose P2P port 9010 TCP and UDP publicly (IPv4 and IPv6).
  • Never expose port 9011 (BACKDIT_API_PORT) to the internet. Keep BACKDIT_API_BIND=127.0.0.1 and inspect status via ssh -L 9011:127.0.0.1:9011 user@host.

Tune UDP socket buffers for Quinn QUIC (/etc/sysctl.d/99-backdit-quic.conf):

Terminal window
sudo tee /etc/sysctl.d/99-backdit-quic.conf << 'EOF'
net.core.rmem_max = 2500000
net.core.wmem_max = 2500000
net.core.somaxconn = 4096
net.ipv4.tcp_max_syn_backlog = 4096
net.ipv4.ip_local_port_range = 10240 65535
EOF
sudo sysctl --system

In ip6tables, always apply /64 source masks (--connlimit-mask 64, --hashlimit-srcmask 64) so rotating RFC 8981 SLAAC IPv6 addresses cannot bypass rate limits. Inspect sudo iptables -L INPUT --line-numbers and sudo ip6tables -L INPUT --line-numbers first so your ACCEPT / flood rules sit above any distro default REJECT rule:

Terminal window
sudo apt update && sudo apt install -y ufw curl jq iptables-persistent netfilter-persistent
sudo sed -i 's/^IPV6=.*/IPV6=yes/' /etc/default/ufw
sudo ufw allow 22/tcp comment 'SSH'
sudo ufw allow 9010/tcp comment 'Backdit Bootstrap P2P TCP'
sudo ufw allow 9010/udp comment 'Backdit Bootstrap P2P QUIC'
# IPv4 guards (adjust rule index 5 to match INPUT --line-numbers)
sudo iptables -I INPUT 5 -p tcp --dport 9010 -j ACCEPT
sudo iptables -I INPUT 5 -p udp --dport 9010 -j ACCEPT
sudo iptables -I INPUT 5 -p tcp --dport 9010 -m connlimit --connlimit-above 16 --connlimit-mask 32 -j REJECT --reject-with tcp-reset
sudo iptables -I INPUT 5 -p udp --dport 9010 -m conntrack --ctstate NEW -m hashlimit --hashlimit-above 30/sec --hashlimit-burst 60 --hashlimit-mode srcip --hashlimit-name backdit_boot_quic_new --hashlimit-htable-expire 60000 -j DROP
# IPv6 /64 prefix guards
sudo ip6tables -I INPUT 5 -p tcp --dport 9010 -j ACCEPT
sudo ip6tables -I INPUT 5 -p udp --dport 9010 -j ACCEPT
sudo ip6tables -I INPUT 5 -p tcp --dport 9010 -m connlimit --connlimit-above 16 --connlimit-mask 64 -j REJECT --reject-with tcp-reset
sudo ip6tables -I INPUT 5 -p udp --dport 9010 -m conntrack --ctstate NEW -m hashlimit --hashlimit-above 30/sec --hashlimit-burst 60 --hashlimit-mode srcip --hashlimit-srcmask 64 --hashlimit-name backdit_boot6_quic_new --hashlimit-htable-expire 60000 -j DROP
sudo netfilter-persistent save
sudo ufw --force enable
Terminal window
sudo mkdir -p /opt/backdit/data /opt/backdit/chunks
export BACKDIT_CONFIG_DIR=/opt/backdit/data
export BACKDIT_DATA_DIR=/opt/backdit/data
export BACKDIT_NODE_PROFILE=bootstrap
export BACKDIT_OFFERED_STORAGE_GB=0
sudo -E /opt/backdit/bin/backdit init --non-interactive --accept-recovery-words-risk \
--data-dir /opt/backdit/data \
--chunks-dir /opt/backdit/chunks \
--quota-gb 0 \
--port 9010 \
--print-mnemonic > /opt/backdit/mnemonic.txt
sudo chmod 600 /opt/backdit/mnemonic.txt

Create /etc/systemd/system/backdit-bootstrap.service with BACKDIT_NODE_PROFILE=bootstrap, BACKDIT_OFFERED_STORAGE_GB=0, BACKDIT_ENABLE_UPNP=false, BACKDIT_ENABLE_RELAY_SERVER=true, BACKDIT_EXTERNAL_ADDR=/dns/boot1.example.com/tcp/9010,/dns/boot1.example.com/udp/9010/quic-v1, optional BACKDIT_MONTHLY_TRANSFER_CAP_GIB=180, and ExecStart=/opt/backdit/bin/backdit daemon.

In docker-compose.yml, uncomment:

BACKDIT_NODE_PROFILE: "bootstrap"
BACKDIT_OFFERED_STORAGE_GB: "0"
BACKDIT_EXTERNAL_ADDR: "/dns/boot1.example.com/tcp/9010,/dns/boot1.example.com/udp/9010/quic-v1"
BACKDIT_MONTHLY_TRANSFER_CAP_GIB: "180"

3. Identity Backup, DNS Migration & Monitoring

Section titled “3. Identity Backup, DNS Migration & Monitoring”
  • Back up identity.bundle and config.toml offline immediately after init so migrating to a new VPS keeps the exact same <PeerId>.
  • Publish dual-stack DNS (300s TTL): Point A and AAAA records for boot1.example.com at the VM and advertise /dns/boot1.example.com/tcp/9010/p2p/<PEER_ID> and /dns/boot1.example.com/udp/9010/quic-v1/p2p/<PEER_ID>. Existing nodes bridge brief bootnode restarts via their 64-entry reliable peer cache.
  • Health & Prometheus: GET http://127.0.0.1:9011/healthz returns {"profile":"bootstrap","status":"ok","version":"0.1.0"}; /metrics/prometheus exports backdit_up, backdit_connected_peers, backdit_connections_in, backdit_connections_out, backdit_peer_upload_bytes_total, and backdit_peer_download_bytes_total.
  • Prepaid dual-stack budget VPS hosts: Unmetered or hard-capped bandwidth plans avoid surprise egress charges.
  • Oracle Cloud Always Free (VM.Standard.A1.Flex): Up to 4 ARM64 OCPUs, 24 GB RAM, 200 GB disk, and 10 TB/mo free egress with /56 IPv6. Upgrading to PAYG while staying strictly inside Always Free limits prevents idle reclamation ($1 OCI alert recommended), and you must open 9010 TCP/UDP in both VCN Security Lists and host iptables/ip6tables.
  • Google Cloud (e2-micro Always Free): Requires 30 GB pd-standard, Standard Network Tier (200 GiB/mo free egress), and hard BACKDIT_MONTHLY_TRANSFER_CAP_GIB=180 + GCP budget alerts because GCP does not auto-stop at 200 GiB.