Quick Start
The fastest way to get started is using the official pre-built Docker image:Building the Docker Image
To build the Viction node Docker image from source:Build the image
- Compiles the
tomobinary using Go 1.18 - Creates a minimal Alpine-based runtime image
- Includes the entrypoint script and genesis files
Environment Variables
The Docker container is configured using environment variables. Here’s the complete reference:Network Configuration
Network identifier:
88: Viction Mainnet89: Viction Testnet
Your node’s name. If not set, a random name is generated.
Path to a custom genesis JSON file. If not set, uses the default genesis for the network ID.
Comma-separated list of enode URLs for bootstrap. Uses default bootnodes if not set.
Your external IP address. Only use if you have trouble connecting to peers.
P2P port for peer connections. Must map host port to the same value.
Maximum number of peers. Set to 0 to disable P2P.
Sync and Performance
Blockchain sync mode:
fast: Fast synchronizationfull: Full synchronizationlight: Light client mode
Maximum number of executable transaction slots for all accounts.
Maximum number of non-executable transaction slots for all accounts.
Account Management
Private key in plain text to import into keystore. Use this OR provide keystore files, not both.
Password for encrypting/decrypting account. Can also mount password file to
/tomochain/password.Network Stats
Hostname of ethstats service.
Port of ethstats service.
Secret for ethstats service. If not set, node won’t report to netstats.
Advanced Options
Enable archive mode and debug APIs. Set to any non-empty value to enable.Enables:
--gcmode archive--rpcapi db,eth,net,web3,debug,posv
Enable reward snapshots for each epoch. Requires DEBUG_MODE or archive mode.
Always commit transactions. Set to any non-empty value to enable.
Logging verbosity (1-5).
Timeout for RPC HTTP handlers in seconds.
Volume Mounts
The Docker container expects several mounted volumes:Data Directory
Mount point:
/tomochain/dataStores blockchain data and state.Keystore
Mount point:
/tomochain/keystoreStores encrypted account keys.Password File
Mount point:
/tomochain/passwordContains account password.Exposed Ports
The Docker image exposes three ports:HTTP-RPC endpoint for JSON-RPC API calls
WebSocket-RPC endpoint for WebSocket connections
P2P port for peer-to-peer communication (TCP and UDP)
Deployment Examples
- Full Node (Mainnet)
- Masternode
- Archive Node
- Testnet
Docker Compose
For easier management, use Docker Compose:docker-compose.yml
Entrypoint Script Details
The Docker image uses an entrypoint script (docker/tomochain/entrypoint.sh) that:
Processes environment variables
Converts environment variables to command-line flags and handles file-based configuration.
Initializes blockchain
If no blockchain data exists, initializes with the appropriate genesis block (mainnet or testnet).
Manages accounts
- Imports private key if
PRIVATE_KEYis set - Creates password file if needed
- Unlocks the first available account
Container Management
View Logs
Access Container Shell
Check Sync Status
Stop Container
Remove Container
Update to Latest Version
Production Best Practices
Data Persistence
- Always use named volumes or bind mounts
- Regularly backup keystore and data directories
- Use volume drivers for cloud storage
- Monitor disk space usage
Resource Limits
Set resource constraints:
Security
- Don’t expose RPC publicly without authentication
- Use firewall rules to restrict access
- Rotate credentials regularly
- Use Docker secrets for sensitive data
Monitoring
- Use
--restart unless-stoppedfor auto-restart - Configure log rotation
- Monitor container health
- Set up alerts for downtime
Troubleshooting
Container keeps restarting
Container keeps restarting
Check logs:Common issues:
- Invalid password file
- Missing keystore files
- Insufficient disk space
- Port already in use
Cannot connect to RPC
Cannot connect to RPC
Verify:
- Container is running:
docker ps - Ports are mapped:
docker port viction-node - Firewall allows connections
- RPC endpoint is accessible from host
Slow sync performance
Slow sync performance
Optimize:
- Increase container memory limit
- Use SSD storage
- Check network bandwidth
- Consider using fast sync mode
High disk usage
High disk usage
Solutions:
- Use
--gcmode fullinstead of archive - Disable
--store-rewardif not needed - Set up log rotation
- Prune Docker system:
docker system prune
Multi-Node Setup
For advanced users running multiple nodes:docker-compose.multi.yml
Next Steps
Configuration Reference
Learn about all available configuration options
Running a Full Node
Detailed guide on operating a full node