Validator Kit Development Guide
The Mezo Validator Kit provides a comprehensive solution for running Mezo nodes, including validators, RPC nodes, and seed nodes. This guide covers setup, configuration, and maintenance of Mezo infrastructure.
Overview
Section titled “Overview”The Validator Kit simplifies the deployment of Mezo nodes with multiple deployment options:
- Docker: Containerized deployment
- Native Daemon: Direct system installation
- Kubernetes: Helm charts for orchestration
- Cloud Deployment: AWS, GCP, Azure support
Node Types
Section titled “Node Types”- Validator Nodes: Participate in consensus and block production
- RPC Nodes: Provide API endpoints for dApps
- Seed Nodes: Help bootstrap the network
Repository Structure
Section titled “Repository Structure”The Validator Kit repository includes:
- Docker Configuration: Container setup and orchestration
- Kubernetes Manifests: Helm charts and K8s resources
- Configuration Templates: Node configuration files
- Monitoring: Prometheus, Grafana, and alerting
- Scripts: Automation and maintenance tools
Hardware Requirements
Section titled “Hardware Requirements”Minimum Requirements
Section titled “Minimum Requirements”Validator Node:
- CPU: 4 cores
- RAM: 8GB
- Storage: 100GB SSD
- Network: 100 Mbps
RPC Node:
- CPU: 2 cores
- RAM: 4GB
- Storage: 50GB SSD
- Network: 50 Mbps
Seed Node:
- CPU: 1 core
- RAM: 2GB
- Storage: 20GB SSD
- Network: 10 Mbps
Recommended Requirements
Section titled “Recommended Requirements”Validator Node:
- CPU: 8 cores
- RAM: 16GB
- Storage: 500GB NVMe SSD
- Network: 1 Gbps
Installation Methods
Section titled “Installation Methods”Docker Deployment
Section titled “Docker Deployment”-
Clone Repository:
Terminal window git clone https://github.com/mezo-org/validator-kit.gitcd validator-kit -
Configure Environment:
Terminal window cp .env.example .env# Edit .env with your configuration -
Start Node:
Terminal window docker-compose up -d
Native Installation
Section titled “Native Installation”-
Install Dependencies:
Terminal window # Ubuntu/Debiansudo apt updatesudo apt install -y curl git make build-essential# Install Gocurl -fsSL https://go.dev/dl/go1.21.0.linux-amd64.tar.gz | sudo tar -xzC /usr/local -
Build Mezod:
Terminal window git clone https://github.com/mezo-org/mezod.gitcd mezodmake build -
Configure Node:
Terminal window ./mezod init mynode --chain-id mezo-testnet
Kubernetes Deployment
Section titled “Kubernetes Deployment”-
Install Helm:
Terminal window curl https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3 | bash -
Deploy with Helm:
Terminal window helm install mezo-node ./helm/mezo-node \--set node.type=validator \--set node.name=my-validator
Configuration
Section titled “Configuration”Node Configuration
Section titled “Node Configuration”config.toml:
[consensus]timeout_commit = "1s"timeout_propose = "3s"
[p2p]laddr = "tcp://0.0.0.0:26656"external_address = "YOUR_EXTERNAL_IP:26656"persistent_peers = "peer1@ip1:26656,peer2@ip2:26656"app.toml:
[api]enable = trueaddress = "tcp://0.0.0.0:1317"
[grpc]enable = trueaddress = "0.0.0.0:9090"
[evm]rpc_address = "0.0.0.0:8545"ws_address = "0.0.0.0:8546"Environment Variables
Section titled “Environment Variables”# Node configurationNODE_TYPE=validatorCHAIN_ID=mezo-mainnetMONIKER=my-validator
# Network configurationP2P_PORT=26656RPC_PORT=26657API_PORT=1317GRPC_PORT=9090EVM_RPC_PORT=8545
# SecurityPRIV_VALIDATOR_KEY_FILE=/config/priv_validator_key.jsonNODE_KEY_FILE=/config/node_key.jsonValidator Setup
Section titled “Validator Setup”Prerequisites
Section titled “Prerequisites”- Proof of Authority (PoA): Apply for validator status
- Stake Requirements: Minimum stake amount
- Technical Requirements: Meet hardware specifications
Validator Configuration
Section titled “Validator Configuration”# Initialize validator./mezod init validator --chain-id mezo-mainnet
# Create validator key./mezod keys add validator --keyring-backend file
# Create validator transaction./mezod tx staking create-validator \ --amount=1000000umezo \ --pubkey=$(./mezod tendermint show-validator) \ --moniker="My Validator" \ --chain-id=mezo-mainnet \ --from=validatorRPC Node Setup
Section titled “RPC Node Setup”Purpose
Section titled “Purpose”RPC nodes provide:
- API Endpoints: REST and gRPC APIs
- EVM RPC: Ethereum-compatible JSON-RPC
- WebSocket: Real-time data streams
- Load Balancing: Distribute traffic across nodes
Configuration
Section titled “Configuration”version: '3.8'services: rpc-node: image: mezod:latest ports: - "26657:26657" # Tendermint RPC - "1317:1317" # Cosmos API - "9090:9090" # gRPC - "8545:8545" # EVM RPC environment: - NODE_TYPE=rpc - CHAIN_ID=mezo-mainnet volumes: - ./data:/root/.mezodMonitoring and Observability
Section titled “Monitoring and Observability”Prometheus Configuration
Section titled “Prometheus Configuration”global: scrape_interval: 15s
scrape_configs: - job_name: 'mezod' static_configs: - targets: ['localhost:26660'] metrics_path: /metricsGrafana Dashboards
Section titled “Grafana Dashboards”Key metrics to monitor:
- Block Height: Current blockchain height
- Validator Status: Active/inactive status
- Network Connectivity: Peer connections
- Resource Usage: CPU, memory, disk
- Transaction Throughput: TPS metrics
Alerting Rules
Section titled “Alerting Rules”groups: - name: mezod rules: - alert: NodeDown expr: up{job="mezod"} == 0 for: 1m labels: severity: critical annotations: summary: "Mezod node is down"Security Best Practices
Section titled “Security Best Practices”Network Security
Section titled “Network Security”- Firewall Configuration:
# Allow only necessary portsufw allow 26656/tcp # P2Pufw allow 26657/tcp # RPCufw allow 1317/tcp # APIufw allow 8545/tcp # EVM RPC- Access Control:
# Restrict RPC accessiptables -A INPUT -p tcp --dport 26657 -s TRUSTED_IP -j ACCEPTiptables -A INPUT -p tcp --dport 26657 -j DROPKey Management
Section titled “Key Management”- Secure Storage: Use hardware security modules (HSM)
- Backup Strategy: Regular key backups
- Access Control: Limit key access permissions
Important: Never commit validator keys to version control!
Maintenance
Section titled “Maintenance”Regular Tasks
Section titled “Regular Tasks”- Software Updates:
# Update mezodgit pull origin mainmake buildsystemctl restart mezod- Database Maintenance:
# Prune old data (use with caution)./mezod tendermint unsafe-reset-all- Log Rotation:
# Configure logrotatecat > /etc/logrotate.d/mezod << EOF/var/log/mezod/*.log { daily rotate 7 compress delaycompress missingok notifempty}EOFBackup Strategy
Section titled “Backup Strategy”- Configuration Backup:
tar -czf config-backup.tar.gz ~/.mezod/config/- Key Backup (store securely):
# Backup validator keys to secure locationcp ~/.mezod/config/priv_validator_key.json /secure/backup/Troubleshooting
Section titled “Troubleshooting”Common Issues
Section titled “Common Issues”- Sync Issues:
# Check sync status./mezod status
# Reset and resync./mezod tendermint unsafe-reset-all- Connection Problems:
# Check peer connections./mezod tendermint show-node-id
# Update persistent peers in config.toml- Performance Issues:
# Monitor resource usagehtopiotopnetstat -tulpnDebug Commands
Section titled “Debug Commands”# View logsjournalctl -u mezod -f
# Check node status./mezod status
# View configuration./mezod config
# Test RPC endpointscurl http://localhost:26657/statusDevelopment Integration
Section titled “Development Integration”Local Development
Section titled “Local Development”- Start Local Node:
docker-compose -f docker-compose.dev.yml up- Connect dApp:
const provider = new ethers.JsonRpcProvider('http://localhost:8545');Testing Environment
Section titled “Testing Environment”- Testnet Node:
./mezod init testnode --chain-id mezo-testnet- Integration Tests:
npm testAdditional Resources
Section titled “Additional Resources”- Validator Kit Repository - Main repository
- Mezod Repository - Chain client
- Mezo Nodes Documentation - Node operations
- Docker Documentation - Docker reference
- Kubernetes Documentation - K8s reference
Support
Section titled “Support”For validator support:
- Join the Mezo Discord
- Check the GitHub Issues
- Review the FAQ