The TRON Developer Hub

Welcome to the TRON developer hub. You'll find comprehensive guides and documentation to help you start working with TRON as quickly as possible, as well as support if you get stuck. Let's jump right in!

Get Started    

Quickstart with TRON Docker


This guide walks the user through the TRON Docker quick-start image setup. The image provides the user with a private network that comes with a Full Node, a Solidity Node, an Event Server, and by default, 10 TRX accounts replete with 10,000 test TRX in each account. Corresponding private keys are provided with the accounts. Thus, the purpose of the Docker quickstart is to quickly provide the user with a local test environment through which they can interact and learn about the TRON blockchain.


Please refer to the Docker official website to download and install the latest Docker version:

Docker Installation for Mac
Docker Installation for Windows

Node.JS Console
This will be used to interact with the Full and Solidity Nodes via Tron-Web.

Node.JS Console Download

Clone TRON Docker Quickstart

git clone

Setup TRON Docker

What is TRON Docker?

Tron Docker Structure

Tron Docker Structure

The TRON Docker Quickstart creates a private network for TRON developers by using an image that exposes a Full Node, Solidity Node, and Event Server. The Full Node stores all transaction data and synchronizes block data with the Solidity Node. MongoDB stores event log data once you trigger an event in a smart contract, and then provides data for the event server to query. Note: the Docker image only sets up a private test-net on your local device. This means it cannot connect to either the Shasta Testnet nor the TRON Mainnet. To connect to the Mainnet or Shasta Testnet, please visit the guide for setting up a Full Node.


First, check for the latest version of TRON Docker Quickstart that should be referenced in the docker run command. When you execute the docker run command, be sure to run the latest version by specifying the corresponding tag name number from the Docker Hub page. In the below figure, the latest Docker release is 1.1.3.

Note on Version Number

For the latest Java-Tron Odyssey 3.2 release, the minimum compatible Tron Quickstart version is Tron Quickstart 1.2.2. Please ensure you have this version installed.

The next step is to execute the docker run command. The docker run command exposes five ports: Ports 8090 and 8091 are for Full Node and Solidity Node HTTP. Ports 50051 and 50052 are for Full Node and Solidity Node gRPC. Port 8092 is for the event server. At the tail end of the command syntax, please reference the latest version number you see from the Docker Hub page.

docker run -it -p 8091:8091 -p 8092:8092 -p 8090:8090 -p 50051:50051 -p 50052:50052 --rm --name tron trontools/quickstart:1.1.3


An abridged version of a successful output is similar to below:

Tron Quickstart v1.1.15

Run MongoDB...
root         1  1.5  0.1  20044  3364 pts/0    Ss+  02:56   0:00 bash ./
root        12 51.0  3.4 1092444 70888 pts/0   Sl+  02:56   0:00 mongod
root        39  0.0  0.1  36068  3220 pts/0    R+   02:56   0:00 ps aux
Set the events db...
MongoDB shell version v4.0.3
connecting to: mongodb://


[HPM] Proxy created: /  ->
[HPM] Proxy created: /  ->
[HPM] Proxy created: /  ->

 Full Node listening on
 Solidity Node listening on
 Event Server listening on

ADMIN /admin/accounts-generation
Waiting when nodes are ready to generate 10 accounts...
(1) Waiting for sync...
(2) Waiting for sync...
Loading the accounts and waiting for the node to mine the transactions...
(1) Waiting for receipts...
Sending 10000 TRX to TFYPpTr7E21ZaPHV6Kt8eoCF6FD7Y6ahXJ
Sending 10000 TRX to TGVQgxqNCSvVFBYpqq2FN1dxFVj4AT8XAm
Sending 10000 TRX to TWqXfDqhBvLUVzR6omFqdbh4pz2SMg9Nfn
Sending 10000 TRX to TVDqaqHnpjzExRvrUE4UaVMbugFu2FrPEN
Sending 10000 TRX to TGAUQKki2uZMsbTkm2utEoE5wgr3hQuw3S


Available Accounts

(0) TFYPpTr7E21ZaPHV6Kt8eoCF6FD7Y6ahXJ (10000 TRX)
(1) TGVQgxqNCSvVFBYpqq2FN1dxFVj4AT8XAm (10000 TRX)
(2) TWqXfDqhBvLUVzR6omFqdbh4pz2SMg9Nfn (10000 TRX)
(3) TVDqaqHnpjzExRvrUE4UaVMbugFu2FrPEN (10000 TRX)
(4) TGAUQKki2uZMsbTkm2utEoE5wgr3hQuw3S (10000 TRX)


# 10 Addresses Shown

Private Keys

(0) c489d91ab038579b8475b430ce74edd36c5829b9d13fbf9ae243c701e51230c7
(1) 781f2eed0dfad7668f1267aed3a28310de8554be9e916ed6f49f74dced46add3
(2) 579461e9c76da2a40bcba3a8f63a453b01bef5b0a0feb8d7418d5235d13e049e
(3) 27045b6a7b0d2426f001af443c731ea792fc7c0190aa07f3f2750ca5a0b0e324
(4) 6580ad6f518fc889e936fe38ffe8ba9bd2888dc12516a8f27403909d681cec09


# 10 Corresponding Private Keys Shown

HD Wallet
Mnemonic:      organ genius humble smoke copy cup firm review flush seminar essence winter
Base HD Path:  m/44'/60'/0'/0/{account_index}

GET 200  - 10766.162 ms

To verify the Full Node, Solidity Node, Event Server, and MongoDB running status, please open another Terminal window and run the following commands.

docker exec -it tron tail -f /tron/FullNode/logs/tron.log # check full node log
docker exec -it tron tail -f /tron/SolidityNode/logs/tron.log # check solidity node log
docker exec -it tron mongo

Go back to review if you have any question

To verify the image is running correctly, execute the command docker exec -it tron ps aux. The output should be similar to below:

docker exec -it tron ps aux
root         1  0.0  0.1  20044  3456 pts/0    Ss+  22:30   0:00 bash ./
root        44  0.4  3.7 1102748 75416 pts/0   SLl+ 22:30   0:04 mongod --auth
root        76  0.0  0.0  20044   260 pts/0    S+   22:30   0:00 bash ./
root        78  0.9 18.0 3015448 365272 pts/0  Sl+  22:30   0:10 java -jar Event
root        79  0.0  0.0  20044   260 pts/0    S+   22:30   0:00 bash ./
root        81  0.0  0.0  20044   260 pts/0    S+   22:30   0:00 bash ./
root        83  1.9 13.3 3074716 270280 pts/0  Sl+  22:30   0:20 java -jar FullN
root        84  1.3 17.0 3134072 346592 pts/0  Sl+  22:30   0:13 java -jar Solid
root       123  0.0  3.1 940280 64252 pts/0    Sl+  22:30   0:00 node /tron/app
root       278  0.0  0.1  36068  3304 pts/1    Rs+  22:48   0:00 ps aux

Query Account Information

If you close the terminal or just want to display the account and private key lists again, run the following API call:


Tron-Studio Smart Contract

Tron-Studio is an IDE for developing, deploying, and debugging smart contracts based on TVM. The gRPC port works with the Tron Docker Full Node to register accounts, deploy smart contracts, and trigger smart contracts.


Please ensure you have the JDK 1.8 environment installed on your system. Clone the Tron-Studio repository, then navigate into the tron-studio directory.

git clone

Run the gradlew build:

cd ~/tron/tron-studio
./gradlew build -x test -x check  # build project

Starting a Gradle Daemon (subsequent builds will be faster)
13 actionable tasks: 13 executed

Stay in the same directory and execute the jar file to start Tron-Studio:

java -jar build/libs/TronStudio.jar

The Tron-Studio IDE will launch like below:



Run a Smart Contract

Copy the following smart contract into the Tron-Studio editor.

pragma solidity ^0.4.23;

contract HelloWorld {
  // Define variable message of type string
  string message;
  event test(uint res);
  // Write function to change the value of variable message
  function postMessage(string value) public returns (string) {
    message = value;
    emit test(8);
    return message;
  // Read function to fetch variable message
  function getMessage() public view returns (string){
    return message;

Click the Compile button. A successful compile brings up a pop-up on the lower right hand corner letting you know it was successful.

Tron Studio Compile Panel

Tron Studio Compile Panel

Click on the settings button on the IDE upper right-hand corner. This brings up the Existing Settings window.

Tron-Studio Settings

Tron-Studio Settings

Adjust the Local TVM address port to reflect the Tron Docker gRPC Full Node port, which is 50051. Remember, Tron-Studio interacts with the outside environment through gRPC ports only.

Click OK to save the settings. Then click the refresh button to ensure the gRPC port is selected on the Local TVM. Now click on the Deploy button to deploy an instance of the contract.

Tron Studio Run Panel

Tron Studio Run Panel

Upon deploying the contract onto the local test-net, verify the deployment success by expanding the details of the transaction in the center bottom window. A value of success for the result category indicates a successful deployment. Now we can test the deployed contract. Expand the contract in the Deployed Contracts panel. You will see the two functions of postMessage and getMessage. Input a string value "1000 Trx" and click the postMessage button to trigger the state changing function. Then query the change by clicking the getMessage button. This displays the "1000 Trx" message in the console panel.

Tron-Web Interaction


Thus far, a smart contract has been deployed on your local private testnet. This section walks the user through interacting with the Full Node, Solidity Node, and deployed smart contract via an API library called Tron-Web. The purpose of this guide is to give the user a feel for interacting with the eco-system.

Node.JS Console

Inside the app folder of the docker-tron-quickstart folder, there should be a JavaScript file called tronWeb.js. If not, create a file called tronWeb.js and copy the contents below into the file. The default addresses for Full Node, Solidity Node, and Event Server point to the local Docker Quickstart Nodes' HTTP ports.

const TronWeb = require('tronweb')

let fullNode = ''
let solidityNode = ''
let eventServer = ''
let defaultPrivateKey = 'da146374a75310b9666e834ee4ad0866d6f4035967bfc76217c5a495fff9f0d0'

global.tronWeb = new TronWeb(


In a new Terminal, navigate into the docker-tron-quickstart directory. Install npm dependencies and execute node tronWeb. This enters the Node.JS console.

cd docker-tron-quickstart
cd app
npm install
node tronWeb

Query API Call

We will run a simple API call to query our smart contract transaction information. This uses the tronWeb.trx.getTransactionInfo API call. In Tron-Studio, expanding the deployment details of the original smart contract shows the transaction_id:

Executing the API call with the transaction_id as the argument outputs the following JSON data:

JSON output in the TronQuickstart Terminal

JSON output in the TronQuickstart Terminal

Executing the API call in Terminal 1

Executing the API call in Terminal 1

State Change API Call

We will now make an API call to the postMessage function, record a new message on your private Docker blockchain, and then output that message. In the app directory, let us create a JavaScript file called dockerstate.js that has the following code. In the code, ensure your local TVM URLs and ports are correct, and substitute your smart contract address into the contractAddress field. You may also amend the postMessage string input if you wish:

const TronWeb = require('tronweb');
const HttpProvider = TronWeb.providers.HttpProvider;
const fullNode = new HttpProvider('');    //Your local TVM URL  
const solidityNode = new HttpProvider('');
const eventServer = '';
const privateKey = 'da146374a75310b9666e834ee4ad0866d6f4035967bfc76217c5a495fff9f0d0';

const tronWeb = new TronWeb(

async function changestate(){

  let contractAddress = 'TAA6PHMkrQs5bZp7cBYcfdWES9EMb5BZaK';   //Your address
  let contract = await tronWeb.contract().at(contractAddress);
  let resultPost = await contract.postMessage("TRON to the Future").send();
  let resultGet = await contract.getMessage().call();
  console.log('resultGet: ', resultGet);


Let us break-down the program: We first define the addresses and ports for your local Docker nodes and event server. This information is stored in the tronWeb object. A function called changestate is defined and then executed. The function first defines the contract object. It then executes the postMessage function using the .send() method, as well as the getMessage function using the .call() method. Finally, the function outputs the getMessage result.

By running node dockerstate.js the output should look like:

State changing function posted "TRON to the Future"

State changing function posted "TRON to the Future"

Congratulations! You have now set up a local TRON blockchain, deployed your smart contract, immutably changed your blockchain via TronWeb API calls, and queried the result.