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:1
Clone the repository
2
Build the image
- Compiles the
tomobinary using Go 1.18 - Creates a minimal Alpine-based runtime image
- Includes the entrypoint script and genesis files
3
Verify the build
Environment Variables
The Docker container is configured using environment variables. Here’s the complete reference:Network Configuration
string
default:"88"
Network identifier:
88: Viction Mainnet89: Viction Testnet
string
default:"unnamed_xxxxxx"
Your node’s name. If not set, a random name is generated.
string
Path to a custom genesis JSON file. If not set, uses the default genesis for the network ID.
string
Comma-separated list of enode URLs for bootstrap. Uses default bootnodes if not set.
string
Your external IP address. Only use if you have trouble connecting to peers.
string
default:"30303"
P2P port for peer connections. Must map host port to the same value.
string
default:"25"
Maximum number of peers. Set to 0 to disable P2P.
Sync and Performance
string
default:"full"
Blockchain sync mode:
fast: Fast synchronizationfull: Full synchronizationlight: Light client mode
string
default:"3072"
Maximum number of executable transaction slots for all accounts.
string
default:"768"
Maximum number of non-executable transaction slots for all accounts.
Account Management
string
Private key in plain text to import into keystore. Use this OR provide keystore files, not both.
string
Password for encrypting/decrypting account. Can also mount password file to
/tomochain/password.Network Stats
string
default:"netstats-server"
Hostname of ethstats service.
string
default:"3000"
Port of ethstats service.
string
Secret for ethstats service. If not set, node won’t report to netstats.
Advanced Options
string
Enable archive mode and debug APIs. Set to any non-empty value to enable.Enables:
--gcmode archive--rpcapi db,eth,net,web3,debug,posv
string
Enable reward snapshots for each epoch. Requires DEBUG_MODE or archive mode.
string
Always commit transactions. Set to any non-empty value to enable.
number
default:"3"
Logging verbosity (1-5).
number
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:port
HTTP-RPC endpoint for JSON-RPC API calls
port
WebSocket-RPC endpoint for WebSocket connections
port
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:
1
Processes environment variables
Converts environment variables to command-line flags and handles file-based configuration.
2
Initializes blockchain
If no blockchain data exists, initializes with the appropriate genesis block (mainnet or testnet).
3
Manages accounts
- Imports private key if
PRIVATE_KEYis set - Creates password file if needed
- Unlocks the first available account
4
Configures networking
Sets up bootnodes, NAT, and ethstats based on environment variables.
5
Starts the node
Launches
tomo with all configured parameters:- RPC enabled on 0.0.0.0:8545
- WebSocket enabled on 0.0.0.0:8546
- P2P on configured port
- CORS and virtual hosts set to ”*” for development
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