Install Java 1.8.0
# yum install java-1.8.0-openjdk # java -version # useradd -m tron # passwd tron
Download tron:
# su tron $ cd $ mkdir FullNode $ cd FullNode $ wget https://github.com/tronprotocol/java-tron/releases/download/GreatVoyage-v4.4.4/FullNode.jar
Donwload main_net config:
$ wget https://raw.githubusercontent.com/tronprotocol/tron-deployment/master/main_net_config.conf
Download latest data snapshot from https://developers.tron.network/docs/main-net-database-snapshots:
Or here: https://tronprotocol.github.io/documentation-en/using_javatron/backup_restore/#public-backup-data
(Downloading might take 10+ hours, unpacking 5+ hours, ... better to run in screen)
$ wget http://47.89.178.46/backup20220512/FullNode_output-directory.tgz $ tar xvzf ./FullNode_output-directory.tgz $ rm ./FullNode_output-directory.tgz
Test run:
$ java -jar FullNode.jar -c main_net_config.conf
Check logs:
$ tail -f ./logs/tron.log
Create systemd service:
Check how many gigs the machine has:
echo $((`cat /proc/meminfo | grep MemTotal | sed 's/ */ /g' | cut -d ' ' -f 2` / 1024 / 1024 ))
and set -Xmx to 80% of memory:
# vim /etc/systemd/system/tron.service [Unit] Description=TRON FullNode After=network.target [Service] Type=simple User=tron Group=tron WorkingDirectory=/home/tron/FullNode ExecStart=/bin/java -jar /home/tron/FullNode/FullNode.jar -c /home/tron/FullNode/main_net_config.conf KillSignal=15 KillMode=process Restart=on-failure LimitNOFILE=5000000 GuessMainPID=no [Install] WantedBy=multi-user.target # systemctl daemon-reload && systemctl start tron && systemctl enable tron && systemctl status tron
More deploy info:
https://github.com/tronprotocol/tron-deployment/issues/8