Skip to content

jamsrworld/tron-docker-node-setup

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

2 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸš€ Tron Full Node with Docker

This guide explains how to set up a Tron full node using Docker, including configuration, data persistence, and optional snapshot usage to speed up sync.


πŸ“ Directory Structure

TRX/
β”œβ”€β”€ compose.yml
β”œβ”€β”€ trx.conf
└── trx-data/

    

πŸ› οΈ Step-by-Step Setup

1. Create compose.yml in the TRX directory:

# compose.yml

services:
  java-tron:
    image: tronprotocol/java-tron
    container_name: tron-node
    command: -c /java-tron/config/trx.conf

    ports:
      - "8090:8090" # HTTP API
      - "50051:50051" # gRPC
      - "18888:18888" # P2P
    volumes:
      - ./trx.conf:/java-tron/config/trx.conf
      - ./trx-data/output:/java-tron/output-directory
      - ./trx-data/logs:/java-tron/logs

Start the Tron node container

docker compose up -d

Stop the Tron node container

docker compose down

Restart the node container

docker compose down && docker compose up -d

View real-time logs from the node

tail -f trx-data/logs/tron.log

Check latest block

curl http://localhost:8090/wallet/getnowblock

Check peer connections

curl http://localhost:8090/network/peerlist

πŸ“¦ Importing Tron Snapshot (Optional)

  1. To speed up initial sync download a Tron blockchain snapshot from a trusted source. Link

  2. Replace the contents of:

trx-data/output/
  1. Then run:
docker compose up -d
  1. Then run:
tail -f trx-data/logs/tron.log

βœ… Optional: Add Makefile Commands for convenience

start:
	docker compose up -d

down:
	docker compose down

restart:
	docker compose down && docker compose up -d

logs:
	tail -f trx-data/logs/tron.log

status:
	curl http://localhost:8090/wallet/getnowblock

peers:
	curl http://localhost:8090/network/peerlist

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published