From 3e52b0df34c67fdc91bce1b251e85b8e0a3adc59 Mon Sep 17 00:00:00 2001 From: 0xKaliku <0xKaliku@gmail.com> Date: Thu, 24 Apr 2025 16:27:17 +0800 Subject: [PATCH 1/3] OB-1885: Create install script for VPS Beam Validator Setup --- public/scripts/1-install_avalanchego.sh | 96 +++++++++++++ public/scripts/2-install_beam_network.sh | 120 ++++++++++++++++ public/scripts/README.md | 174 +++++++++++++++++++++++ 3 files changed, 390 insertions(+) create mode 100644 public/scripts/1-install_avalanchego.sh create mode 100644 public/scripts/2-install_beam_network.sh create mode 100644 public/scripts/README.md diff --git a/public/scripts/1-install_avalanchego.sh b/public/scripts/1-install_avalanchego.sh new file mode 100644 index 00000000..8c502d32 --- /dev/null +++ b/public/scripts/1-install_avalanchego.sh @@ -0,0 +1,96 @@ +#!/bin/bash + +# --------------------------------------- +# AvalancheGo Automated 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 +# --------------------------------------- + +set -e # Exit on any error + +# Update system packages +echo "🔄 Updating system packages..." +sudo apt update -y && sudo apt upgrade -y + +# 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 < Date: Thu, 24 Apr 2025 16:28:38 +0800 Subject: [PATCH 2/3] OB-1885: Create install script for VPS Beam Validator Setup --- public/scripts/{ => vpc-installation}/1-install_avalanchego.sh | 0 public/scripts/{ => vpc-installation}/2-install_beam_network.sh | 0 public/scripts/{ => vpc-installation}/README.md | 0 3 files changed, 0 insertions(+), 0 deletions(-) rename public/scripts/{ => vpc-installation}/1-install_avalanchego.sh (100%) rename public/scripts/{ => vpc-installation}/2-install_beam_network.sh (100%) rename public/scripts/{ => vpc-installation}/README.md (100%) diff --git a/public/scripts/1-install_avalanchego.sh b/public/scripts/vpc-installation/1-install_avalanchego.sh similarity index 100% rename from public/scripts/1-install_avalanchego.sh rename to public/scripts/vpc-installation/1-install_avalanchego.sh diff --git a/public/scripts/2-install_beam_network.sh b/public/scripts/vpc-installation/2-install_beam_network.sh similarity index 100% rename from public/scripts/2-install_beam_network.sh rename to public/scripts/vpc-installation/2-install_beam_network.sh diff --git a/public/scripts/README.md b/public/scripts/vpc-installation/README.md similarity index 100% rename from public/scripts/README.md rename to public/scripts/vpc-installation/README.md From 61851e8d26e195032883f44b3048fc387f3c49d6 Mon Sep 17 00:00:00 2001 From: 0xKaliku <0xKaliku@gmail.com> Date: Thu, 24 Apr 2025 19:19:50 +0800 Subject: [PATCH 3/3] OB-1885: Create install script for VPS Beam Validator Setup --- .../vpc-installation/1-install_avalanchego.sh | 96 ------------------- .../README.md | 44 +++------ .../vps-setup-beam-validator.sh} | 88 +++++++++++++++-- 3 files changed, 94 insertions(+), 134 deletions(-) delete mode 100644 public/scripts/vpc-installation/1-install_avalanchego.sh rename public/scripts/{vpc-installation => vps-installation}/README.md (82%) rename public/scripts/{vpc-installation/2-install_beam_network.sh => vps-installation/vps-setup-beam-validator.sh} (57%) diff --git a/public/scripts/vpc-installation/1-install_avalanchego.sh b/public/scripts/vpc-installation/1-install_avalanchego.sh deleted file mode 100644 index 8c502d32..00000000 --- a/public/scripts/vpc-installation/1-install_avalanchego.sh +++ /dev/null @@ -1,96 +0,0 @@ -#!/bin/bash - -# --------------------------------------- -# AvalancheGo Automated 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 -# --------------------------------------- - -set -e # Exit on any error - -# Update system packages -echo "🔄 Updating system packages..." -sudo apt update -y && sudo apt upgrade -y - -# 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 <