Tron Node / DONE

Tron Node reconfiguring:

The documentation is described for installation on a pure VDS without any third-party software or other programmes, please take this into account when installing.

  1. Install the necessary packages:

    apt update && apt install -y git wget curl nano
  2. Install Docker according to the official documentationhttps://docs.docker.com/engine/install/#server

  3. Clone the repository with the docker image:

    git clone https://github.com/boxexchanger/docker-java-tron.git
  4. Go to the directory with the project

    cd docker-java-tron/
  5. Create a configuration file and set the required contract addresses and event tops: (not obligatory, but recommended so as not to process unnecessary transactions).

    nano ~/docker-java-tron/tron.conf

    configuration example for processing only USDT events

    EVENT_PLUGIN_ADDRESS_FILTER=TR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t
  6. Create a folder for this node

    mkdir -p ~/docker-java-tron/data/node
  7. Download Lite version of node data from open source(http://34.143.247.77/) (documentation)

    wget http://34.143.247.77/backup20240809/LiteFullNode_output-directory.tgz -O ~/LiteFullNode_output-directory.tgz
  8. Unzip the archive (folderoutput-directory) в ~/docker-java-tron/data/node/

    tar xvf ~/LiteFullNode_output-directory.tgz -C ~/docker-java-tron/data/node/ --strip-components=1
  9. Delete the archive with the Lite data

    rm ~/LiteFullNode_output-directory.tgz

    Now our Tron node is ready to go live

Launch Node

  1. Go to the project directory:

    cd ~/docker-java-tron/
  2. Launch Tron node

    ./start.sh

How to add another contract address

  1. You have to go into the configuration:

    nano ~/docker-java-tron/tron.conf
  2. Add another address to the EVENT_PLUGIN_ADDRESS_FILTER block by separating the contract addresses with a comma character , and do not use line breaks or spaces between addresses. USDT + USDC Example:

    EVENT_PLUGIN_ADDRESS_FILTER=TR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t,TEkxiTehnzSmSe2XqrBj4w32RUN966rdz8

Clearing node data:

By default we have set 5 days of data storage which you can synchronise

If you want to change this parameter you need to add a different number of days to your configuration

  1. You have to go into the configuration

    nano ~/docker-java-tron/tron.conf
  2. Add a line with your value:

    MONGO_RETENTION_DAYS=5

How to get logs from node:

docker exec -it tron-node tail -f logs/tron.log

Opening an access port:

Create proxy from ports

- localhost:8080 to port 2080 for EventServer

- localhost:18090 to port 2090 for fullNode

- localhost:18091 to port 2091 for solidityNode

Setting up a proxy on caddy

Installing caddy https://caddyserver.com/docs/install

Documentation prepared for Debian 11 and 12.

apt install -y debian-keyring debian-archive-keyring apt-transport-https
curl -1sLf 'https://dl.cloudsmith.io/public/caddy/stable/gpg.key' | gpg --dearmor -o /usr/share/keyrings/caddy-stable-archive-keyring.gpg
curl -1sLf 'https://dl.cloudsmith.io/public/caddy/stable/debian.deb.txt' |  tee /etc/apt/sources.list.d/caddy-stable.list
apt update
apt install caddy

configuring caddy for proxy

8080,18090,18091 to ports 2080,2090,2091 for the external network

Caddyfile will be overwritten completely!

echo -e ':2080 {\n reverse_proxy :8080\n}\n:2090 {\n reverse_proxy :18090\n}\n:2091 {\n reverse_proxy :18091\n}' > /etc/caddy/Caddyfile 

launch caddy

systemctl enable --now caddy

or restart if necessarysystemctl restart caddy

Accesses

EventServer: http://ip.host:2080 Node: http://ip.host:2090 Solidity: http://ip.host:2091

How to update a tron-node container.

Update the version in the .env file https://github.com/tronprotocol/java-tron/releases

.env
JAVA_TRON_VERSION="GreatVoyage-v4.7.5"

Rebuild docker and restart the node:

docker compose build
./start.sh

Last updated