๐ Why Maintenance Matters
A TRON full node is a critical piece of infrastructure. Without regular maintenance, your node may fall out of sync, run out of disk space, or suffer from performance degradation. Proactive maintenance ensures:
- Reliability โ Minimal downtime and consistent API availability.
- Performance โ Optimized sync speed and low latency.
- Security โ Up-to-date software with the latest patches.
- Recovery โ Fast restoration in case of failure.
Treat your node like a production service. Automate routine tasks, monitor proactively, and always have a recovery plan. The goal is zero unplanned downtime.
โ Routine Health Checks
Perform these checks daily to ensure your node is operating normally:
| Check | Command / Method | Expected |
|---|---|---|
| Block Sync | curl -s localhost:8090/wallet/getnowblock | Within 10 blocks of Tronscan |
| Disk Usage | df -h /opt/tron-node | < 80% capacity |
| CPU Load | top -bn1 | head -10 | < 80% sustained |
| Memory | free -h | No swap usage |
| Peer Count | curl -s localhost:8090/wallet/listnodes | > 10 active peers |
| Log Errors | tail -100 /opt/tron-node/logs/tron.log | No ERROR or FATAL |
Write a shell script that runs these checks and sends alerts to Slack or email if any condition fails. This reduces manual effort and catches issues early.
๐ Log Management & Rotation
Java-Tron generates logs that can grow large over time. Without rotation, log files can fill up your disk and cause the node to crash.
Log Rotation Strategy
- Rotate logs weekly or when they reach 500 MB.
- Keep 4 weeks of compressed logs for debugging.
- Use logback.xml to configure rotation in Java-Tron.
Logs can consume 10โ20 GB per month on a busy node. Monitor your log directory size and rotate aggressively to prevent disk exhaustion.
๐๏ธ Database Maintenance
The RocksDB database requires periodic maintenance to stay performant. Most of this is automatic, but there are manual steps you can take.
Compaction
RocksDB performs background compaction to merge SST files and remove obsolete data. You can force a manual compaction if you notice performance degradation.
Database Integrity
Periodically check for database corruption. If you suspect issues, run the recovery tool:
Monitor RocksDB metrics like rocksdb.live-sst-files-size and rocksdb.estimate-pending-compaction-bytes. High pending compaction bytes indicate I/O bottlenecks.
โฌ๏ธ Node Upgrades
TRON's Java-Tron client is regularly updated with new features, performance improvements, and security patches. Keeping your node upgraded is essential.
Monitor the Java-Tron releases page for new versions.
Stop the node, replace the JAR, review config changes, and restart. Test on testnet first.
Upgrades typically take 5โ10 minutes. Schedule during low-traffic periods.
Keep the previous JAR and config file. If issues arise, revert quickly.
sudo systemctl stop tron-node
cp /opt/java-tron/build/libs/FullNode.jar /opt/backup/FullNode.jar.old
wget -O FullNode.jar https://github.com/tronprotocol/java-tron/releases/latest/download/FullNode.jar
Compare the new config.conf with your current one. Merge any new parameters.
sudo systemctl start tron-node and check logs for errors.
Always test new versions on a testnet node before upgrading mainnet. Some upgrades may introduce database schema changes that require a re-sync.
๐พ Backup & Disaster Recovery
A robust backup strategy ensures you can recover quickly from disk failure, corruption, or accidental deletion.
Snapshot Backup Strategy
- Frequency: Weekly snapshots for production nodes.
- Retention: Keep the last 4 weekly snapshots.
- Location: Store snapshots on a separate volume or cloud storage (e.g., S3).
- Testing: Regularly test restoring from snapshots to ensure they are valid.
Disaster Recovery Plan
Recovery Time Objective: < 1 hour from snapshot.
Recovery Point Objective: โค 7 days (weekly snapshots).
Provision new server โ restore snapshot โ start node โ catch up.
Use cron to schedule weekly snapshots and upload them to cloud storage automatically. This removes human error from the backup process.
๐ Security Maintenance
Regular security maintenance protects your node from attacks and unauthorized access.
- OS updates: Run apt update && apt upgrade -y monthly.
- Firewall rules: Review open ports regularly. Restrict RPC ports (50051, 8090) to trusted IPs.
- SSL/TLS: If exposing APIs, use TLS with valid certificates.
- Monitoring: Set up intrusion detection (e.g., Fail2ban) for SSH and RPC endpoints.
- Access control: Rotate SSH keys periodically and use strong passwords.
โ
Disable root SSH login
โ
Use SSH key authentication
โ
Restrict RPC to localhost or VPN
โ
Enable audit logs
โ
Regularly review /var/log/auth.log