mirror of
https://github.com/pezkuwichain/pezkuwi-validator-v1.0.0.git
synced 2026-06-12 20:11:04 +00:00
feat: Upgrade to validator v2.0.0 with beta testnet real keys
Major upgrade from v1.0.0 to v2.0.0 with complete restructure: Features: - One-command validator setup (setup.sh) - Automated dependency checking (Git, Rust, Node.js, build tools, Nginx) - Shared Pezkuwi-SDK build (single build for all validators) - Single DKSweb frontend with auto-update from GitHub - 8 beta testnet validators (corrected from 10) - Real validator keys from currently running beta testnet - Helper scripts (start.sh, stop.sh, status.sh, logs.sh) - Systemd service management - Nginx-based frontend deployment - Comprehensive README with usage instructions Structure: - validators/validator1-8/ - Individual validator configurations - Each validator has real keys (BABE, GRANDPA, PARA, ASGN, AUDI, BEEF) - Port allocation: RPC 9944-9951, P2P 30333-30340 - Validator 1 acts as bootnode Breaking Changes: - Removed docker support - Removed old installation scripts (linux/windows) - Removed LICENSE file - Complete restructure of directory layout 🤖 Generated with Claude Code Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -1,200 +0,0 @@
|
||||
|
||||
#!/bin/bash
|
||||
# Pezkuwi Validator One-Line Installer
|
||||
# Usage: curl -sSf https://raw.githubusercontent.com/pezkuwichain/pezkuwi-validator-v1.0.0/main/scripts/linux/install-validator.sh | bas
|
||||
set -e
|
||||
|
||||
echo "🚀 Pezkuwi Validator Installer v1.0.0"
|
||||
echo "======================================"
|
||||
echo ""
|
||||
|
||||
# Colors
|
||||
RED='\033[0;31m'
|
||||
GREEN='\033[0;32m'
|
||||
YELLOW='\033[1;33m'
|
||||
NC='\033[0m'
|
||||
|
||||
# Configuration
|
||||
PEZKUWI_VERSION="v1.0.0-local-testnet-success"
|
||||
GITHUB_REPO="pezkuwichain/pezkuwi-sdk"
|
||||
INSTALL_DIR="$HOME/.pezkuwi"
|
||||
CHAIN_SPEC_URL="https://raw.githubusercontent.com/${GITHUB_REPO}/main/pezkuwi-local-raw.json"
|
||||
|
||||
# Functions
|
||||
print_success() {
|
||||
echo -e "${GREEN}✓${NC} $1"
|
||||
}
|
||||
|
||||
print_error() {
|
||||
echo -e "${RED}✗${NC} $1"
|
||||
}
|
||||
|
||||
print_info() {
|
||||
echo -e "${YELLOW}ℹ${NC} $1"
|
||||
}
|
||||
|
||||
check_requirements() {
|
||||
print_info "Checking system requirements..."
|
||||
|
||||
if [[ "$OSTYPE" != "linux-gnu"* ]]; then
|
||||
print_error "This script only supports Linux"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
CPU_CORES=$(nproc)
|
||||
if [ "$CPU_CORES" -lt 2 ]; then
|
||||
print_error "Minimum 2 CPU cores required (found: $CPU_CORES)"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
TOTAL_RAM=$(free -g | awk '/^Mem:/{print $2}')
|
||||
if [ "$TOTAL_RAM" -lt 4 ]; then
|
||||
print_error "Minimum 4GB RAM required (found: ${TOTAL_RAM}GB)"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
print_success "System requirements met"
|
||||
}
|
||||
|
||||
install_dependencies() {
|
||||
print_info "Installing dependencies..."
|
||||
|
||||
if command -v apt-get &> /dev/null; then
|
||||
sudo apt-get update -qq
|
||||
sudo apt-get install -y curl wget tar
|
||||
elif command -v yum &> /dev/null; then
|
||||
sudo yum install -y curl wget tar
|
||||
else
|
||||
print_error "Unsupported package manager"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
print_success "Dependencies installed"
|
||||
}
|
||||
|
||||
download_binaries() {
|
||||
print_info "Downloading Pezkuwi binaries..."
|
||||
|
||||
mkdir -p "$INSTALL_DIR/bin"
|
||||
|
||||
RELEASE_URL="https://github.com/${GITHUB_REPO}/releases/download/${PEZKUWI_VERSION}"
|
||||
ARCHIVE_NAME="pezkuwi-binaries-linux-x86_64.tar.gz"
|
||||
|
||||
# Download tar.gz archive
|
||||
wget -q --show-progress -O "/tmp/${ARCHIVE_NAME}" "${RELEASE_URL}/${ARCHIVE_NAME}" || {
|
||||
print_error "Failed to download binaries"
|
||||
print_info "Please check if release exists: ${RELEASE_URL}"
|
||||
exit 1
|
||||
}
|
||||
# Extract binaries
|
||||
tar -xzf "/tmp/${ARCHIVE_NAME}" -C "$INSTALL_DIR/bin/"
|
||||
rm "/tmp/${ARCHIVE_NAME}"
|
||||
chmod +x "$INSTALL_DIR/bin/pezkuwi"
|
||||
print_success "Binaries downloaded"
|
||||
}
|
||||
|
||||
download_chain_spec() {
|
||||
print_info "Downloading chain specification..."
|
||||
|
||||
mkdir -p "$INSTALL_DIR/config"
|
||||
wget -q -O "$INSTALL_DIR/config/chain-spec.json" "$CHAIN_SPEC_URL" || {
|
||||
print_error "Failed to download chain spec"
|
||||
exit 1
|
||||
}
|
||||
|
||||
print_success "Chain spec downloaded"
|
||||
}
|
||||
|
||||
generate_keys() {
|
||||
print_info "Generating validator keys..."
|
||||
|
||||
mkdir -p "$INSTALL_DIR/keys"
|
||||
|
||||
"$INSTALL_DIR/bin/pezkuwi" key generate-node-key \
|
||||
--base-path "$INSTALL_DIR/data" \
|
||||
--chain "$INSTALL_DIR/config/chain-spec.json" > "$INSTALL_DIR/keys/node-id.txt"
|
||||
|
||||
NODE_ID=$(cat "$INSTALL_DIR/keys/node-id.txt")
|
||||
print_success "Keys generated"
|
||||
print_info "Your Node ID: $NODE_ID"
|
||||
}
|
||||
|
||||
create_systemd_service() {
|
||||
print_info "Creating systemd service..."
|
||||
|
||||
sudo tee /etc/systemd/system/pezkuwi-validator.service > /dev/null << SERVICE
|
||||
[Unit]
|
||||
Description=Pezkuwi Validator Node
|
||||
After=network.target
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
User=$USER
|
||||
WorkingDirectory=$INSTALL_DIR
|
||||
ExecStart=$INSTALL_DIR/bin/pezkuwi \\
|
||||
--chain $INSTALL_DIR/config/chain-spec.json \\
|
||||
--base-path $INSTALL_DIR/data \\
|
||||
--validator \\
|
||||
--name "Validator-\$(hostname)" \\
|
||||
--port 30333 \\
|
||||
--rpc-port 9944 \\
|
||||
--rpc-cors all \\
|
||||
--rpc-methods=unsafe
|
||||
Restart=always
|
||||
RestartSec=10
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
SERVICE
|
||||
|
||||
sudo systemctl daemon-reload
|
||||
sudo systemctl enable pezkuwi-validator
|
||||
print_success "Systemd service created"
|
||||
}
|
||||
|
||||
start_validator() {
|
||||
print_info "Starting validator..."
|
||||
|
||||
sudo systemctl start pezkuwi-validator
|
||||
sleep 3
|
||||
|
||||
if sudo systemctl is-active --quiet pezkuwi-validator; then
|
||||
print_success "Validator started successfully!"
|
||||
else
|
||||
print_error "Failed to start validator"
|
||||
print_info "Check logs: sudo journalctl -u pezkuwi-validator -f"
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
print_summary() {
|
||||
echo ""
|
||||
echo "======================================"
|
||||
echo "🎉 Installation Complete!"
|
||||
echo "======================================"
|
||||
echo ""
|
||||
echo "📍 Install Directory: $INSTALL_DIR"
|
||||
echo "🔑 Node ID: $(cat $INSTALL_DIR/keys/node-id.txt)"
|
||||
echo ""
|
||||
echo "📊 Useful Commands:"
|
||||
echo " • Check status: sudo systemctl status pezkuwi-validator"
|
||||
echo " • View logs: sudo journalctl -u pezkuwi-validator -f"
|
||||
echo " • Stop node: sudo systemctl stop pezkuwi-validator"
|
||||
echo " • Restart node: sudo systemctl restart pezkuwi-validator"
|
||||
echo ""
|
||||
echo "🌐 RPC Endpoint: http://localhost:9944"
|
||||
echo ""
|
||||
}
|
||||
|
||||
main() {
|
||||
check_requirements
|
||||
install_dependencies
|
||||
download_binaries
|
||||
download_chain_spec
|
||||
generate_keys
|
||||
create_systemd_service
|
||||
start_validator
|
||||
print_summary
|
||||
}
|
||||
|
||||
main
|
||||
Executable
+42
@@ -0,0 +1,42 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Logs viewer script
|
||||
# Usage: ./logs.sh [validator_number] [lines]
|
||||
|
||||
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||
VALIDATORS_DIR="$SCRIPT_DIR/../validators"
|
||||
|
||||
GREEN='\033[0;32m'
|
||||
RED='\033[0;31m'
|
||||
YELLOW='\033[1;33m'
|
||||
BLUE='\033[0;34m'
|
||||
NC='\033[0m'
|
||||
|
||||
if [ -z "$1" ]; then
|
||||
echo -e "${RED}Error: Validator number required${NC}"
|
||||
echo "Usage: $0 [validator_number] [lines (default: 50)]"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
VALIDATOR_NUM=$1
|
||||
LINES=${2:-50}
|
||||
VALIDATOR_DIR="$VALIDATORS_DIR/validator$VALIDATOR_NUM"
|
||||
|
||||
echo -e "${BLUE}=== Validator $VALIDATOR_NUM Logs (last $LINES lines) ===${NC}\n"
|
||||
|
||||
if [ -f "$VALIDATOR_DIR/logs/validator.log" ]; then
|
||||
tail -n "$LINES" "$VALIDATOR_DIR/logs/validator.log"
|
||||
echo -e "\n${YELLOW}To follow logs in real-time, use:${NC}"
|
||||
echo "tail -f $VALIDATOR_DIR/logs/validator.log"
|
||||
else
|
||||
echo -e "${YELLOW}No logs found. Service may not have started yet.${NC}"
|
||||
echo -e "\nTry viewing with journalctl:"
|
||||
echo "sudo journalctl -u pezkuwi-validator-$VALIDATOR_NUM -n $LINES"
|
||||
fi
|
||||
|
||||
echo -e "\n${BLUE}=== Error Logs ===${NC}\n"
|
||||
if [ -f "$VALIDATOR_DIR/logs/validator-error.log" ]; then
|
||||
tail -n "$LINES" "$VALIDATOR_DIR/logs/validator-error.log"
|
||||
else
|
||||
echo -e "${GREEN}No errors${NC}"
|
||||
fi
|
||||
Executable
+34
@@ -0,0 +1,34 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Start validator script
|
||||
# Usage: ./start.sh [validator_number]
|
||||
|
||||
set -e
|
||||
|
||||
GREEN='\033[0;32m'
|
||||
RED='\033[0;31m'
|
||||
YELLOW='\033[1;33m'
|
||||
NC='\033[0m'
|
||||
|
||||
if [ -z "$1" ]; then
|
||||
echo -e "${RED}Error: Validator number required${NC}"
|
||||
echo "Usage: $0 [validator_number]"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
VALIDATOR_NUM=$1
|
||||
|
||||
echo -e "${YELLOW}Starting Validator $VALIDATOR_NUM...${NC}"
|
||||
sudo systemctl start pezkuwi-validator-$VALIDATOR_NUM
|
||||
|
||||
# Wait for service to start
|
||||
sleep 2
|
||||
|
||||
# Check status
|
||||
if sudo systemctl is-active --quiet pezkuwi-validator-$VALIDATOR_NUM; then
|
||||
echo -e "${GREEN}✓ Validator $VALIDATOR_NUM started successfully${NC}"
|
||||
else
|
||||
echo -e "${RED}✗ Failed to start Validator $VALIDATOR_NUM${NC}"
|
||||
echo "Check logs with: ./scripts/logs.sh $VALIDATOR_NUM"
|
||||
exit 1
|
||||
fi
|
||||
Executable
+35
@@ -0,0 +1,35 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Status checker script
|
||||
# Usage: ./status.sh [validator_number]
|
||||
|
||||
GREEN='\033[0;32m'
|
||||
RED='\033[0;31m'
|
||||
YELLOW='\033[1;33m'
|
||||
BLUE='\033[0;34m'
|
||||
NC='\033[0m'
|
||||
|
||||
if [ -z "$1" ]; then
|
||||
# Show status of all validators
|
||||
echo -e "${BLUE}=== Pezkuwi Validators Status ===${NC}\n"
|
||||
for i in {1..10}; do
|
||||
if systemctl list-units --full -all | grep -q "pezkuwi-validator-$i.service"; then
|
||||
if sudo systemctl is-active --quiet pezkuwi-validator-$i; then
|
||||
echo -e "Validator $i: ${GREEN}● Running${NC}"
|
||||
else
|
||||
echo -e "Validator $i: ${RED}○ Stopped${NC}"
|
||||
fi
|
||||
fi
|
||||
done
|
||||
|
||||
echo -e "\n${BLUE}=== Frontend Status ===${NC}"
|
||||
if sudo systemctl is-active --quiet nginx; then
|
||||
echo -e "Nginx: ${GREEN}● Running${NC}"
|
||||
else
|
||||
echo -e "Nginx: ${RED}○ Stopped${NC}"
|
||||
fi
|
||||
else
|
||||
VALIDATOR_NUM=$1
|
||||
echo -e "${BLUE}=== Validator $VALIDATOR_NUM Status ===${NC}\n"
|
||||
sudo systemctl status pezkuwi-validator-$VALIDATOR_NUM
|
||||
fi
|
||||
Executable
+33
@@ -0,0 +1,33 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Stop validator script
|
||||
# Usage: ./stop.sh [validator_number]
|
||||
|
||||
set -e
|
||||
|
||||
GREEN='\033[0;32m'
|
||||
RED='\033[0;31m'
|
||||
YELLOW='\033[1;33m'
|
||||
NC='\033[0m'
|
||||
|
||||
if [ -z "$1" ]; then
|
||||
echo -e "${RED}Error: Validator number required${NC}"
|
||||
echo "Usage: $0 [validator_number]"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
VALIDATOR_NUM=$1
|
||||
|
||||
echo -e "${YELLOW}Stopping Validator $VALIDATOR_NUM...${NC}"
|
||||
sudo systemctl stop pezkuwi-validator-$VALIDATOR_NUM
|
||||
|
||||
# Wait for service to stop
|
||||
sleep 2
|
||||
|
||||
# Check status
|
||||
if sudo systemctl is-active --quiet pezkuwi-validator-$VALIDATOR_NUM; then
|
||||
echo -e "${RED}✗ Failed to stop Validator $VALIDATOR_NUM${NC}"
|
||||
exit 1
|
||||
else
|
||||
echo -e "${GREEN}✓ Validator $VALIDATOR_NUM stopped successfully${NC}"
|
||||
fi
|
||||
@@ -1,220 +0,0 @@
|
||||
# Pezkuwi Validator Installer for Windows
|
||||
# Usage: iwr -useb https://raw.githubusercontent.com/pezkuwichain/pezkuwi-validator-v1.0.0/main/scripts/windows/install-validator.ps1 | iex
|
||||
|
||||
#Requires -RunAsAdministrator
|
||||
|
||||
$ErrorActionPreference = "Stop"
|
||||
|
||||
Write-Host "🚀 Pezkuwi Validator Installer v1.0.0 (Windows)" -ForegroundColor Cyan
|
||||
Write-Host "=============================================" -ForegroundColor Cyan
|
||||
Write-Host ""
|
||||
|
||||
# Configuration
|
||||
$PEZKUWI_VERSION = "v1.0.0-local-testnet-success"
|
||||
$GITHUB_REPO = "pezkuwichain/pezkuwi-sdk"
|
||||
$INSTALL_DIR = "$env:USERPROFILE\.pezkuwi"
|
||||
$CHAIN_SPEC_URL = "https://raw.githubusercontent.com/$GITHUB_REPO/main/pezkuwi-local-raw.json"
|
||||
|
||||
# Functions
|
||||
function Write-Success {
|
||||
param($Message)
|
||||
Write-Host "✓ $Message" -ForegroundColor Green
|
||||
}
|
||||
|
||||
function Write-Error-Custom {
|
||||
param($Message)
|
||||
Write-Host "✗ $Message" -ForegroundColor Red
|
||||
}
|
||||
|
||||
function Write-Info {
|
||||
param($Message)
|
||||
Write-Host "ℹ $Message" -ForegroundColor Yellow
|
||||
}
|
||||
|
||||
function Check-Requirements {
|
||||
Write-Info "Checking system requirements..."
|
||||
|
||||
# Check Windows version
|
||||
$osVersion = [System.Environment]::OSVersion.Version
|
||||
if ($osVersion.Major -lt 10) {
|
||||
Write-Error-Custom "Windows 10 or later required"
|
||||
exit 1
|
||||
}
|
||||
|
||||
# Check CPU cores
|
||||
$cpuCores = (Get-WmiObject Win32_Processor).NumberOfLogicalProcessors
|
||||
if ($cpuCores -lt 2) {
|
||||
Write-Error-Custom "Minimum 2 CPU cores required (found: $cpuCores)"
|
||||
exit 1
|
||||
}
|
||||
|
||||
# Check RAM
|
||||
$totalRAM = [math]::Round((Get-WmiObject Win32_ComputerSystem).TotalPhysicalMemory / 1GB)
|
||||
if ($totalRAM -lt 4) {
|
||||
Write-Error-Custom "Minimum 4GB RAM required (found: ${totalRAM}GB)"
|
||||
exit 1
|
||||
}
|
||||
|
||||
Write-Success "System requirements met"
|
||||
}
|
||||
|
||||
function Install-Dependencies {
|
||||
Write-Info "Checking dependencies..."
|
||||
|
||||
# Check if Chocolatey is installed
|
||||
if (-not (Get-Command choco -ErrorAction SilentlyContinue)) {
|
||||
Write-Info "Installing Chocolatey..."
|
||||
Set-ExecutionPolicy Bypass -Scope Process -Force
|
||||
[System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072
|
||||
iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1'))
|
||||
}
|
||||
|
||||
Write-Success "Dependencies ready"
|
||||
}
|
||||
|
||||
function Download-Binaries {
|
||||
Write-Info "Downloading Pezkuwi binaries..."
|
||||
|
||||
New-Item -ItemType Directory -Force -Path "$INSTALL_DIR\bin" | Out-Null
|
||||
|
||||
$RELEASE_URL = "https://github.com/$GITHUB_REPO/releases/download/$PEZKUWI_VERSION"
|
||||
$ARCHIVE_NAME = "pezkuwi-binaries-linux-x86_64.tar.gz"
|
||||
$TEMP_FILE = "$env:TEMP\$ARCHIVE_NAME"
|
||||
|
||||
try {
|
||||
# Download archive
|
||||
Write-Info "Downloading from: $RELEASE_URL/$ARCHIVE_NAME"
|
||||
Invoke-WebRequest -Uri "$RELEASE_URL/$ARCHIVE_NAME" -OutFile $TEMP_FILE -UseBasicParsing
|
||||
|
||||
# Extract using tar (available in Windows 10+)
|
||||
Write-Info "Extracting binaries..."
|
||||
tar -xzf $TEMP_FILE -C "$INSTALL_DIR\bin\"
|
||||
|
||||
# Cleanup
|
||||
Remove-Item $TEMP_FILE
|
||||
|
||||
Write-Success "Binaries downloaded and extracted"
|
||||
}
|
||||
catch {
|
||||
Write-Error-Custom "Failed to download binaries: $_"
|
||||
Write-Info "Please check if release exists: $RELEASE_URL"
|
||||
exit 1
|
||||
}
|
||||
}
|
||||
|
||||
function Download-ChainSpec {
|
||||
Write-Info "Downloading chain specification..."
|
||||
|
||||
New-Item -ItemType Directory -Force -Path "$INSTALL_DIR\config" | Out-Null
|
||||
|
||||
try {
|
||||
Invoke-WebRequest -Uri $CHAIN_SPEC_URL -OutFile "$INSTALL_DIR\config\chain-spec.json" -UseBasicParsing
|
||||
Write-Success "Chain spec downloaded"
|
||||
}
|
||||
catch {
|
||||
Write-Error-Custom "Failed to download chain spec: $_"
|
||||
exit 1
|
||||
}
|
||||
}
|
||||
|
||||
function Generate-Keys {
|
||||
Write-Info "Generating validator keys..."
|
||||
|
||||
New-Item -ItemType Directory -Force -Path "$INSTALL_DIR\keys" | Out-Null
|
||||
|
||||
$nodeKeyOutput = & "$INSTALL_DIR\bin\pezkuwi.exe" key generate-node-key --base-path "$INSTALL_DIR\data" --chain "$INSTALL_DIR\config\chain-spec.json" 2>&1
|
||||
$nodeKeyOutput | Out-File "$INSTALL_DIR\keys\node-id.txt"
|
||||
|
||||
$nodeId = Get-Content "$INSTALL_DIR\keys\node-id.txt"
|
||||
|
||||
Write-Success "Keys generated"
|
||||
Write-Info "Your Node ID: $nodeId"
|
||||
}
|
||||
|
||||
function Create-WindowsService {
|
||||
Write-Info "Creating Windows service..."
|
||||
|
||||
$serviceName = "PezkuwiValidator"
|
||||
$displayName = "Pezkuwi Validator Node"
|
||||
$description = "Pezkuwi blockchain validator node"
|
||||
|
||||
# Remove existing service if present
|
||||
$existingService = Get-Service -Name $serviceName -ErrorAction SilentlyContinue
|
||||
if ($existingService) {
|
||||
Write-Info "Removing existing service..."
|
||||
Stop-Service -Name $serviceName -Force
|
||||
sc.exe delete $serviceName
|
||||
Start-Sleep -Seconds 2
|
||||
}
|
||||
|
||||
# Create batch file to run the validator
|
||||
$batchFile = "$INSTALL_DIR\start-validator.bat"
|
||||
@"
|
||||
@echo off
|
||||
cd /d "$INSTALL_DIR"
|
||||
"$INSTALL_DIR\bin\pezkuwi.exe" --chain "$INSTALL_DIR\config\chain-spec.json" --base-path "$INSTALL_DIR\data" --validator --name "Validator-$env:COMPUTERNAME" --port 30333 --rpc-port 9944 --rpc-cors all --rpc-methods=unsafe
|
||||
"@ | Out-File -FilePath $batchFile -Encoding ASCII
|
||||
|
||||
# Create service using NSSM (Non-Sucking Service Manager)
|
||||
choco install nssm -y --no-progress
|
||||
|
||||
nssm install $serviceName "$batchFile"
|
||||
nssm set $serviceName DisplayName $displayName
|
||||
nssm set $serviceName Description $description
|
||||
nssm set $serviceName Start SERVICE_AUTO_START
|
||||
|
||||
Write-Success "Windows service created"
|
||||
}
|
||||
|
||||
function Start-Validator {
|
||||
Write-Info "Starting validator..."
|
||||
|
||||
Start-Service -Name "PezkuwiValidator"
|
||||
Start-Sleep -Seconds 3
|
||||
|
||||
$service = Get-Service -Name "PezkuwiValidator"
|
||||
if ($service.Status -eq "Running") {
|
||||
Write-Success "Validator started successfully!"
|
||||
}
|
||||
else {
|
||||
Write-Error-Custom "Failed to start validator"
|
||||
Write-Info "Check logs in Event Viewer"
|
||||
exit 1
|
||||
}
|
||||
}
|
||||
|
||||
function Print-Summary {
|
||||
Write-Host ""
|
||||
Write-Host "=============================================" -ForegroundColor Cyan
|
||||
Write-Host "🎉 Installation Complete!" -ForegroundColor Cyan
|
||||
Write-Host "=============================================" -ForegroundColor Cyan
|
||||
Write-Host ""
|
||||
Write-Host "📍 Install Directory: $INSTALL_DIR"
|
||||
Write-Host "🔑 Node ID: $(Get-Content $INSTALL_DIR\keys\node-id.txt)"
|
||||
Write-Host ""
|
||||
Write-Host "📊 Useful Commands:" -ForegroundColor Yellow
|
||||
Write-Host " • Check status: Get-Service PezkuwiValidator"
|
||||
Write-Host " • View logs: Get-EventLog -LogName Application -Source PezkuwiValidator -Newest 50"
|
||||
Write-Host " • Stop node: Stop-Service PezkuwiValidator"
|
||||
Write-Host " • Restart node: Restart-Service PezkuwiValidator"
|
||||
Write-Host ""
|
||||
Write-Host "🌐 RPC Endpoint: http://localhost:9944"
|
||||
Write-Host "📡 P2P Port: 30333"
|
||||
Write-Host ""
|
||||
}
|
||||
|
||||
# Main execution
|
||||
try {
|
||||
Check-Requirements
|
||||
Install-Dependencies
|
||||
Download-Binaries
|
||||
Download-ChainSpec
|
||||
Generate-Keys
|
||||
Create-WindowsService
|
||||
Start-Validator
|
||||
Print-Summary
|
||||
}
|
||||
catch {
|
||||
Write-Error-Custom "Installation failed: $_"
|
||||
exit 1
|
||||
}
|
||||
Reference in New Issue
Block a user