Setting up a Validator Node

This guide will walk you through the process of setting up and running a Trunk validator node. Validators play a crucial role in the Trunk network by verifying and processing transactions.

Prerequisites

Before you begin, ensure you have the following installed:

Quick Start

Follow these steps to get your validator node up and running:

  1. Clone the Trunk Network repository:
git clone https://github.com/trunk/network.git
cd network
  1. Install dependencies:
npm install
  1. Configure your validator:
cp .env.example .env

Edit the .env file and set your validator configuration:

VALIDATOR_NAME=my-validator
VALIDATOR_PORT=8545
NETWORK_ENV=testnet
  1. Start the validator:
npm run validator:serve

Your validator should now be running and connecting to the Trunk network.

Configuration Options

The following configuration options are available in the .env file:

OptionDescriptionDefault
VALIDATOR_NAMEUnique name for your validatorvalidator
VALIDATOR_PORTPort to run the validator on8545
NETWORK_ENVNetwork environment (mainnet/testnet)testnet
LOG_LEVELLogging verbosityinfo

Monitoring

Once your validator is running, you can monitor its status:

  1. View validator logs:
npm run validator:logs
  1. Check validator status:
npm run validator:status
  1. View network metrics at http://localhost:8545/metrics

Best Practices

  • Regularly update your validator software
  • Monitor system resources
  • Use secure credentials
  • Maintain good network connectivity
  • Back up your validator configuration

Troubleshooting

Common issues and solutions:

Validator Won’t Start

  • Check if the port is already in use
  • Verify Node.js version
  • Ensure all dependencies are installed

Network Connection Issues

  • Check your firewall settings
  • Verify network configuration
  • Ensure your node can reach other network peers

Performance Issues

  • Monitor system resources
  • Check log files for errors
  • Verify hardware meets minimum requirements

Next Steps

Support

If you need help with your validator setup: