diff --git a/public/scripts/vps-installation/README.md b/public/scripts/vps-installation/README.md new file mode 100644 index 00000000..28ca4482 --- /dev/null +++ b/public/scripts/vps-installation/README.md @@ -0,0 +1,158 @@ +# 🚀 Beam Subnet-EVM Node Setup + +This guide walks you through setting up an AvalancheGo node and configuring it to track the **Beam L1 Subnet** using Beam's **Subnet-EVM**. + +Tested on: **Ubuntu 22.04 / 24.04 LTS** + +--- + +## 📁 Contents + +- [1. Overview](#1-overview) +- [2. Prerequisites](#2-prerequisites) +- [3. Installation](#3-step-by-step-installation) + - [3.1 Configure the Node](#31-configure-the-node) + - [3.2 Apply Beam Network Upgrades](#32-apply-beam-network-upgrades) + - [3.3 Restart Node and Verify](#33-restart-node-and-verify) +- [4. Node Monitoring](#4-node-monitoring) +- [5. Notes](#5-notes) + +--- + +## 1. Overview + +This repo provides two automated Bash scripts to: + +1. Install the [AvalancheGo](https://github.com/ava-labs/avalanchego) validator node. +2. Configure the node to track the [Beam Subnet](https://buildonbeam.com/) and apply its upgrade rules. + +--- + +## 2. Prerequisites + +- A clean Ubuntu 22.04 or 24.04 server (cloud or on-prem) +- Root or sudo access +- An open port (default `9651`) and optionally exposing it publicly + +--- + +## 3. Installation + +--- + +Run the following script to install AvalancheGo: + +```bash +bash vps-setup-beam-validator.sh +``` + +This script will: + +- Update system +- Install required packages: `wget`, `tar`, `jq` +- Prompt you to choose connection type, public IP, and RPC exposure +- Allow you to enable **State Sync** for faster sync times +- Install AvalancheGo as a systemd service +- Download and install Subnet-EVM v0.7.3 +- Place it into the AvalancheGo plugin directory with the proper VMID +- Print success confirmation and paths +- Show your NodeID at the end + +Example prompts: +- IP auto-detection and override +- Private vs. public RPC +- State sync: enabled or full archive + +After install, the node will be running in the background. + +--- + +## 3.1 Configure the Node + +The script will also update your AvalancheGo config at: + +```bash +~/.avalanchego/configs/node.json +``` + +It adds: + +```json +{ + "track-subnets": "eYwmVU67LmSfZb1RwqCMhBYkFyG8ftxn6jAwqzFmxC9STBWLC", + "partial-sync-primary-network": true +} +``` + +This ensures your node tracks only the Beam subnet and performs a partial sync to save resources. + +--- + +## 3.2 Apply Beam Network Upgrades + +The script will create the following chain config directory: + +```bash +~/.avalanchego/configs/chains/2tmrrBo1Lgt1mzzvPSFt73kkQKFas5d1AP88tv9cicwoFp8BSn/ +``` + +And download the Beam subnet upgrade file: + +```bash +upgrade.json +``` + +This contains necessary configuration rules for proper syncing and upgrades. + +--- + +## 3.3 Restart Node and Verify + +The script will restart the AvalancheGo node and display its status: + +```bash +sudo systemctl restart avalanchego +sudo systemctl status avalanchego +``` + +It will also extract your **NodeID** from the logs: + +```bash +🔎 Your NodeID is: NodeID-XXXX... +``` + +This ID is essential for staking and network registration. + +--- + +## 4. Node Monitoring + +Follow logs in real time: + +```bash +sudo journalctl -u avalanchego -f +``` + +Or just to check status: + +```bash +sudo systemctl status avalanchego +``` + +--- + +## 5. Notes + +- Always use the latest [Subnet-EVM release](https://github.com/ava-labs/subnet-evm/releases) compatible with Beam. +- VMID and BlockchainID are predefined and specific to Beam: + - **VMID**: `kLPs8zGsTVZ28DhP1VefPCFbCgS7o5bDNez8JUxPVw9E6Ubbz` + - **BlockchainID**: `2tmrrBo1Lgt1mzzvPSFt73kkQKFas5d1AP88tv9cicwoFp8BSn` +- If you modify the config path or structure, make sure to update the scripts accordingly. + +--- + +## ✅ Done! + +You're now ready to operate a Beam L1 node and contribute to its decentralized infrastructure. + +Happy validating 🚀 diff --git a/public/scripts/vps-installation/vps-setup-beam-validator.sh b/public/scripts/vps-installation/vps-setup-beam-validator.sh new file mode 100644 index 00000000..5e2aa687 --- /dev/null +++ b/public/scripts/vps-installation/vps-setup-beam-validator.sh @@ -0,0 +1,192 @@ +#!/bin/bash + +# --------------------------------------- +# Beam Validator Node Installer Script +# Ubuntu 22.04 / 24.04 LTS +# --------------------------------------- +# Downloads and runs the official AvalancheGo installer +# Includes prompts for network, IP, RPC settings, state sync +# Ends with clear post-install steps and service info +# Installs Beam's Subnet-EVM binary for AvalancheGo +# Configures node to track the Beam subnet +# Applies upgrade rules and restarts AvalancheGo +# Displays the NodeID for staking and monitoring +# --------------------------------------- + +set -e # Exit on any error + +# Update system packages +echo "🔄 Updating system packages..." +sudo apt update -y && sudo apt upgrade -y + +# Install prerequisites +echo "🔧 Installing required packages..." +sudo apt install -y wget tar jq + +# Download AvalancheGo installer +echo "⬇️ Downloading AvalancheGo installer..." +wget -nd -m https://raw.githubusercontent.com/ava-labs/avalanche-docs/master/scripts/avalanchego-installer.sh + +# Set execute permissions +echo "🔐 Setting executable permissions..." +chmod 755 avalanchego-installer.sh + +# Display pre-install instructions +cat < temp_node.json && mv temp_node.json "$NODE_CONFIG" +else + cat < "$NODE_CONFIG" +{ + "track-subnets": "eYwmVU67LmSfZb1RwqCMhBYkFyG8ftxn6jAwqzFmxC9STBWLC", + "partial-sync-primary-network": true +} +EOF +fi + +echo "✅ Node config updated: $NODE_CONFIG" + +# Step 3: Apply network upgrades +echo "" +echo "🔧 Applying Beam subnet upgrade rules..." + +CHAIN_CONFIG_DIR="$HOME/.avalanchego/configs/chains/$BLOCKCHAIN_ID" +mkdir -p "$CHAIN_CONFIG_DIR" +cd "$CHAIN_CONFIG_DIR" + +wget -O upgrade.json "$UPGRADE_URL" + +if [[ -f "upgrade.json" ]]; then + echo "✅ upgrade.json downloaded successfully." +else + echo "❌ Failed to download upgrade.json" + exit 1 +fi + +cd ~ + +# Step 4: Restart AvalancheGo to apply all changes +echo "" +echo "🔄 Restarting AvalancheGo node service..." +sudo systemctl restart avalanchego +sleep 3 +sudo systemctl status avalanchego --no-pager + +# Step 5: Extract and display NodeID +echo "" +echo "🔎 Extracting NodeID from logs..." + +NODE_ID=$(sudo journalctl -u avalanchego | grep -oP '"nodeID":\s*"(NodeID-[a-zA-Z0-9]+)"' | tail -n1 | grep -oP 'NodeID-[a-zA-Z0-9]+') + +if [[ -n "$NODE_ID" ]]; then + echo "" + echo "✅ Your NodeID is:" + echo "" + echo " 🆔 $NODE_ID" + echo "" + echo "💡 Save this NodeID — it's required for staking and node monitoring." +else + echo "⚠️ Could not extract NodeID from logs. Try manually with:" + echo " sudo journalctl -u avalanchego | grep 'nodeID'" +fi + +# Wrap-up message +cat <