Node Operator Guide
Comprehensive guide to setting up and running a TRUF.NETWORK (TN) node.
This guide will walk you through the process of setting up and running a TRUF.NETWORK (TN) node. By following these steps, you’ll be able to deploy a node, optionally become a validator, and contribute to the TN.
Prerequisites
Before you begin, ensure you have the following:
- Docker & Docker Compose: Required for running the PostgreSQL image.
- After installation, enable and start Docker:
- Add your user to the docker group to run Docker commands without sudo:
- PostgreSQL Client: Required for state sync and database operations.
- Go: Required for building
kwild
binary
- After installation, add Go to PATH:
- Reload your terminal:
- Taskfile (go-task):
- Kwild Binary
You have two options to get the kwild
binary:
- Download from Releases:
- Visit TRUF.NETWORK Node Releases
- Download the latest release for your operating system (e.g.,
tn_2.0.1_linux_amd64.tar.gz
) - Extract the binary and move it to your system path:
- Build from Source:
The built binary will be in the .build
directory. Move it to your system path:
Apply new docker group:
Verify Installation
Before you move forward to Node Setup, verify that everything installed correctly and of the right version:
Node setup
1. Clone TN Node Operator Repository
From your root directly, clone the TRUF.NETWORK node operator repository:
2. Generate Initial Configuration
Use kwild
to create your initial configuration file:
For detailed instructions on configuration options more relevant to a production setup, refer to our Configuration Guide.
3. Enable State Sync
This will configure your node to use state sync for faster synchronization with the network. Edit the config.toml
file using the following command:
4. Set Up PostgreSQL
For a quick setup, run Kwil’s pre-configured PostgreSQL Docker image:
The command above:
-v tn-pgdata:/var/lib/postgresql/data
: Creates a persistent volume named ‘tn-pgdata’ to store database data--shm-size=1gb
: Allocates 1GB of shared memory for PostgreSQL operations (recommended for better performance)
5. Create systemd
service for kwild
and PostgreSQL
6. Run TN Node
Before you proceed, ensure your firewall allows incoming connections on:
- JSON-RPC port (default: 8484)
- P2P port (default: 6600)
Security Warning: It is recommended to not expose port 5432 publicly in production environments.
7. Verify Node Synchronization
To become a validator, ensure your node is fully synced with the network:
Use this command to check node sync status. Look for syncing: false
in the output, and check that your best_block_height
is close to the current network height.
8. Become a Validator (Optional)
To upgrade your node to a validator:
- Ensure your node is fully synced with the network.
- Submit a validator join request:
- Wait for approval from existing validators. You can check your join request status with:
Existing validators must approve your request. For each existing validator needed to approve:
The node ID format for validator operations is: <public key>#<key type>
. For example:
You can find your node’s public key and key type by running:
Note: If you used a different directory name during setup (not ./my-node-config
), replace the path with your actual node configuration directory path.
You can always reach out to the community for help with the validator process.
9. Submit Your Node to Available Node List (Optional)
To help others discover your node:
- Fork the TN repository.
- Add your node information to the
configs/network/available_nodes.json
file. - Submit a Pull Request with your changes.
We’ll review and merge your PR to include your node in the network’s seed list.
Network Configuration Files
Essential network configuration files are located in the configs/network/
directory:
v2/genesis.json
: The network’s genesis file.v2/network-nodes.csv
: List of available nodes for peer discovery.
When setting up your node, refer to these files for network-specific parameters and peer information.
Node ID Format
Node IDs in TRUF.NETWORK follow the format: <public key>#<key type>@<IP address>:<port>
You can find your node ID by running:
Additional Resources
- Quick Installation Guide - Step-by-step commands for a fresh server setup
- Kwil Documentation
- Production Network Deployment Guide
For further assistance, join our Discord community or open an issue on our GitHub repository.
Welcome to the TRUF.NETWORK! Your participation helps build a more robust and decentralized data infrastructure.
Troubleshooting
Installing pg_dump
for Snapshots
To enable state sync functionality, you’ll need pg_dump
installed. Here’s how to install it:
For Ubuntu/Debian:
For CentOS/RHEL:
For macOS (using Homebrew):
Verify the installation:
Security Warning: It is recommended to not expose port 5432 publicly in production environments.
Status
Use this command to view node logs in real-time
This command will provide last 100 lines of logs
To view logs with precise timestamp use
Use this command to check service status
Docker Container Status
To check the status of your Docker containers:
PostgreSQL Logs
To view PostgreSQL container logs:
System Boot Logs
To view logs since the last system boot: