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:
- NodeJS 5.0+
- Windows, Linux, or Mac OS X
npm install -g tronbox
$ tronbox init
this will initialize the file structure of your tronbox project
All your smart contract 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
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
deploy your contract.
it will only do migrate changes since the last successful migration
tronbox migrate --reset
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
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.
All the compiled contracts can be used, just like in development & test, front-end code, or during script migration.
After each command, your contract will be re-loaded. After invoking the
migrate--restcommand, you can immediately use the new address and binary.
Every returned command's promise will automatically be logged. There is no need to use
then(), which simplifies the command.
|Smart Contract Deployment|