mirror of
https://github.com/pezkuwichain/pezkuwi-validator-v1.0.0.git
synced 2026-06-12 04:21:00 +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,19 +0,0 @@
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
Version 3, 29 June 2007
|
||||
|
||||
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
@@ -1,197 +1,355 @@
|
||||
# Pezkuwi Validator Installer
|
||||
# Pezkuwi Beta Testnet - Validator Package v2.0.0
|
||||
|
||||
One-click validator installer for Pezkuwi testnet. Cross-platform scripts for automated node deployment.
|
||||
Simplified validator setup package for Pezkuwi blockchain beta testnet with 8 validators running on a single machine.
|
||||
|
||||
## 🚀 Quick Start
|
||||
## Features
|
||||
|
||||
### Linux / macOS (One-Line Install)
|
||||
bash
|
||||
curl -sSf https://raw.githubusercontent.com/pezkuwichain/pezkuwi-validator-v1.0.0/main/scripts/linux/install-validator.sh | bash
|
||||
- **One-command setup** - Automated installation and configuration
|
||||
- **Automatic dependency checking** - Detects and guides installation of required tools
|
||||
- **Shared SDK build** - Single Pezkuwi-SDK build shared across all validators
|
||||
- **Single DKSweb frontend** - One frontend instance with auto-update from GitHub
|
||||
- **Real validator keys** - Pre-configured with actual beta testnet validator keys
|
||||
- **Systemd service management** - Easy start/stop/restart with systemd
|
||||
- **Helper scripts** - Convenient management scripts for all validators
|
||||
- **Nginx deployment** - Production-ready frontend deployment
|
||||
|
||||
## System Requirements
|
||||
|
||||
**⚠️ Note:** This will install Pezkuwi validator to `~/.pezkuwi/` directory.
|
||||
### Required Dependencies
|
||||
- **Git** - Version control
|
||||
- **Rust & Cargo** - Substrate/Polkadot SDK compilation
|
||||
- **Node.js & npm** - Frontend build (v16+ recommended)
|
||||
- **Build tools** - build-essential, cmake, clang, libssl-dev, pkg-config
|
||||
- **Nginx** - Frontend web server
|
||||
- **Systemd** - Service management (included in Ubuntu)
|
||||
|
||||
### What Gets Installed?
|
||||
### Recommended System
|
||||
- **OS**: Ubuntu 20.04 LTS or newer
|
||||
- **CPU**: 4+ cores
|
||||
- **RAM**: 8GB+
|
||||
- **Storage**: 50GB+ SSD
|
||||
- **Network**: Stable internet connection
|
||||
|
||||
- **Binaries**: pezkuwi, pezkuwi-prepare-worker, pezkuwi-execute-worker (67 MB)
|
||||
- **Chain Spec**: Testnet configuration
|
||||
- **Systemd Service**: Auto-restart on failure
|
||||
- **Validator Keys**: Automatically generated
|
||||
## Directory Structure
|
||||
|
||||
### Test Installation (Dry Run)
|
||||
bash
|
||||
# Download script and review it first
|
||||
wget https://raw.githubusercontent.com/pezkuwichain/pezkuwi-validator-v1.0.0/main/scripts/linux/install-validator.sh
|
||||
less install-validator.sh
|
||||
bash install-validator.sh
|
||||
```
|
||||
beta_testnet/
|
||||
├── README.md # This file
|
||||
├── setup.sh # Main setup script
|
||||
├── config/ # Global configuration
|
||||
├── scripts/ # Helper scripts
|
||||
│ ├── start.sh # Start individual validator
|
||||
│ ├── stop.sh # Stop individual validator
|
||||
│ ├── status.sh # Check validator status
|
||||
│ └── logs.sh # View validator logs
|
||||
├── validators/ # Validator-specific data
|
||||
│ ├── validator1/
|
||||
│ │ ├── config/
|
||||
│ │ │ └── keys.sh # Validator 1 keys (RPC: 9944, Bootnode)
|
||||
│ │ ├── data/ # Blockchain data
|
||||
│ │ ├── keys/ # Keystore
|
||||
│ │ └── logs/ # Log files
|
||||
│ ├── validator2/ # RPC: 9945, P2P: 30334
|
||||
│ ├── validator3/ # RPC: 9946, P2P: 30335
|
||||
│ ├── validator4/ # RPC: 9947, P2P: 30336
|
||||
│ ├── validator5/ # RPC: 9948, P2P: 30337
|
||||
│ ├── validator6/ # RPC: 9949, P2P: 30338
|
||||
│ ├── validator7/ # RPC: 9950, P2P: 30339
|
||||
│ └── validator8/ # RPC: 9951, P2P: 30340
|
||||
├── shared/ # Shared resources
|
||||
│ ├── pezkuwi-sdk/ # Shared SDK build
|
||||
│ └── dksweb/ # Shared frontend
|
||||
└── systemd/ # Systemd service templates
|
||||
|
||||
```
|
||||
|
||||
### Windows (PowerShell)
|
||||
## Port Allocation
|
||||
|
||||
**⚠️ Run as Administrator**
|
||||
powershell
|
||||
iwr -useb https://raw.githubusercontent.com/pezkuwichain/pezkuwi-validator-v1.0.0/main/scripts/windows/install-validator.ps1 | iex
|
||||
| Validator | RPC Port | P2P Port | WS Port | Prometheus |
|
||||
|-----------|----------|----------|---------|------------|
|
||||
| 1 (Boot) | 9944 | 30333 | 9944 | 9615 |
|
||||
| 2 | 9945 | 30334 | 9945 | 9616 |
|
||||
| 3 | 9946 | 30335 | 9946 | 9617 |
|
||||
| 4 | 9947 | 30336 | 9947 | 9618 |
|
||||
| 5 | 9948 | 30337 | 9948 | 9619 |
|
||||
| 6 | 9949 | 30338 | 9949 | 9620 |
|
||||
| 7 | 9950 | 30339 | 9950 | 9621 |
|
||||
| 8 | 9951 | 30340 | 9951 | 9622 |
|
||||
|
||||
## Quick Start
|
||||
|
||||
**What Gets Installed?**
|
||||
### 1. Initial Setup
|
||||
|
||||
- **Binaries**: pezkuwi.exe, pezkuwi-prepare-worker.exe, pezkuwi-execute-worker.exe
|
||||
- **Windows Service**: PezkuwiValidator (auto-start enabled)
|
||||
- **Dependencies**: Chocolatey, NSSM (service manager)
|
||||
- **Firewall**: Ports 30333 and 9944 (manual configuration may be required)
|
||||
Run the main setup script with a validator number (1-8):
|
||||
|
||||
**Manual Installation (if one-liner fails):**
|
||||
powershell
|
||||
# Download script
|
||||
Invoke-WebRequest -Uri "https://raw.githubusercontent.com/pezkuwichain/pezkuwi-validator-v1.0.0/main/scripts/windows/install-validator.ps1" -OutFile "install-validator.ps1"
|
||||
```bash
|
||||
cd /home/mamostehp/pezkuwi-validator-v2.0.0/beta_testnet
|
||||
sudo ./setup.sh 1
|
||||
```
|
||||
|
||||
# Review script
|
||||
notepad install-validator.ps1
|
||||
This will:
|
||||
- Check all dependencies
|
||||
- Clone/update Pezkuwi-SDK (if needed)
|
||||
- Build SDK in release mode (shared build)
|
||||
- Clone/update DKSweb frontend (if needed)
|
||||
- Build and deploy frontend with Nginx
|
||||
- Insert validator keys
|
||||
- Create systemd service
|
||||
- Start the validator
|
||||
|
||||
# Run as Administrator
|
||||
.\install-validator.ps1
|
||||
### 2. Setup Additional Validators
|
||||
|
||||
```bash
|
||||
sudo ./setup.sh 2
|
||||
sudo ./setup.sh 3
|
||||
# ... up to 8
|
||||
```
|
||||
|
||||
**Check Service Status:**
|
||||
powershell
|
||||
Get-Service PezkuwiValidator
|
||||
### 3. Verify All Validators Are Running
|
||||
|
||||
```bash
|
||||
./scripts/status.sh
|
||||
```
|
||||
|
||||
### Docker (Recommended for Production)
|
||||
## Helper Scripts Usage
|
||||
|
||||
**Prerequisites:** Docker 20.10+ and Docker Compose 2.0+
|
||||
bash
|
||||
# Clone repository
|
||||
git clone https://github.com/pezkuwichain/pezkuwi-validator-v1.0.0.git
|
||||
cd pezkuwi-validator-v1.0.0/docker
|
||||
### Start Validator
|
||||
|
||||
# Start validator
|
||||
docker-compose up -d
|
||||
|
||||
# View logs
|
||||
docker-compose logs -f pezkuwi-validator
|
||||
|
||||
|
||||
**With Monitoring (Prometheus + Grafana):**
|
||||
bash
|
||||
docker-compose --profile monitoring up -d
|
||||
|
||||
|
||||
**Access:**
|
||||
- Validator RPC: http://localhost:9944
|
||||
- Prometheus: http://localhost:9090
|
||||
- Grafana: http://localhost:3000 (admin/pezkuwi123)
|
||||
|
||||
📚 **Full Docker documentation:** [docker/README.md](./docker/README.md)
|
||||
|
||||
## 📋 Prerequisites
|
||||
|
||||
- **OS**: Linux (Ubuntu 20.04+, Debian 11+, Fedora 35+)
|
||||
- **CPU**: Minimum 2 cores (4+ recommended)
|
||||
- **RAM**: Minimum 4GB (8GB+ recommended)
|
||||
- **Storage**: 50GB+ free space
|
||||
- **Network**: Public IP with ports 30333 (P2P) and 9944 (RPC) open
|
||||
|
||||
## 🔧 What Does the Installer Do?
|
||||
|
||||
1. ✅ Checks system requirements
|
||||
2. ✅ Installs dependencies
|
||||
3. ✅ Downloads Pezkuwi binaries from GitHub Releases (67 MB compressed)
|
||||
4. ✅ Extracts binaries to `~/.pezkuwi/bin/`
|
||||
5. ✅ Downloads chain specification
|
||||
6. ✅ Generates validator keys automatically
|
||||
7. ✅ Creates systemd service (auto-restart enabled)
|
||||
8. ✅ Starts validator node
|
||||
9. ✅ Displays node ID and useful commands
|
||||
|
||||
## 📊 Post-Installation
|
||||
|
||||
### Check Node Status
|
||||
bash
|
||||
sudo systemctl status pezkuwi-validator
|
||||
|
||||
|
||||
### View Live Logs
|
||||
bash
|
||||
sudo journalctl -u pezkuwi-validator -f
|
||||
Start a single validator:
|
||||
```bash
|
||||
./scripts/start.sh 1
|
||||
```
|
||||
|
||||
Start all validators:
|
||||
```bash
|
||||
for i in {1..8}; do ./scripts/start.sh $i; done
|
||||
```
|
||||
|
||||
### Stop Validator
|
||||
bash
|
||||
sudo systemctl stop pezkuwi-validator
|
||||
|
||||
Stop a single validator:
|
||||
```bash
|
||||
./scripts/stop.sh 1
|
||||
```
|
||||
|
||||
### Restart Validator
|
||||
bash
|
||||
sudo systemctl restart pezkuwi-validator
|
||||
Stop all validators:
|
||||
```bash
|
||||
for i in {1..8}; do ./scripts/stop.sh $i; done
|
||||
```
|
||||
|
||||
### Check Status
|
||||
|
||||
## 📁 Installation Directory
|
||||
Check single validator:
|
||||
```bash
|
||||
./scripts/status.sh 1
|
||||
```
|
||||
|
||||
All files are installed to: `~/.pezkuwi/`
|
||||
Check all validators:
|
||||
```bash
|
||||
./scripts/status.sh
|
||||
```
|
||||
|
||||
~/.pezkuwi/
|
||||
├── bin/ # Binaries
|
||||
├── config/ # Chain spec
|
||||
├── data/ # Blockchain data
|
||||
└── keys/ # Validator keys
|
||||
### View Logs
|
||||
|
||||
View logs for a validator:
|
||||
```bash
|
||||
./scripts/logs.sh 1
|
||||
```
|
||||
|
||||
## 🔑 Your Validator Keys
|
||||
Follow logs in real-time:
|
||||
```bash
|
||||
./scripts/logs.sh 1 follow
|
||||
```
|
||||
|
||||
After installation, your node ID is saved in:
|
||||
bash
|
||||
cat ~/.pezkuwi/keys/node-id.txt
|
||||
## Systemd Service Management
|
||||
|
||||
Validators are managed as systemd services:
|
||||
|
||||
**⚠️ IMPORTANT**: Backup this file! You'll need it for testnet registration.
|
||||
```bash
|
||||
# Start validator
|
||||
sudo systemctl start pezkuwi-validator-1
|
||||
|
||||
## 🌐 Connect to Your Node
|
||||
# Stop validator
|
||||
sudo systemctl stop pezkuwi-validator-1
|
||||
|
||||
- **RPC Endpoint**: `http://localhost:9944`
|
||||
- **WebSocket**: `ws://localhost:9944`
|
||||
# Restart validator
|
||||
sudo systemctl restart pezkuwi-validator-1
|
||||
|
||||
Test connection:
|
||||
bash
|
||||
# Check status
|
||||
sudo systemctl status pezkuwi-validator-1
|
||||
|
||||
# View logs
|
||||
sudo journalctl -u pezkuwi-validator-1 -f
|
||||
|
||||
# Enable auto-start on boot
|
||||
sudo systemctl enable pezkuwi-validator-1
|
||||
|
||||
# Disable auto-start
|
||||
sudo systemctl disable pezkuwi-validator-1
|
||||
```
|
||||
|
||||
## Validator Keys
|
||||
|
||||
Each validator has 6 types of keys pre-configured in `validators/validatorN/config/keys.sh`:
|
||||
|
||||
- **BABE** - Block authorship (sr25519)
|
||||
- **GRANDPA** - Finality (ed25519)
|
||||
- **PARA** - Parachain validation (sr25519)
|
||||
- **ASGN** - Assignment (sr25519)
|
||||
- **AUDI** - Authority discovery (sr25519)
|
||||
- **BEEF** - BEEFY consensus (ecdsa)
|
||||
|
||||
**SECURITY WARNING**: These keys are for beta testnet only. Never use testnet keys in production!
|
||||
|
||||
## Frontend Access
|
||||
|
||||
After setup, DKSweb frontend is available at:
|
||||
- **Local**: http://localhost (via Nginx)
|
||||
- **Network**: http://YOUR_SERVER_IP
|
||||
|
||||
The frontend connects to validator 1 (bootnode) by default at `ws://127.0.0.1:9944`.
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
### Validator Won't Start
|
||||
|
||||
Check logs:
|
||||
```bash
|
||||
./scripts/logs.sh 1
|
||||
# or
|
||||
sudo journalctl -u pezkuwi-validator-1 -n 100
|
||||
```
|
||||
|
||||
Common issues:
|
||||
- Port already in use
|
||||
- Keys not inserted properly
|
||||
- Insufficient permissions
|
||||
- Blockchain data corruption
|
||||
|
||||
### Port Already in Use
|
||||
|
||||
Check what's using the port:
|
||||
```bash
|
||||
sudo lsof -i :9944
|
||||
```
|
||||
|
||||
Kill the process:
|
||||
```bash
|
||||
sudo kill -9 <PID>
|
||||
```
|
||||
|
||||
### Clear Blockchain Data
|
||||
|
||||
To reset a validator's blockchain data:
|
||||
```bash
|
||||
sudo systemctl stop pezkuwi-validator-1
|
||||
rm -rf /home/mamostehp/pezkuwi-validator-v2.0.0/beta_testnet/validators/validator1/data/*
|
||||
sudo systemctl start pezkuwi-validator-1
|
||||
```
|
||||
|
||||
### Rebuild SDK
|
||||
|
||||
If you need to rebuild the SDK:
|
||||
```bash
|
||||
cd /home/mamostehp/pezkuwi-validator-v2.0.0/beta_testnet/shared/pezkuwi-sdk
|
||||
cargo clean
|
||||
cargo build --release
|
||||
```
|
||||
|
||||
### Frontend Not Loading
|
||||
|
||||
Check Nginx status:
|
||||
```bash
|
||||
sudo systemctl status nginx
|
||||
```
|
||||
|
||||
Check Nginx logs:
|
||||
```bash
|
||||
sudo tail -f /var/log/nginx/error.log
|
||||
```
|
||||
|
||||
Restart Nginx:
|
||||
```bash
|
||||
sudo systemctl restart nginx
|
||||
```
|
||||
|
||||
### Re-insert Keys
|
||||
|
||||
If keys need to be re-inserted:
|
||||
```bash
|
||||
cd /home/mamostehp/pezkuwi-validator-v2.0.0/beta_testnet
|
||||
source validators/validator1/config/keys.sh
|
||||
|
||||
# Insert each key type
|
||||
curl -H "Content-Type: application/json" \
|
||||
-d '{"id":1, "jsonrpc":"2.0", "method": "system_health"}' \
|
||||
http://localhost:9944
|
||||
-d "{\"id\":1,\"jsonrpc\":\"2.0\",\"method\":\"author_insertKey\",\"params\":[\"babe\",\"$BABE_SEED\",\"$BABE_PUBLIC_KEY\"]}" \
|
||||
http://127.0.0.1:9944
|
||||
```
|
||||
|
||||
## Network Information
|
||||
|
||||
## 🆘 Troubleshooting
|
||||
- **Network**: Pezkuwi Beta Testnet
|
||||
- **Chain Spec**: pezkuwichain-beta-testnet
|
||||
- **Genesis**: Same across all validators
|
||||
- **Bootnode**: Validator 1 (127.0.0.1:30333)
|
||||
|
||||
### Node Not Starting
|
||||
bash
|
||||
# Check logs
|
||||
sudo journalctl -u pezkuwi-validator -n 100
|
||||
## Maintenance
|
||||
|
||||
# Check service status
|
||||
sudo systemctl status pezkuwi-validator
|
||||
### Update SDK
|
||||
|
||||
```bash
|
||||
cd /home/mamostehp/pezkuwi-validator-v2.0.0/beta_testnet/shared/pezkuwi-sdk
|
||||
git pull origin main
|
||||
cargo build --release
|
||||
|
||||
### Firewall Issues
|
||||
bash
|
||||
# Open required ports (Ubuntu/Debian)
|
||||
sudo ufw allow 30333/tcp
|
||||
sudo ufw allow 9944/tcp
|
||||
# Restart all validators
|
||||
for i in {1..8}; do sudo systemctl restart pezkuwi-validator-$i; done
|
||||
```
|
||||
|
||||
### Update Frontend
|
||||
|
||||
## 📚 Documentation
|
||||
```bash
|
||||
cd /home/mamostehp/pezkuwi-validator-v2.0.0/beta_testnet/shared/dksweb
|
||||
git pull origin main
|
||||
npm install
|
||||
npm run build
|
||||
sudo systemctl restart nginx
|
||||
```
|
||||
|
||||
- [Validator Guide](./docs/VALIDATOR-GUIDE.md)
|
||||
- [Troubleshooting](./docs/TROUBLESHOOTING.md)
|
||||
- [FAQ](./docs/FAQ.md)
|
||||
### Backup Validator Keys
|
||||
|
||||
## 🤝 Support
|
||||
```bash
|
||||
# Backup all validator keys
|
||||
tar -czf validator-keys-backup.tar.gz validators/validator*/config/keys.sh
|
||||
|
||||
- GitHub Issues: https://github.com/pezkuwichain/pezkuwi-validator-v1.0.0/issues
|
||||
- Telegram: https://t.me/pezkuwichain
|
||||
- Discord: Coming soon
|
||||
# Copy to safe location
|
||||
cp validator-keys-backup.tar.gz /backup/location/
|
||||
```
|
||||
|
||||
## 📜 License
|
||||
## Security Best Practices
|
||||
|
||||
GNU General Public License v3.0
|
||||
1. **Never expose RPC ports to public internet** - Use firewall rules
|
||||
2. **Backup validator keys securely** - Store encrypted backups offline
|
||||
3. **Use different keys for production** - Never reuse testnet keys
|
||||
4. **Keep system updated** - Regular security updates
|
||||
5. **Monitor validator logs** - Watch for suspicious activity
|
||||
6. **Restrict SSH access** - Use key-based authentication only
|
||||
7. **Run validators as non-root** - Use dedicated user accounts
|
||||
|
||||
## Support
|
||||
|
||||
For issues or questions:
|
||||
- Check logs first: `./scripts/logs.sh <validator_num>`
|
||||
- Review this README
|
||||
- Check validator status: `./scripts/status.sh`
|
||||
- Consult Pezkuwi documentation
|
||||
|
||||
## License
|
||||
|
||||
This validator package is part of the Pezkuwi blockchain project.
|
||||
|
||||
---
|
||||
|
||||
**Made with ❤️ by Kurdistan Tech Ministry**
|
||||
**Last Updated**: 2025-11-05
|
||||
**Package Version**: 2.0.0
|
||||
**Network**: Beta Testnet (8 Validators)
|
||||
|
||||
@@ -1,56 +0,0 @@
|
||||
# Pezkuwi Validator Docker Image
|
||||
FROM ubuntu:22.04
|
||||
|
||||
LABEL maintainer="pezkuwichain"
|
||||
LABEL description="Pezkuwi blockchain validator node"
|
||||
LABEL version="1.0.0"
|
||||
|
||||
# Install dependencies
|
||||
RUN apt-get update && \
|
||||
apt-get install -y --no-install-recommends \
|
||||
ca-certificates \
|
||||
curl \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# Create pezkuwi user
|
||||
RUN useradd -m -u 1000 -U -s /bin/sh -d /pezkuwi pezkuwi
|
||||
|
||||
# Set working directory
|
||||
WORKDIR /pezkuwi
|
||||
|
||||
# Download and extract binaries
|
||||
ARG PEZKUWI_VERSION=v1.0.0-local-testnet-success
|
||||
RUN curl -L "https://github.com/pezkuwichain/pezkuwi-sdk/releases/download/${PEZKUWI_VERSION}/pezkuwi-binaries-linux-x86_64.tar.gz" \
|
||||
| tar xz -C /usr/local/bin/ && \
|
||||
chmod +x /usr/local/bin/pezkuwi && \
|
||||
chmod +x /usr/local/bin/pezkuwi-prepare-worker && \
|
||||
chmod +x /usr/local/bin/pezkuwi-execute-worker
|
||||
|
||||
# Download chain spec
|
||||
RUN curl -o /pezkuwi/chain-spec.json \
|
||||
https://raw.githubusercontent.com/pezkuwichain/pezkuwi-sdk/main/pezkuwi-local-raw.json
|
||||
|
||||
# Create data directory
|
||||
RUN mkdir -p /pezkuwi/data && \
|
||||
chown -R pezkuwi:pezkuwi /pezkuwi
|
||||
|
||||
# Switch to pezkuwi user
|
||||
USER pezkuwi
|
||||
|
||||
# Expose ports
|
||||
EXPOSE 30333 9944 9615
|
||||
|
||||
# Health check
|
||||
HEALTHCHECK --interval=30s --timeout=10s --start-period=60s --retries=3 \
|
||||
CMD curl -f http://localhost:9944 || exit 1
|
||||
|
||||
# Default command
|
||||
ENTRYPOINT ["/usr/local/bin/pezkuwi"]
|
||||
CMD ["--chain", "/pezkuwi/chain-spec.json", \
|
||||
"--base-path", "/pezkuwi/data", \
|
||||
"--validator", \
|
||||
"--port", "30333", \
|
||||
"--rpc-port", "9944", \
|
||||
"--rpc-cors", "all", \
|
||||
"--rpc-external", \
|
||||
"--prometheus-external"]
|
||||
@@ -1,157 +0,0 @@
|
||||
# Pezkuwi Validator - Docker Setup
|
||||
|
||||
Run Pezkuwi validator node using Docker and Docker Compose.
|
||||
|
||||
## 🚀 Quick Start
|
||||
|
||||
### Prerequisites
|
||||
|
||||
- Docker 20.10+
|
||||
- Docker Compose 2.0+
|
||||
|
||||
**Install Docker:**
|
||||
```bash
|
||||
# Linux
|
||||
curl -fsSL https://get.docker.com | sh
|
||||
sudo usermod -aG docker $USER
|
||||
|
||||
# Verify
|
||||
docker --version
|
||||
docker-compose --version
|
||||
```
|
||||
|
||||
### Run Validator
|
||||
```bash
|
||||
# Clone repository
|
||||
git clone https://github.com/pezkuwichain/pezkuwi-validator-v1.0.0.git
|
||||
cd pezkuwi-validator-v1.0.0/docker
|
||||
|
||||
# Start validator
|
||||
docker-compose up -d
|
||||
|
||||
# Check logs
|
||||
docker-compose logs -f pezkuwi-validator
|
||||
|
||||
# Check status
|
||||
docker-compose ps
|
||||
```
|
||||
|
||||
## 📊 Monitoring (Optional)
|
||||
|
||||
Start with Prometheus and Grafana:
|
||||
```bash
|
||||
docker-compose --profile monitoring up -d
|
||||
```
|
||||
|
||||
**Access:**
|
||||
- Prometheus: http://localhost:9090
|
||||
- Grafana: http://localhost:3000 (admin/pezkuwi123)
|
||||
|
||||
## 🔧 Management Commands
|
||||
```bash
|
||||
# Stop validator
|
||||
docker-compose stop
|
||||
|
||||
# Restart validator
|
||||
docker-compose restart
|
||||
|
||||
# View logs
|
||||
docker-compose logs -f
|
||||
|
||||
# Remove everything (including data)
|
||||
docker-compose down -v
|
||||
|
||||
# Update to latest version
|
||||
docker-compose pull
|
||||
docker-compose up -d
|
||||
```
|
||||
|
||||
## 📁 Data Persistence
|
||||
|
||||
Blockchain data is stored in Docker volume: `validator-data`
|
||||
|
||||
**Backup data:**
|
||||
```bash
|
||||
docker run --rm -v validator-data:/data -v $(pwd):/backup ubuntu tar czf /backup/validator-backup.tar.gz /data
|
||||
```
|
||||
|
||||
**Restore data:**
|
||||
```bash
|
||||
docker run --rm -v validator-data:/data -v $(pwd):/backup ubuntu tar xzf /backup/validator-backup.tar.gz -C /
|
||||
```
|
||||
|
||||
## 🔑 Validator Keys
|
||||
|
||||
Keys are generated automatically on first start in `/pezkuwi/data/chains/`
|
||||
|
||||
**Extract your Node ID:**
|
||||
```bash
|
||||
docker-compose exec pezkuwi-validator cat /pezkuwi/data/chains/pezkuwi_testnet/network/secret_ed25519
|
||||
```
|
||||
|
||||
## 🌐 Network Ports
|
||||
|
||||
- **30333**: P2P port (required for validators)
|
||||
- **9944**: RPC/WebSocket (for local access)
|
||||
- **9615**: Prometheus metrics
|
||||
|
||||
## 🐛 Troubleshooting
|
||||
|
||||
### Container won't start
|
||||
```bash
|
||||
# Check logs
|
||||
docker-compose logs pezkuwi-validator
|
||||
|
||||
# Rebuild image
|
||||
docker-compose build --no-cache
|
||||
docker-compose up -d
|
||||
```
|
||||
|
||||
### Out of disk space
|
||||
```bash
|
||||
# Check disk usage
|
||||
docker system df
|
||||
|
||||
# Prune unused data
|
||||
docker system prune -a
|
||||
```
|
||||
|
||||
### Performance issues
|
||||
```bash
|
||||
# Check resource usage
|
||||
docker stats pezkuwi-validator
|
||||
|
||||
# Increase resources in Docker Desktop settings
|
||||
```
|
||||
|
||||
## 🔄 Updates
|
||||
```bash
|
||||
# Pull latest image
|
||||
docker-compose pull
|
||||
|
||||
# Restart with new image
|
||||
docker-compose up -d
|
||||
```
|
||||
|
||||
## 📝 Custom Configuration
|
||||
|
||||
Edit `docker-compose.yml` to customize:
|
||||
- Node name
|
||||
- Ports
|
||||
- Resource limits
|
||||
- Logging options
|
||||
|
||||
Example resource limits:
|
||||
```yaml
|
||||
services:
|
||||
pezkuwi-validator:
|
||||
# ... other config
|
||||
deploy:
|
||||
resources:
|
||||
limits:
|
||||
cpus: '2'
|
||||
memory: 4G
|
||||
reservations:
|
||||
cpus: '1'
|
||||
memory: 2G
|
||||
```
|
||||
@@ -1,82 +0,0 @@
|
||||
version: '3.8'
|
||||
|
||||
services:
|
||||
pezkuwi-validator:
|
||||
build:
|
||||
context: .
|
||||
dockerfile: Dockerfile
|
||||
container_name: pezkuwi-validator
|
||||
restart: unless-stopped
|
||||
ports:
|
||||
- "30333:30333" # P2P
|
||||
- "9944:9944" # RPC
|
||||
- "9615:9615" # Prometheus metrics
|
||||
volumes:
|
||||
- validator-data:/pezkuwi/data
|
||||
- ./chain-spec.json:/pezkuwi/chain-spec.json:ro
|
||||
environment:
|
||||
- RUST_LOG=info
|
||||
command: [
|
||||
"--chain", "/pezkuwi/chain-spec.json",
|
||||
"--base-path", "/pezkuwi/data",
|
||||
"--validator",
|
||||
"--name", "Docker-Validator",
|
||||
"--port", "30333",
|
||||
"--rpc-port", "9944",
|
||||
"--rpc-cors", "all",
|
||||
"--rpc-external",
|
||||
"--rpc-methods=unsafe",
|
||||
"--prometheus-external",
|
||||
"--prometheus-port", "9615"
|
||||
]
|
||||
networks:
|
||||
- pezkuwi-network
|
||||
logging:
|
||||
driver: "json-file"
|
||||
options:
|
||||
max-size: "10m"
|
||||
max-file: "3"
|
||||
|
||||
# Optional: Prometheus monitoring
|
||||
prometheus:
|
||||
image: prom/prometheus:latest
|
||||
container_name: pezkuwi-prometheus
|
||||
restart: unless-stopped
|
||||
ports:
|
||||
- "9090:9090"
|
||||
volumes:
|
||||
- ./prometheus.yml:/etc/prometheus/prometheus.yml:ro
|
||||
- prometheus-data:/prometheus
|
||||
command:
|
||||
- '--config.file=/etc/prometheus/prometheus.yml'
|
||||
- '--storage.tsdb.path=/prometheus'
|
||||
networks:
|
||||
- pezkuwi-network
|
||||
profiles:
|
||||
- monitoring
|
||||
|
||||
# Optional: Grafana dashboard
|
||||
grafana:
|
||||
image: grafana/grafana:latest
|
||||
container_name: pezkuwi-grafana
|
||||
restart: unless-stopped
|
||||
ports:
|
||||
- "3000:3000"
|
||||
volumes:
|
||||
- grafana-data:/var/lib/grafana
|
||||
environment:
|
||||
- GF_SECURITY_ADMIN_PASSWORD=pezkuwi123
|
||||
- GF_USERS_ALLOW_SIGN_UP=false
|
||||
networks:
|
||||
- pezkuwi-network
|
||||
profiles:
|
||||
- monitoring
|
||||
|
||||
volumes:
|
||||
validator-data:
|
||||
prometheus-data:
|
||||
grafana-data:
|
||||
|
||||
networks:
|
||||
pezkuwi-network:
|
||||
driver: bridge
|
||||
@@ -1,11 +0,0 @@
|
||||
global:
|
||||
scrape_interval: 15s
|
||||
evaluation_interval: 15s
|
||||
|
||||
scrape_configs:
|
||||
- job_name: 'pezkuwi-validator'
|
||||
static_configs:
|
||||
- targets: ['pezkuwi-validator:9615']
|
||||
labels:
|
||||
instance: 'validator-1'
|
||||
network: 'pezkuwi-testnet'
|
||||
@@ -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
|
||||
}
|
||||
@@ -0,0 +1,516 @@
|
||||
#!/bin/bash
|
||||
|
||||
# ========================================
|
||||
# Pezkuwi Validator Setup Script v2.0.0
|
||||
# ========================================
|
||||
# This script automates the entire validator setup process
|
||||
# Usage: ./setup.sh [validator_number]
|
||||
|
||||
set -e
|
||||
|
||||
# Colors for output
|
||||
RED='\033[0;31m'
|
||||
GREEN='\033[0;32m'
|
||||
YELLOW='\033[1;33m'
|
||||
BLUE='\033[0;34m'
|
||||
NC='\033[0m' # No Color
|
||||
|
||||
# Script directory
|
||||
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||
SHARED_DIR="$SCRIPT_DIR/shared"
|
||||
VALIDATORS_DIR="$SCRIPT_DIR/validators"
|
||||
|
||||
# Function to print section headers
|
||||
print_header() {
|
||||
echo -e "\n${BLUE}========================================${NC}"
|
||||
echo -e "${BLUE}$1${NC}"
|
||||
echo -e "${BLUE}========================================${NC}\n"
|
||||
}
|
||||
|
||||
# Function to check if a command exists
|
||||
command_exists() {
|
||||
command -v "$1" >/dev/null 2>&1
|
||||
}
|
||||
|
||||
# Function to check dependency and display status
|
||||
check_dependency() {
|
||||
local cmd=$1
|
||||
local name=$2
|
||||
local version_cmd=$3
|
||||
|
||||
if command_exists "$cmd"; then
|
||||
local version=$($version_cmd 2>&1 | head -n 1 || echo "unknown")
|
||||
echo -e "${GREEN}✓${NC} $name: ${GREEN}Installed${NC} ($version)"
|
||||
return 0
|
||||
else
|
||||
echo -e "${RED}✗${NC} $name: ${RED}Not installed${NC}"
|
||||
return 1
|
||||
fi
|
||||
}
|
||||
|
||||
# Get validator number from argument or prompt
|
||||
get_validator_number() {
|
||||
if [ -n "$1" ]; then
|
||||
VALIDATOR_NUM=$1
|
||||
else
|
||||
read -p "Enter validator number (1-10): " VALIDATOR_NUM
|
||||
fi
|
||||
|
||||
# Validate validator number
|
||||
if ! [[ "$VALIDATOR_NUM" =~ ^[1-9]$|^10$ ]]; then
|
||||
echo -e "${RED}Error: Validator number must be between 1 and 10${NC}"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
VALIDATOR_DIR="$VALIDATORS_DIR/validator$VALIDATOR_NUM"
|
||||
echo -e "${GREEN}Setting up Validator $VALIDATOR_NUM${NC}"
|
||||
}
|
||||
|
||||
# Check system dependencies
|
||||
check_dependencies() {
|
||||
print_header "Checking System Dependencies"
|
||||
|
||||
local missing_deps=()
|
||||
|
||||
# Essential build tools
|
||||
if ! check_dependency "git" "Git" "git --version"; then
|
||||
missing_deps+=("git")
|
||||
fi
|
||||
|
||||
if ! check_dependency "curl" "Curl" "curl --version"; then
|
||||
missing_deps+=("curl")
|
||||
fi
|
||||
|
||||
if ! check_dependency "wget" "Wget" "wget --version"; then
|
||||
missing_deps+=("wget")
|
||||
fi
|
||||
|
||||
# Build essentials
|
||||
if ! check_dependency "gcc" "GCC" "gcc --version"; then
|
||||
missing_deps+=("build-essential")
|
||||
fi
|
||||
|
||||
if ! check_dependency "make" "Make" "make --version"; then
|
||||
missing_deps+=("build-essential")
|
||||
fi
|
||||
|
||||
# Check pkg-config
|
||||
if ! check_dependency "pkg-config" "pkg-config" "pkg-config --version"; then
|
||||
missing_deps+=("pkg-config")
|
||||
fi
|
||||
|
||||
# Check libssl-dev
|
||||
if ! dpkg -l | grep -q libssl-dev; then
|
||||
echo -e "${RED}✗${NC} libssl-dev: ${RED}Not installed${NC}"
|
||||
missing_deps+=("libssl-dev")
|
||||
else
|
||||
echo -e "${GREEN}✓${NC} libssl-dev: ${GREEN}Installed${NC}"
|
||||
fi
|
||||
|
||||
# Check clang
|
||||
if ! check_dependency "clang" "Clang" "clang --version"; then
|
||||
missing_deps+=("clang")
|
||||
fi
|
||||
|
||||
# Check Rust
|
||||
if ! check_dependency "rustc" "Rust" "rustc --version"; then
|
||||
RUST_MISSING=1
|
||||
else
|
||||
RUST_MISSING=0
|
||||
fi
|
||||
|
||||
# Check Cargo
|
||||
if ! check_dependency "cargo" "Cargo" "cargo --version"; then
|
||||
RUST_MISSING=1
|
||||
fi
|
||||
|
||||
# Check Node.js
|
||||
if ! check_dependency "node" "Node.js" "node --version"; then
|
||||
NODE_MISSING=1
|
||||
else
|
||||
NODE_MISSING=0
|
||||
fi
|
||||
|
||||
# Check npm
|
||||
if ! check_dependency "npm" "npm" "npm --version"; then
|
||||
NODE_MISSING=1
|
||||
fi
|
||||
|
||||
# Check systemd (should be available on Ubuntu)
|
||||
if ! check_dependency "systemctl" "systemd" "systemctl --version"; then
|
||||
echo -e "${YELLOW}Warning: systemd not found. Service management may not work.${NC}"
|
||||
fi
|
||||
|
||||
# Check nginx
|
||||
if ! check_dependency "nginx" "Nginx" "nginx -v"; then
|
||||
missing_deps+=("nginx")
|
||||
fi
|
||||
|
||||
return ${#missing_deps[@]}
|
||||
}
|
||||
|
||||
# Install missing dependencies
|
||||
install_dependencies() {
|
||||
print_header "Installing Missing Dependencies"
|
||||
|
||||
echo "Updating package list..."
|
||||
sudo apt-get update
|
||||
|
||||
# Install system packages
|
||||
if [ ${#missing_deps[@]} -gt 0 ]; then
|
||||
echo -e "\n${YELLOW}Installing system packages:${NC} ${missing_deps[*]}"
|
||||
sudo apt-get install -y "${missing_deps[@]}"
|
||||
echo -e "${GREEN}✓ System packages installed${NC}"
|
||||
fi
|
||||
|
||||
# Install Rust if missing
|
||||
if [ $RUST_MISSING -eq 1 ]; then
|
||||
echo -e "\n${YELLOW}Installing Rust...${NC}"
|
||||
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
|
||||
source "$HOME/.cargo/env"
|
||||
rustup default stable
|
||||
rustup update
|
||||
rustup target add wasm32-unknown-unknown
|
||||
echo -e "${GREEN}✓ Rust installed${NC}"
|
||||
else
|
||||
# Ensure wasm target is installed
|
||||
echo -e "\n${YELLOW}Ensuring wasm32-unknown-unknown target...${NC}"
|
||||
rustup target add wasm32-unknown-unknown 2>/dev/null || true
|
||||
fi
|
||||
|
||||
# Install Node.js if missing
|
||||
if [ $NODE_MISSING -eq 1 ]; then
|
||||
echo -e "\n${YELLOW}Installing Node.js...${NC}"
|
||||
curl -fsSL https://deb.nodesource.com/setup_20.x | sudo -E bash -
|
||||
sudo apt-get install -y nodejs
|
||||
echo -e "${GREEN}✓ Node.js installed${NC}"
|
||||
fi
|
||||
|
||||
echo -e "\n${GREEN}✓ All dependencies installed!${NC}"
|
||||
}
|
||||
|
||||
# Clone and build Pezkuwi-SDK
|
||||
setup_sdk() {
|
||||
print_header "Setting up Pezkuwi-SDK"
|
||||
|
||||
mkdir -p "$SHARED_DIR"
|
||||
cd "$SHARED_DIR"
|
||||
|
||||
if [ -d "Pezkuwi-SDK" ]; then
|
||||
echo -e "${YELLOW}Pezkuwi-SDK already exists. Updating...${NC}"
|
||||
cd Pezkuwi-SDK
|
||||
git fetch origin
|
||||
git pull origin main || git pull origin master
|
||||
else
|
||||
echo "Cloning Pezkuwi-SDK from GitHub..."
|
||||
# TODO: Replace with actual repository URL
|
||||
git clone https://github.com/YOUR_USERNAME/Pezkuwi-SDK.git
|
||||
cd Pezkuwi-SDK
|
||||
fi
|
||||
|
||||
echo -e "\n${YELLOW}Building Pezkuwi-SDK (Release mode)...${NC}"
|
||||
echo "This may take 15-30 minutes..."
|
||||
|
||||
# Build the node in release mode
|
||||
cargo build --release
|
||||
|
||||
echo -e "${GREEN}✓ Pezkuwi-SDK built successfully${NC}"
|
||||
}
|
||||
|
||||
# Clone and build DKSweb frontend
|
||||
setup_frontend() {
|
||||
print_header "Setting up DKSweb Frontend"
|
||||
|
||||
cd "$SHARED_DIR"
|
||||
|
||||
if [ -d "DKSweb" ]; then
|
||||
echo -e "${YELLOW}DKSweb already exists. Updating...${NC}"
|
||||
cd DKSweb
|
||||
git fetch origin
|
||||
git pull origin main || git pull origin master
|
||||
else
|
||||
echo "Cloning DKSweb from GitHub..."
|
||||
# TODO: Replace with actual repository URL
|
||||
git clone https://github.com/YOUR_USERNAME/DKSweb.git
|
||||
cd DKSweb
|
||||
fi
|
||||
|
||||
echo -e "\n${YELLOW}Installing frontend dependencies...${NC}"
|
||||
npm install
|
||||
|
||||
echo -e "\n${YELLOW}Building frontend...${NC}"
|
||||
npm run build
|
||||
|
||||
echo -e "${GREEN}✓ DKSweb frontend built successfully${NC}"
|
||||
}
|
||||
|
||||
# Configure validator-specific settings
|
||||
configure_validator() {
|
||||
print_header "Configuring Validator $VALIDATOR_NUM"
|
||||
|
||||
# Calculate ports (each validator gets 10 ports starting from base)
|
||||
BASE_PORT=$((30333 + ($VALIDATOR_NUM - 1) * 10))
|
||||
P2P_PORT=$BASE_PORT
|
||||
RPC_PORT=$((9944 + ($VALIDATOR_NUM - 1)))
|
||||
WS_PORT=$((9945 + ($VALIDATOR_NUM - 1)))
|
||||
PROMETHEUS_PORT=$((9615 + ($VALIDATOR_NUM - 1)))
|
||||
|
||||
echo "Validator $VALIDATOR_NUM ports:"
|
||||
echo " P2P Port: $P2P_PORT"
|
||||
echo " RPC Port: $RPC_PORT"
|
||||
echo " WebSocket Port: $WS_PORT"
|
||||
echo " Prometheus Port: $PROMETHEUS_PORT"
|
||||
|
||||
# Create validator config file
|
||||
CONFIG_FILE="$VALIDATOR_DIR/config/validator.conf"
|
||||
mkdir -p "$(dirname "$CONFIG_FILE")"
|
||||
|
||||
cat > "$CONFIG_FILE" << EOF
|
||||
# Validator $VALIDATOR_NUM Configuration
|
||||
VALIDATOR_NUM=$VALIDATOR_NUM
|
||||
VALIDATOR_NAME="validator-$VALIDATOR_NUM"
|
||||
P2P_PORT=$P2P_PORT
|
||||
RPC_PORT=$RPC_PORT
|
||||
WS_PORT=$WS_PORT
|
||||
PROMETHEUS_PORT=$PROMETHEUS_PORT
|
||||
DATA_DIR=$VALIDATOR_DIR/data
|
||||
KEYS_DIR=$VALIDATOR_DIR/keys
|
||||
LOGS_DIR=$VALIDATOR_DIR/logs
|
||||
SDK_PATH=$SHARED_DIR/Pezkuwi-SDK
|
||||
FRONTEND_PATH=$SHARED_DIR/DKSweb
|
||||
EOF
|
||||
|
||||
echo -e "${GREEN}✓ Configuration file created${NC}"
|
||||
|
||||
# Source the validator keys script if it exists
|
||||
KEYS_SCRIPT="$VALIDATOR_DIR/config/keys.sh"
|
||||
if [ -f "$KEYS_SCRIPT" ]; then
|
||||
echo -e "\n${YELLOW}Loading validator keys...${NC}"
|
||||
source "$KEYS_SCRIPT"
|
||||
echo -e "${GREEN}✓ Validator keys loaded${NC}"
|
||||
else
|
||||
echo -e "\n${YELLOW}Warning: No keys.sh found for validator $VALIDATOR_NUM${NC}"
|
||||
echo "Please create $KEYS_SCRIPT with validator keys"
|
||||
fi
|
||||
}
|
||||
|
||||
# Setup systemd service
|
||||
setup_service() {
|
||||
print_header "Setting up Systemd Service"
|
||||
|
||||
SERVICE_FILE="/etc/systemd/system/pezkuwi-validator-$VALIDATOR_NUM.service"
|
||||
|
||||
sudo tee "$SERVICE_FILE" > /dev/null << EOF
|
||||
[Unit]
|
||||
Description=Pezkuwi Validator $VALIDATOR_NUM
|
||||
After=network.target
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
User=$USER
|
||||
WorkingDirectory=$VALIDATOR_DIR
|
||||
EnvironmentFile=$VALIDATOR_DIR/config/validator.conf
|
||||
ExecStart=$SHARED_DIR/Pezkuwi-SDK/target/release/pezkuwi-node \\
|
||||
--base-path $VALIDATOR_DIR/data \\
|
||||
--chain local \\
|
||||
--validator \\
|
||||
--name validator-$VALIDATOR_NUM \\
|
||||
--port $P2P_PORT \\
|
||||
--rpc-port $RPC_PORT \\
|
||||
--ws-port $WS_PORT \\
|
||||
--prometheus-port $PROMETHEUS_PORT \\
|
||||
--rpc-cors all \\
|
||||
--ws-external \\
|
||||
--rpc-external
|
||||
Restart=always
|
||||
RestartSec=10
|
||||
StandardOutput=append:$VALIDATOR_DIR/logs/validator.log
|
||||
StandardError=append:$VALIDATOR_DIR/logs/validator-error.log
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
EOF
|
||||
|
||||
# Reload systemd
|
||||
sudo systemctl daemon-reload
|
||||
|
||||
echo -e "${GREEN}✓ Systemd service created${NC}"
|
||||
echo "Service name: pezkuwi-validator-$VALIDATOR_NUM"
|
||||
}
|
||||
|
||||
# Setup nginx for frontend
|
||||
setup_nginx() {
|
||||
print_header "Setting up Nginx"
|
||||
|
||||
NGINX_CONF="/etc/nginx/sites-available/pezkuwi-frontend"
|
||||
|
||||
if [ ! -f "$NGINX_CONF" ]; then
|
||||
sudo tee "$NGINX_CONF" > /dev/null << 'EOF'
|
||||
server {
|
||||
listen 80;
|
||||
listen [::]:80;
|
||||
server_name _;
|
||||
|
||||
root /home/$USER/pezkuwi-validator-v2.0.0/shared/DKSweb/dist;
|
||||
index index.html;
|
||||
|
||||
location / {
|
||||
try_files $uri $uri/ /index.html;
|
||||
}
|
||||
|
||||
location /api {
|
||||
proxy_pass http://localhost:9944;
|
||||
proxy_http_version 1.1;
|
||||
proxy_set_header Upgrade $http_upgrade;
|
||||
proxy_set_header Connection "upgrade";
|
||||
proxy_set_header Host $host;
|
||||
}
|
||||
}
|
||||
EOF
|
||||
|
||||
# Replace $USER with actual user
|
||||
sudo sed -i "s/\$USER/$USER/g" "$NGINX_CONF"
|
||||
|
||||
# Enable site
|
||||
sudo ln -sf "$NGINX_CONF" /etc/nginx/sites-enabled/
|
||||
|
||||
# Remove default site if exists
|
||||
sudo rm -f /etc/nginx/sites-enabled/default
|
||||
|
||||
# Test nginx configuration
|
||||
sudo nginx -t
|
||||
|
||||
# Restart nginx
|
||||
sudo systemctl restart nginx
|
||||
sudo systemctl enable nginx
|
||||
|
||||
echo -e "${GREEN}✓ Nginx configured and restarted${NC}"
|
||||
else
|
||||
echo -e "${YELLOW}Nginx already configured${NC}"
|
||||
fi
|
||||
}
|
||||
|
||||
# Setup automatic updates
|
||||
setup_auto_update() {
|
||||
print_header "Setting up Automatic Updates"
|
||||
|
||||
# Create update script
|
||||
UPDATE_SCRIPT="$SCRIPT_DIR/scripts/update.sh"
|
||||
mkdir -p "$SCRIPT_DIR/scripts"
|
||||
|
||||
cat > "$UPDATE_SCRIPT" << 'EOF'
|
||||
#!/bin/bash
|
||||
# Automatic update script for Pezkuwi validator
|
||||
|
||||
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||
SHARED_DIR="$SCRIPT_DIR/../shared"
|
||||
|
||||
echo "Checking for updates..."
|
||||
|
||||
# Update SDK
|
||||
cd "$SHARED_DIR/Pezkuwi-SDK"
|
||||
git fetch origin
|
||||
if [ $(git rev-parse HEAD) != $(git rev-parse @{u}) ]; then
|
||||
echo "SDK updates found. Rebuilding..."
|
||||
git pull
|
||||
cargo build --release
|
||||
echo "Restarting validators..."
|
||||
sudo systemctl restart pezkuwi-validator-*.service
|
||||
fi
|
||||
|
||||
# Update Frontend
|
||||
cd "$SHARED_DIR/DKSweb"
|
||||
git fetch origin
|
||||
if [ $(git rev-parse HEAD) != $(git rev-parse @{u}) ]; then
|
||||
echo "Frontend updates found. Rebuilding..."
|
||||
git pull
|
||||
npm install
|
||||
npm run build
|
||||
echo "Frontend updated"
|
||||
fi
|
||||
|
||||
echo "Update check complete"
|
||||
EOF
|
||||
|
||||
chmod +x "$UPDATE_SCRIPT"
|
||||
|
||||
# Setup cron job for automatic updates (daily at 2 AM)
|
||||
CRON_JOB="0 2 * * * $UPDATE_SCRIPT >> $SCRIPT_DIR/logs/auto-update.log 2>&1"
|
||||
|
||||
# Add to crontab if not already there
|
||||
(crontab -l 2>/dev/null | grep -v "$UPDATE_SCRIPT"; echo "$CRON_JOB") | crontab -
|
||||
|
||||
echo -e "${GREEN}✓ Automatic updates configured${NC}"
|
||||
echo "Updates will run daily at 2:00 AM"
|
||||
}
|
||||
|
||||
# Main setup function
|
||||
main() {
|
||||
print_header "Pezkuwi Validator Setup v2.0.0"
|
||||
|
||||
# Get validator number
|
||||
get_validator_number "$1"
|
||||
|
||||
# Check dependencies
|
||||
check_dependencies
|
||||
local dep_count=$?
|
||||
|
||||
# Install missing dependencies if any
|
||||
if [ $dep_count -gt 0 ] || [ $RUST_MISSING -eq 1 ] || [ $NODE_MISSING -eq 1 ]; then
|
||||
echo -e "\n${YELLOW}Some dependencies are missing. Installing...${NC}"
|
||||
install_dependencies
|
||||
else
|
||||
echo -e "\n${GREEN}✓ All dependencies already installed${NC}"
|
||||
fi
|
||||
|
||||
# Setup shared components (only if not already done)
|
||||
if [ ! -d "$SHARED_DIR/Pezkuwi-SDK/target/release" ]; then
|
||||
setup_sdk
|
||||
else
|
||||
echo -e "\n${GREEN}✓ SDK already built${NC}"
|
||||
fi
|
||||
|
||||
if [ ! -d "$SHARED_DIR/DKSweb/dist" ]; then
|
||||
setup_frontend
|
||||
else
|
||||
echo -e "\n${GREEN}✓ Frontend already built${NC}"
|
||||
fi
|
||||
|
||||
# Configure validator
|
||||
configure_validator
|
||||
|
||||
# Setup service
|
||||
setup_service
|
||||
|
||||
# Setup nginx (only once for all validators)
|
||||
setup_nginx
|
||||
|
||||
# Setup automatic updates
|
||||
setup_auto_update
|
||||
|
||||
# Final instructions
|
||||
print_header "Setup Complete!"
|
||||
|
||||
echo -e "${GREEN}Validator $VALIDATOR_NUM is ready!${NC}\n"
|
||||
echo "Next steps:"
|
||||
echo "1. Start the validator:"
|
||||
echo -e " ${BLUE}sudo systemctl start pezkuwi-validator-$VALIDATOR_NUM${NC}"
|
||||
echo ""
|
||||
echo "2. Check validator status:"
|
||||
echo -e " ${BLUE}sudo systemctl status pezkuwi-validator-$VALIDATOR_NUM${NC}"
|
||||
echo ""
|
||||
echo "3. View logs:"
|
||||
echo -e " ${BLUE}tail -f $VALIDATOR_DIR/logs/validator.log${NC}"
|
||||
echo ""
|
||||
echo "4. Access frontend:"
|
||||
echo -e " ${BLUE}http://YOUR_SERVER_IP${NC}"
|
||||
echo ""
|
||||
echo "5. Enable auto-start on boot:"
|
||||
echo -e " ${BLUE}sudo systemctl enable pezkuwi-validator-$VALIDATOR_NUM${NC}"
|
||||
echo ""
|
||||
echo -e "${YELLOW}Note: Make sure to add validator keys to:${NC}"
|
||||
echo -e "${YELLOW}$VALIDATOR_DIR/config/keys.sh${NC}"
|
||||
}
|
||||
|
||||
# Run main function
|
||||
main "$@"
|
||||
Executable
+40
@@ -0,0 +1,40 @@
|
||||
#!/bin/bash
|
||||
|
||||
# ========================================
|
||||
# Validator 1 - Real Beta Testnet Keys
|
||||
# ========================================
|
||||
# Generated from actual running beta testnet
|
||||
# Validator Name: Validator-beta-1 (Bootnode)
|
||||
# RPC Port: 9944
|
||||
# P2P Port: 30333
|
||||
|
||||
# BABE Keys (Block Authorship)
|
||||
export BABE_SEED="state open glance maze canyon cable cargo parent blind mystery cheese foot"
|
||||
export BABE_PUBLIC_KEY="0x9e7490cfe0dd32860282dd4e74b5c40c9237fb6e478066c334c931742308e008"
|
||||
|
||||
# GRANDPA Keys (Finality)
|
||||
export GRAN_SEED="kick surge tube arrange enforce witness mouse spray disease inquiry inch stamp"
|
||||
export GRAN_PUBLIC_KEY="0x16da26f049b37e9b03d14439457ac164f14f5174b1f10ddab2e0dc3ef7903675"
|
||||
|
||||
# PARA Keys (Parachain)
|
||||
export PARA_SEED="march cancel try improve lunch phrase rebuild initial theme snap giant dry"
|
||||
export PARA_PUBLIC_KEY="0xc62b764ea84411f550818a41a6abacddb9388cefbc22412f2bee335e9709a717"
|
||||
|
||||
# ASGN Keys (Assignment)
|
||||
export ASGN_SEED="nephew dignity smoke sunny access soon breeze inch dove park fault museum"
|
||||
export ASGN_PUBLIC_KEY="0xa4c75d886439ae7d764cc600051af1d2128d2a8a1cdf3d642eda76824ccaf518"
|
||||
|
||||
# AUDI Keys (Authority Discovery)
|
||||
export AUDI_SEED="vicious mixed hour wage clog yellow elbow zoo clock better rhythm diagram"
|
||||
export AUDI_PUBLIC_KEY="0x66e821a23729878d8b7d04c69ec0fed9b0f5facae48917c1b83a4ad15cf00720"
|
||||
|
||||
# BEEF Keys (BEEFY)
|
||||
export BEEF_SEED="practice cable fog idea rigid hybrid digital snack setup right advance romance"
|
||||
export BEEF_PUBLIC_KEY="0x0281ba169080b261add0cd22bfb47477eddab854caa17423b12ddeed6504b04aef"
|
||||
|
||||
# Validator Configuration
|
||||
export VALIDATOR_NAME="Validator-beta-1"
|
||||
export RPC_PORT=9944
|
||||
export P2P_PORT=30333
|
||||
export WS_PORT=9944
|
||||
export PROMETHEUS_PORT=9615
|
||||
Executable
+39
@@ -0,0 +1,39 @@
|
||||
#!/bin/bash
|
||||
|
||||
# ========================================
|
||||
# Validator 2 - Real Beta Testnet Keys
|
||||
# ========================================
|
||||
# Validator Name: Validator-beta-2
|
||||
# RPC Port: 9945
|
||||
# P2P Port: 30334
|
||||
|
||||
# BABE Keys (Block Authorship)
|
||||
export BABE_SEED="nature pink baby physical hotel dirt soon meadow coin employ enroll remind"
|
||||
export BABE_PUBLIC_KEY="0xbef3df377441fe6ad64b81e84c8d201bc5c0bc2bb2e1a85f1e84927c62c5572b"
|
||||
|
||||
# GRANDPA Keys (Finality)
|
||||
export GRAN_SEED="rent little raven auction error goat error water twice defy hard slab"
|
||||
export GRAN_PUBLIC_KEY="0x806cfed7a6d025bc2e7a195bcd5ac50317f824ce6971cf30f95c6a621d6e55bf"
|
||||
|
||||
# PARA Keys (Parachain)
|
||||
export PARA_SEED="mystery rescue elbow update effort path sleep rather deer undo school size"
|
||||
export PARA_PUBLIC_KEY="0xfca6fd2976ae3ea397b15cdc5b0b044fe90a2094328edfa013db80cf04ba1a67"
|
||||
|
||||
# ASGN Keys (Assignment)
|
||||
export ASGN_SEED="curious step vast scan couch episode maid trap crazy swap junior slab"
|
||||
export ASGN_PUBLIC_KEY="0xfaad0803c450bf084ca3035bd1d69481db58444b32dd0eaa55de69a5314b0559"
|
||||
|
||||
# AUDI Keys (Authority Discovery)
|
||||
export AUDI_SEED="race frequent goose clean labor differ credit lawn lab risk ocean black"
|
||||
export AUDI_PUBLIC_KEY="0x7aeed77ed10108ead6c58dd45dd987aba28ea6e9cdf90f8893112c08bb0d4251"
|
||||
|
||||
# BEEF Keys (BEEFY)
|
||||
export BEEF_SEED="industry flush stairs zoo world width dentist special life retire suffer myth"
|
||||
export BEEF_PUBLIC_KEY="0x020177ca58f45047c737e6e02adba1ac3520eb881ea38ad39751d32d7c89d5efaa"
|
||||
|
||||
# Validator Configuration
|
||||
export VALIDATOR_NAME="Validator-beta-2"
|
||||
export RPC_PORT=9945
|
||||
export P2P_PORT=30334
|
||||
export WS_PORT=9945
|
||||
export PROMETHEUS_PORT=9616
|
||||
Executable
+39
@@ -0,0 +1,39 @@
|
||||
#!/bin/bash
|
||||
|
||||
# ========================================
|
||||
# Validator 3 - Real Beta Testnet Keys
|
||||
# ========================================
|
||||
# Validator Name: Validator-beta-3
|
||||
# RPC Port: 9946
|
||||
# P2P Port: 30335
|
||||
|
||||
# BABE Keys (Block Authorship)
|
||||
export BABE_SEED="cycle judge gentle cute spirit crunch build flee popular cube wagon void"
|
||||
export BABE_PUBLIC_KEY="0x2825cb78cb345b078a189e6a280916f7771df991113e587b9a0694df33abe909"
|
||||
|
||||
# GRANDPA Keys (Finality)
|
||||
export GRAN_SEED="prefer sugar friend wagon about love blouse coast table future lonely slice"
|
||||
export GRAN_PUBLIC_KEY="0xcf2862bbfabf42dfc361e2fd0ee860e55e80f093ad767679d9687e822a04c7a4"
|
||||
|
||||
# PARA Keys (Parachain)
|
||||
export PARA_SEED="where reject camp tail clock plate library apple draw once float ranch"
|
||||
export PARA_PUBLIC_KEY="0x4cdb404f66b7409a6e7fee2eab92aa738c8cbd37d1343b0e0818deb4637d3e0e"
|
||||
|
||||
# ASGN Keys (Assignment)
|
||||
export ASGN_SEED="craft hill receive alarm inner use cereal assume boost castle enhance culture"
|
||||
export ASGN_PUBLIC_KEY="0xf054e7834c042696fbbf56d17247924836a6957cc6ec8366455c9b459b51fa4d"
|
||||
|
||||
# AUDI Keys (Authority Discovery)
|
||||
export AUDI_SEED="fatal hazard federal cushion cousin spend weapon script boil vicious delay fire"
|
||||
export AUDI_PUBLIC_KEY="0xd2c4ffc56fd8504f5fde789d3ba895f65c0c7200f68cfe789a4316e68277e72f"
|
||||
|
||||
# BEEF Keys (BEEFY)
|
||||
export BEEF_SEED="kiss foil assist bind duty concert van fold reveal weird design rescue"
|
||||
export BEEF_PUBLIC_KEY="0x023792b160a004c98d56afc29843ee9aa567a80129794373df9b3f4d883cfd4dfc"
|
||||
|
||||
# Validator Configuration
|
||||
export VALIDATOR_NAME="Validator-beta-3"
|
||||
export RPC_PORT=9946
|
||||
export P2P_PORT=30335
|
||||
export WS_PORT=9946
|
||||
export PROMETHEUS_PORT=9617
|
||||
Executable
+39
@@ -0,0 +1,39 @@
|
||||
#!/bin/bash
|
||||
|
||||
# ========================================
|
||||
# Validator 4 - Real Beta Testnet Keys
|
||||
# ========================================
|
||||
# Validator Name: Validator-beta-4
|
||||
# RPC Port: 9947
|
||||
# P2P Port: 30336
|
||||
|
||||
# BABE Keys (Block Authorship)
|
||||
export BABE_SEED="evoke second recipe turn salad warfare mix sense cry impact demise avocado"
|
||||
export BABE_PUBLIC_KEY="0x9236bf5cde2e1ce44cd2eceece98b876750cb39a8887bcc1d7c0b72c186b4f6c"
|
||||
|
||||
# GRANDPA Keys (Finality)
|
||||
export GRAN_SEED="sea resemble monitor fetch quit cotton amused settle limit venue frequent electric"
|
||||
export GRAN_PUBLIC_KEY="0x4d7787f6d6b189b64286efdf524a5d73be1eaf4a4b1d245529090b698285a0d4"
|
||||
|
||||
# PARA Keys (Parachain)
|
||||
export PARA_SEED="rubber decorate coyote grass solar butter melt ginger smile flush dash monitor"
|
||||
export PARA_PUBLIC_KEY="0xb27fea579fdc321ebac8975717c17a7b4036bb06549c41ac803c888b9104a256"
|
||||
|
||||
# ASGN Keys (Assignment)
|
||||
export ASGN_SEED="tomato glad flower miracle duty hundred filter gain clay butter twist chronic"
|
||||
export ASGN_PUBLIC_KEY="0x9ef9bf97dfc3d22cd4e17a331165afbf0a562a9a86e776592c64ba87c4162d0a"
|
||||
|
||||
# AUDI Keys (Authority Discovery)
|
||||
export AUDI_SEED="group trial problem lesson angle grief agent harvest pattern identify approve security"
|
||||
export AUDI_PUBLIC_KEY="0x6abffb32a990117c3d8c74f090b287d5888af97b61a3964a2c54cddc614e4d71"
|
||||
|
||||
# BEEF Keys (BEEFY)
|
||||
export BEEF_SEED="ridge way rhythm renew mix city element obtain prepare glass exist hope"
|
||||
export BEEF_PUBLIC_KEY="0x02ca2cac4bd7d21c1c3f7b256233827d8546471d83e1eeb37408767adc66bac7d0"
|
||||
|
||||
# Validator Configuration
|
||||
export VALIDATOR_NAME="Validator-beta-4"
|
||||
export RPC_PORT=9947
|
||||
export P2P_PORT=30336
|
||||
export WS_PORT=9947
|
||||
export PROMETHEUS_PORT=9618
|
||||
Executable
+39
@@ -0,0 +1,39 @@
|
||||
#!/bin/bash
|
||||
|
||||
# ========================================
|
||||
# Validator 5 - Real Beta Testnet Keys
|
||||
# ========================================
|
||||
# Validator Name: Validator-beta-5
|
||||
# RPC Port: 9948
|
||||
# P2P Port: 30337
|
||||
|
||||
# BABE Keys (Block Authorship)
|
||||
export BABE_SEED="clap screen soap once near guilt accuse hamster knife drink purity skull"
|
||||
export BABE_PUBLIC_KEY="0x74270a49be316a233279af6480ac8de5479bc45426e884fbdb50c6247e62d44b"
|
||||
|
||||
# GRANDPA Keys (Finality)
|
||||
export GRAN_SEED="innocent fix endless engine yellow smoke venture answer before dentist trend pulse"
|
||||
export GRAN_PUBLIC_KEY="0x9ae1139d89f5ae5e9a56a7a7d1375c49b742315c25712128fad16c841da2dba9"
|
||||
|
||||
# PARA Keys (Parachain)
|
||||
export PARA_SEED="peanut catch embody spy orbit design occur series cricket ski ketchup impose"
|
||||
export PARA_PUBLIC_KEY="0xf49d1b0ebff5fbf31cba037085552fd78e4218a19045cdd5f2e1f73840156a75"
|
||||
|
||||
# ASGN Keys (Assignment)
|
||||
export ASGN_SEED="orchard globe member blue install rude cement luxury grant cause exit expect"
|
||||
export ASGN_PUBLIC_KEY="0xb8f786ac5db52f3713ca1ff58f8d708332f2c0556d55a62195a52d4ca1bb2e7e"
|
||||
|
||||
# AUDI Keys (Authority Discovery)
|
||||
export AUDI_SEED="pistol focus above decade weekend matter claw drift glad worry quarter slice"
|
||||
export AUDI_PUBLIC_KEY="0x3e1c338ba320b747769d2d40ece3fc3da306b90096ab381bad1be6bc5a813d57"
|
||||
|
||||
# BEEF Keys (BEEFY)
|
||||
export BEEF_SEED="mother model label zoo mouse detail cost pet umbrella rate proud unable"
|
||||
export BEEF_PUBLIC_KEY="0x033cae08ede6b1c3597dfce1f38c5ceddc4b69d045de4b51f17e2e8fce1cda27ca"
|
||||
|
||||
# Validator Configuration
|
||||
export VALIDATOR_NAME="Validator-beta-5"
|
||||
export RPC_PORT=9948
|
||||
export P2P_PORT=30337
|
||||
export WS_PORT=9948
|
||||
export PROMETHEUS_PORT=9619
|
||||
Executable
+39
@@ -0,0 +1,39 @@
|
||||
#!/bin/bash
|
||||
|
||||
# ========================================
|
||||
# Validator 6 - Real Beta Testnet Keys
|
||||
# ========================================
|
||||
# Validator Name: Validator-beta-6
|
||||
# RPC Port: 9949
|
||||
# P2P Port: 30338
|
||||
|
||||
# BABE Keys (Block Authorship)
|
||||
export BABE_SEED="tired youth educate hover cross plastic gate giraffe gorilla rescue section idle"
|
||||
export BABE_PUBLIC_KEY="0xf4fc5deb49aa9178f622e711a9d453d967507231a6e2d62d726ce7279316970a"
|
||||
|
||||
# GRANDPA Keys (Finality)
|
||||
export GRAN_SEED="hedgehog isolate jump safe march fame year mosquito smooth lunch portion solution"
|
||||
export GRAN_PUBLIC_KEY="0x7eb7cfb7ac00f11ed7f63697cdb5d0562bba6b90c1901fa00365db075bab05e9"
|
||||
|
||||
# PARA Keys (Parachain)
|
||||
export PARA_SEED="industry thank parade tiger reunion usual kidney high beef divide jaguar smile"
|
||||
export PARA_PUBLIC_KEY="0x5a3fa17b77d3afc3dd1e0b7bf1d2faf95ba14eb2ee370476e5f2f78a8175a957"
|
||||
|
||||
# ASGN Keys (Assignment)
|
||||
export ASGN_SEED="cluster outdoor denial disorder donor rich senior glance display barrel theory pupil"
|
||||
export ASGN_PUBLIC_KEY="0x4e232e6efb3be2c4f638fac57330f606fc54bbc3b8d490a5bb520c67c0d7f248"
|
||||
|
||||
# AUDI Keys (Authority Discovery)
|
||||
export AUDI_SEED="supreme warfare trust assault where model grain advice broccoli nothing key embody"
|
||||
export AUDI_PUBLIC_KEY="0x244d0ea5c6b4a4f4e23912aab77498689e9f355edb63a82ebfc9b9bb08176f0d"
|
||||
|
||||
# BEEF Keys (BEEFY)
|
||||
export BEEF_SEED="cloth lock grocery actor trend patch grace salad fun mass plate notice"
|
||||
export BEEF_PUBLIC_KEY="0x0338f2ef200a5048b35fcfae936a2dd5dffdabc77eb61d707de35f9eba8b3d37e3"
|
||||
|
||||
# Validator Configuration
|
||||
export VALIDATOR_NAME="Validator-beta-6"
|
||||
export RPC_PORT=9949
|
||||
export P2P_PORT=30338
|
||||
export WS_PORT=9949
|
||||
export PROMETHEUS_PORT=9620
|
||||
Executable
+39
@@ -0,0 +1,39 @@
|
||||
#!/bin/bash
|
||||
|
||||
# ========================================
|
||||
# Validator 7 - Real Beta Testnet Keys
|
||||
# ========================================
|
||||
# Validator Name: Validator-beta-7
|
||||
# RPC Port: 9950
|
||||
# P2P Port: 30339
|
||||
|
||||
# BABE Keys (Block Authorship)
|
||||
export BABE_SEED="pave mixed faith vivid nice trust exercise public kind afford fury army"
|
||||
export BABE_PUBLIC_KEY="0x6898b08fe0c6dfe79750598765efe06cbfaef01da9b110599d05a5b4824ddf38"
|
||||
|
||||
# GRANDPA Keys (Finality)
|
||||
export GRAN_SEED="cliff entire pause adjust parent tissue enhance weasel east pink art meat"
|
||||
export GRAN_PUBLIC_KEY="0x57f18c1620086209773c6d8243af3eae873a63cda0c64cc3bcb02ff3ee41a863"
|
||||
|
||||
# PARA Keys (Parachain)
|
||||
export PARA_SEED="return diet teach excess under warm veteran pride exotic talk exhaust mobile"
|
||||
export PARA_PUBLIC_KEY="0x1e0ee1b33614379148cd69bb79fb2d21c98a8837bab912e96b72e5a2bbb46d01"
|
||||
|
||||
# ASGN Keys (Assignment)
|
||||
export ASGN_SEED="gown differ atom rebuild observe museum word nest upset large boring exact"
|
||||
export ASGN_PUBLIC_KEY="0x48f66d8b963b576da719b2350a0242c624b720439ed764c206107647d8a6d872"
|
||||
|
||||
# AUDI Keys (Authority Discovery)
|
||||
export AUDI_SEED="artwork town pyramid stumble sugar neither clutch void soon wine slab slide"
|
||||
export AUDI_PUBLIC_KEY="0xe462edbb26c14d1772570ce751ace21b271b0f0f472fc434c84f708b9bb42309"
|
||||
|
||||
# BEEF Keys (BEEFY)
|
||||
export BEEF_SEED="curious abstract home session famous canvas spin forest wing appear warm install"
|
||||
export BEEF_PUBLIC_KEY="0x03e783496d6ff583a60ec44ef9fe7ea375c9e31841a1f7fe48a8eaec0093826d78"
|
||||
|
||||
# Validator Configuration
|
||||
export VALIDATOR_NAME="Validator-beta-7"
|
||||
export RPC_PORT=9950
|
||||
export P2P_PORT=30339
|
||||
export WS_PORT=9950
|
||||
export PROMETHEUS_PORT=9621
|
||||
Executable
+39
@@ -0,0 +1,39 @@
|
||||
#!/bin/bash
|
||||
|
||||
# ========================================
|
||||
# Validator 8 - Real Beta Testnet Keys
|
||||
# ========================================
|
||||
# Validator Name: Validator-beta-8
|
||||
# RPC Port: 9951
|
||||
# P2P Port: 30340
|
||||
|
||||
# BABE Keys (Block Authorship)
|
||||
export BABE_SEED="clinic father over industry blame coast trophy walnut panel giant barely aunt"
|
||||
export BABE_PUBLIC_KEY="0x520e1de89062667c8980666fd8cc83914d43ce5dd69fa4db2bec7a23bec16e61"
|
||||
|
||||
# GRANDPA Keys (Finality)
|
||||
export GRAN_SEED="invite mule belt fix risk piece grant benefit type park best aisle"
|
||||
export GRAN_PUBLIC_KEY="0x7bab34ff06d0e24da37e861bc9683381934e390febe05cec2060b5d4b9c8d746"
|
||||
|
||||
# PARA Keys (Parachain)
|
||||
export PARA_SEED="close render flip cable sail drop job drum kiss brief corn wild"
|
||||
export PARA_PUBLIC_KEY="0x4e169330a7089ffc0be8f85edb9b5c35556bee1a0111f14dc7ee00cd43478232"
|
||||
|
||||
# ASGN Keys (Assignment)
|
||||
export ASGN_SEED="pipe crack swing minimum supply divide tenant solution foil prevent depend wedding"
|
||||
export ASGN_PUBLIC_KEY="0xdc8556675a56246d3227c4544e58a602df65b154e09086c0b2b0aa879dfab249"
|
||||
|
||||
# AUDI Keys (Authority Discovery)
|
||||
export AUDI_SEED="faint tunnel east jeans raise bundle grief unaware gospel solar dish number"
|
||||
export AUDI_PUBLIC_KEY="0x1ec224f7441c0f95d817ccbf0cce3d1cdbd0ffb0f8169654672570dbd6e66608"
|
||||
|
||||
# BEEF Keys (BEEFY)
|
||||
export BEEF_SEED="live impact struggle furnace sentence sail true spin waste museum symbol able"
|
||||
export BEEF_PUBLIC_KEY="0x030bd33780a8a632630c3dd75624c4e6d1ff3fdfa58d88ddebe087e237cc0cd11d"
|
||||
|
||||
# Validator Configuration
|
||||
export VALIDATOR_NAME="Validator-beta-8"
|
||||
export RPC_PORT=9951
|
||||
export P2P_PORT=30340
|
||||
export WS_PORT=9951
|
||||
export PROMETHEUS_PORT=9622
|
||||
Reference in New Issue
Block a user