PREDA-Toolchain features
Code highlighting
PREDA-Toolchain provide syntax highlighting for .prd and .prdts.
Code auto-completion
PREDA-Toolchain provide code auto-completion for .prd and .prdts.
Compile the contract
Right-click on the contract file, and select PREDA:Compile
, PREDA-Toolchain will check the contract syntax.
Set Compile Args
Right-click on the contract file, and select PREDA:Set Compile Args
,PREDA-Toolchain will pop up an input box at the top for entering parameters. We can set compile arguments such as contract dependences:
./IToken.prd
Run the script
Right click on the test script file, and select PREDA:Run
, PREDA-Toolchain will execute the commands in the test script and output a visual report.
Set input parameters of the script
Right-click on the script file, and select PREDA:Set Args
, PREDA-Toolchain will pop up an input box at the top for entering parameters. The parameter format is as follows:
-count:100 -order:1 -sync
The script input parameters will be saved in the scriptArgs.json file.
Built-in parameters
-order:n
The default value of order is 2, is means the blockchain will has shards, the max value of order is 16.
-sync/-async
The sharding mode describes the working mode between shards, when the sharding mode is sync, each shard will output blocks synchronously and the block height will be the same; while when the sharding mode is async, each shard will output blocks asynchronously and the block height may be different.
-perftest
By default, PREDA-toolchain will print logs when executing contract calls, which can consume intensive capability during performance testing. Under this circumstance, you can turn on the performance mode by this parameter.
Custom parameters
Users can use custom parameters in test scripts, such as:
allocate.address $~count$
The $~count$
defines a parameter used to apply for the specified number of addresses, then the user can set the value of this parameter in the pop-up box.
-count:100
Deploy the contract
Precondition:
- Install the DioWallet
- Create your DApp
Right-click on the contract file, and select PREDA:Deploy
, PREDA-Toolchain will pop up an input box at the top for entering your dapp name.
Then enter the contract deployment parameters
Press Enter
to confirm
Press Open
Enter your passcode to confirm transaction.
Now, congratulations on the successful deployment of the contract!
Chain info visualization
PREDA-Toolchain provides a visual interface for displaying information on the chain, after executing the test script, users can specify the information to be displayed through the viz.
command.