# Purpose

The purpose of it is to set up a complete private network for Tron development by docker. #Build

Dependencies

**_ Minimum Hardware Requirements _**

  • CPU: 64-bit x86_64, 2+ Cores

  • RAM: 4 GB+

Environment

  • The latest version Docker

  • Node.JS Console

Pull the image using docker:



Run the container:



Note

  • The --rm option automatically removes the container after it exits. This is very important because the container cannot be restarted, it MUST be run from scratch to correctly configure the environment.

Verify the image is running correctly: After the command form shell1,you should see something like shell2



Note

  • If redis-server, nodes, or the event server are not running, exit and run the container again.

To see the logs of the full node you can execute



# Usage

## Options

Use -e flag to pass environmental variables to the docker. Example:



List of options:

  • accounts=12 sets the number of generated accounts

  • useDefaultPrivateKey=true tells Quickstart to use the default account as accounts[0]

  • mnemonic=wrong bit chicken kitchen rat uses a specified mnemonic

  • defaultBalance=100000 sets the initial balance for the generated accounts (in the example to 100,000 TRX)

  • seed=ushwe63hgeWUS sets the seed to be used to generate the mnemonic (if none is passed)

  • hdPath=m/44'/60'/0'/0 sets a custom bit39 hdPath

  • formatJson=true formats the output

  • preapprove=... pre approved proposals (see below for more help)

Pre-approved proposals

To pre-approve, for example, getMultiSignFee and allowMultiSign, you can run the images as:



For a complete list of option proposals check out https://api.trongrid.io/wallet/getchainparameters

## Available accounts

  • base58


  • hexstring:


  • Both formats




## More accounts?



## Same accounts

If you would like to use the same accounts each time, there are two ways to do that:

  • By passing a mnemonic to the docker

  • By using accounts-data/accounts.json,put your own private keys in the privateKeys array, and run the container.



## TronBox 2.1+ configuration

Configure your tronbox.js file as:



## TronWeb configuration

Instantiate tronWeb as in the following example:



The easiest way to interact with the private network is by using TronWeb from the container:



## RPC

If you are running Tron Wallet-cli or any other tool which connects to the private network via RPC, you can just expose the ports . . . and voila!



Note

  • Running TronBox can put a lot of stress on the local network. If the FullNode is busy, it returns the "SERVER_BUSY" error. If it does, just repeat your command.

## Version



## Source code

https://github.com/TRON-US/docker-tron-quickstart/tree/b127a0846cfe4d8d20302b816c746749140bd3f1