Before setting up your Kwil validator node, ensure you have the following:
- Operating System: Linux-based OS (Ubuntu 20.04+ preferred)
- CPU: 4+ cores
- RAM: 8 GB or higher
- Storage: SSD with at least 200 GB free space
- Network: Stable internet connection with at least 1 Gbps bandwidth
- Docker and Docker Compose installed
- Git
- Basic familiarity with Linux terminal commands
First, update your system and install required dependencies.
sudo apt update && sudo apt upgrade -y
sudo apt install -y curl git docker.io docker-composeVerify that Docker is installed and running:
docker --version
sudo systemctl enable docker
sudo systemctl start dockerKwil provides the necessary code to run a node through its GitHub repository. Clone the repository:
git clone https://github.com/kwil-team/kwil-node.git
cd kwil-nodeTo run a validator, you’ll need a public-private key pair. The public key is used to register your validator on the network, while the private key is used to sign blocks.
Kwil provides a tool for generating keys. Run the following command to create your key pair:
docker run -it --rm kwil/kwil-node generate-keysThis will output a public key and a private key. Save these keys securely. Do not share your private key.
The kwil-node repository includes a default configuration file. You will need to edit it to include your public key and other settings.
Open the configuration file:
nano config/config.yamlUpdate the following fields:
public_key: Add your validator's public key here.network: Choose the appropriate network (mainnet,testnet, ordevnet).port: Ensure the port you choose is open and not in use by another application.
Save and exit the file (Ctrl+O, then Ctrl+X).
Use Docker Compose to build and run the node:
docker-compose up --build -dThis command will:
- Build the Docker container for the Kwil validator.
- Start the validator node in the background.
To ensure your node is running correctly, check the logs:
docker logs -f kwil-nodeLook for messages indicating successful connection to peers and block validation activity.
Once your node is operational, register it with the Kwil network.
- Visit the Kwil dashboard or CLI interface for validator registration.
- Provide your public key, node's IP address, and port.
- Follow the prompts to complete registration.
Running a validator node requires consistent monitoring to ensure uptime and performance. Use the following commands to manage your node:
docker psdocker-compose restartWhen a new version of the Kwil software is released, update your node by pulling the latest changes and rebuilding the Docker image:
git pull
docker-compose down
docker-compose up --build -ddocker logs -f kwil-nodeFor a professional validator setup, integrate monitoring tools such as Prometheus and Grafana. Kwil may provide prebuilt dashboards for tracking node performance.
Here are common issues you might encounter and how to resolve them:
-
Port Unavailable: Ensure the port specified in
config.yamlis open usingufwor another firewall tool.sudo ufw allow <port>
-
Syncing Issues: If your node cannot sync, ensure your configuration matches the correct network (mainnet/testnet).
-
High Resource Usage: Verify your hardware meets the recommended requirements.
By following this guide, you should have a fully operational validator node on the Kwil network. Good luck, and thank you for contributing to the decentralization and security of Kwil!