TronBox is a development environment and framework for blockchains using the TRON Virtual Machine. TronBox provides the following core functionalities:
Smart contract compilation
Migration (deployment on the network)
Windows, Linux, or Mac OS X
Installation permissions issue
If the command in the shell fails due to a permission issue, please follow this command to install again: sudo npm install -g tronbox --unsafe-perm=true --allow-root --save-dev grunt If you still have permission issues, you can try to use nvm to manage nmp and node and install again.
Note on Windows
For Windows, the best way to run TronBox is to install an Ubuntu subsystem: https://docs.microsoft.com/en-us/windows/wsl/install-win10. After running Ubuntu from the prompt, proceed as usual. It is not recommended to run TronBox from Powershell.
## Initialize a Tron-Box Project
Enter the following command under an empty folder
## Basic Commands
|tronbox compile||Compiles all the smart contracts. The compiled result is stored into ./build/contracts. This command only compiles files that have been modified since the last compile.|
|tronbox compile --compile-all||Re-compiles all the smart contracts.|
|tronbox migrate||Deploys the contract. This command only migrates changes since the last successful migration.|
|tronbox migrate --reset||Re-migrates all the smart contracts.|
|tronbox test [test_script_path]||Runs all test scripts. Test file name definition is optional. It also can be run with --reset flag.|
|tronbox console||The console supports the `|
## Extra Features in TronBox Console
All the compiled contracts can be used, just like in development & test, front-end code, or during script migration.
After each command, the contract is re-loaded. After invoking the `
migrate--reset` command, you can immediately use the new address and binary.
Every returned command's promise is automatically logged. There is no need to use `
then()`, which simplifies the command.