TRON Developer Hub

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 and TronGrid can be quickly set up and launched from the Terminal. Through setting up these two tools, you can launch the MetaCoin DApp, compile a smart contract, deploy the contract, and finally query the events on the Shasta test network. The following is a video tutorial showing the process:

Installation

OS requirement

  • NodeJS 5.0+
  • Windows, Linux, or Mac OS X

npm install -g tronbox

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--rest 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.