Skip to main content

PREDA-Toolchain Features

Code highlighting

PREDA-Toolchain provide syntax highlighting for .prd and .prdts.

image-20221213110459881

image-20230725174826525

Code auto-completion

PREDA-Toolchain provide code auto-completion for .prd and .prdts.

image-20221213110711494

image-20221213110745317

Compile the contract

Right-click on the contract file, and select PREDA:Compile, PREDA-Toolchain will check the contract syntax.

image-20221213110838353

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.

image-20221213110917492

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.

image-20221213110949399

Built-in parameters

-order:n

The default value of order is 2, is means the blockchain will has 2order2^{order} 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:

  1. Install the DioWallet
  2. 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.

image-20230922154641397

image-20230922155634148

Then enter the contract deployment parameters

image-20230922165228769

Press Enter to confirm

image-20230922165516106

Press Open

image-20230922165647065

Enter your passcode to confirm transaction.

image-20230922165749751

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.