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    

Getting Started

Introduction

TronBox is a development environment. At its core, it provides the following functionality:

  • Smart contract compilation
  • Migration (deployment on the network)
  • Testing

TronBox can be quickly set up and launched from the Terminal.

Installation

OS requirement

  • NodeJS 5.0+
  • Windows, Linux, or Mac OS X
npm install -g tronbox

Note on Version

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

Initialize a Tron-Box Project

$ tronbox init
this will initialize the file structure of your tronbox project

./contract
./migrations
./test
./tronbox.js

All your smart contract goes here

all javascript files for migration goes here

holding all your test scripts to test your smart contract

the configuration of your project. Declare your fullnode address and event server in this file

Basic Commands

command
usage

tronbox compile

compile all your smart contracts. The result goes into ./build/contracts.

it will only compile files being modified since the last compile

tronbox compile --compile-all

re-compile everything

tronbox migrate

deploy your contract.
it will only do migrate changes since the last successful migration

tronbox migrate --reset

re-migrate everything

tronbox test [test_script_path]

run all test scripts. it is optional to define test file name. It also can be run with --reset flag

tronbox console

The console supports the tronbox command. For example, you can invoke migrate --reset in the console. The result is the same as invoking tronbox migrate --reset in the command.

Extra Features in TronBox Console

  1. All the compiled contracts can be used, just like in development & test, front-end code, or during script migration.

  2. After each command, your contract will be re-loaded. After invoking the migrate--reset command, you can immediately use the new address and binary.

  3. Every returned command's promise will automatically be logged. There is no need to use then(), which simplifies the command.


Getting Started


Suggested Edits are limited on API Reference Pages

You can only suggest edits to Markdown body content, but not to the API spec.