Attestor Node Guides
Attestor Node Guides
This guide explains how to deploy the Primus Network Attestor Node using Docker in production environments.
Support chains
chain | chainId | support |
---|---|---|
base-sepolia | 84532 | ✅ |
Prerequisites
- Hardware Requirements:
- CPU: 4+ cores (x86/64)
- Memory: 8GB+ RAM
- Storage: 100GB+ SSD storage
- Network: High-bandwidth, low-latency connection
- OS: Ubuntu 22.04 LTS (Recommended)
- Docker and Docker Compose installed
- Valid EVM private key (with sufficient balance)
- A domain name
- Reliable RPC endpoints for Base and BNB Chain (for example, Alchemy)
Quick Start
1. Clone and Prepare
git clone https://github.com/primus-labs/primus-network-startup.git
cd primus-network-startup
chmod +x ./run.sh
2. Deploy the Node with Docker Compose
You can run the node with Docker Compose. This starts all services:
- Redis (port 6379) - Caching storage
- Attestor Node (ports 8080-8083) - Main attestation service
- Attestor Service (port 8084) - Helper service for attestor-node
The Docker Compose file is in the project root.
You can configure the following environment variables in docker-compose.yaml
:
Required Variables
PRIVATE_KEY
: EVM private key (must start with0x
)
Network Configuration
BASE_RPC_URL
: Base network RPC URL (default: https://sepolia.base.org)BASE_TASK_CONTRACT_ADDRESS
: Base network task contract addressBASE_CHAIN_ID
: Base network chain ID (default: 84532)BNB_CHAIN_RPC_URL
: BNB Chain RPC URL (default: https://bsc-testnet.therpc.io)BNB_CHAIN_TASK_CONTRACT_ADDRESS
: BNB Chain task contract addressBNB_CHAIN_CHAIN_ID
: BNB Chain chain ID (default: 97)
Other parameters have sensible defaults.
Start the services
sudo ./run.sh start
3. Configure SSL/TLS and Reverse Proxy
Note: Before configuring SSL/TLS, point your domain to the server’s IP address.
If your OS is Ubuntu, you can run the following command to complete all steps:
sudo ./run.sh cert <your_domain>
Otherwise, you can manually configure SSL/TLS and the reverse proxy with the steps below:
- Install Nginx
# Ubuntu
# You can install Nginx on other operating systems as appropriate.
apt install nginx
Obtain an SSL/TLS certificate We recommend using Certbot.
Configure Nginx Configure Nginx to proxy requests to your services. See attestor-node-https.conf.
Enable the SSL configuration
# Test the Nginx configuration
nginx -t
# Reload Nginx to apply the SSL configuration
nginx -s reload
The deployment is now complete.
4. Manage the Node
NOTE: Before managing a node, you must first contact the [primuslabs team](primuslabs team](https://discord.com/invite/pdrNxRrApX) to have the attestor added to the whitelist.
4.1 Set Environment Variables
Based on the chain where your node is located, run the following command:
cp env_files/.env.<chain-name> .env
Then set your private key, RPC URL, and other parameters:
PRIVATE_KEY=0x
RPC=<Your RPC URL>
NODE_CONTRACT_ADDRESS=
# Attestor's address to sign attestations
ATTESTOR_ADDRESS=
# Address to receive rewards and fees
RECIPIENT_ADDRESS=
# Attestor node metadata
NODE_META_URL=https://api-dev.primuslabs.xyz/node1-meta.json
# Attestor node domain names. If you have multiple URLs, separate them with commas.
# Example: network-node1.primuslabs.xyz,test-network-node1-2.primuslabs.xyz
ATTESTOR_URLS=<node-domain1>,<node-domain2>
NODE_META_URL
should point to a JSON document containing the following fields:
{
"name": "Your node name",
"description": "Introduce your node",
"website": "Your website URL",
"x": "https://x.com/<your_x_username>",
"logo": ""
}
MAKE SURE NODE_META_URL
IS PUBLICLY ACCESSIBLE ON THE INTERNET.
4.2 Register the node
sudo ./run.sh register
4.3 Unregister the node
If you want to unregister from the Primus network, run the following command:
Please note: Unregistering from the network means you will no longer receive any tasks and will not earn any income.
sudo ./run.sh unregister
5. Monitoring and Logging
View Logs
# View all service logs
sudo ./run.sh logs
# View specific service logs
sudo ./run.sh logs attestor-node
sudo ./run.sh logs attestor-service
6. Update Services
# Update image tags to the latest versions in docker-compose.yaml
sudo ./run.sh update
7. Reset the Environment
To reset the environment, including all data, run the following command:
# Remove volumes (WARNING: This will delete all data)
sudo ./run.sh clean
sudo ./run.sh start