github.com/cheng762/platon-go@v1.8.17-0.20190529111256-7deff2d7be26/cmd/ctool/readme.md (about)

     1  ## Compile:
     2  
     3  Run in this directory: go build ctool.go generate or update ctool.exe file.
     4  
     5  ## Command:
     6  
     7  ##### 1.Deploy contract:
     8  ```
     9  ./ctool deploy
    10  -abi        abi json file path (must)
    11  -code       wasm file path (must)
    12  -config     config path  (optional)
    13  
    14  eg: ./ctool deploy -abi "D:\\resource\\temp\\contractc.cpp.abi.json" -code "D:\\resource\\temp\\contractc.wasm"
    15  ```
    16  ##### 2.Contract call
    17  ```
    18  ./ctool invoke
    19  -addr     contract address (must)
    20  -func     functon name and param (must)
    21  -abi      abi json file path (must)
    22  -type     transaction type ,default 2 (optional)
    23  
    24  eg: ./ctool invoke -addr "0xFC43e7f481b9d3F75CcfFc8D23eAC522E96dE570" -func "transfer("a",b,c) " -abi "D:\\resource\\temp\\contractc.cpp.abi.json" -type
    25  ```
    26  ##### 3.Send transaction
    27  ```
    28  ./ctool sendTransaction
    29  -from       msg sender (must)
    30  -to         msg acceptor (must)
    31  -value      transfer value (must)
    32  -config     config path (optional)
    33  
    34  ```
    35  ##### 4.Send raw transaction
    36  ```
    37  ./ctool sendRawTransaction
    38  -pk         private key file (must)
    39  -from       msg sender (must)
    40  -to         msg acceptor (must)
    41  -value      transfer value (must)
    42  -config     config path (optional)
    43  ```
    44  ##### 5.Query transactionReceipt
    45  ```
    46  ./ctool getTxReceipt
    47  -hash       txhash (must)
    48  -config     config path (optional)
    49  ```
    50  ##### 6.Prepare transaction stability test account
    51  ```
    52  ./ctool prepare
    53  -pkfile      account private key file path,defalut "./test/privatekeys.txt" (optional)
    54  -size        the number of accounts,default 10 (optional)
    55  -value       transfer value (must)
    56  -config      config path (optional)
    57  
    58  eg: ./ctool.exe pre -size 10 -pkfile "./test/privateKeys.txt" -value 0xDE0B6B3A7640000
    59  ```
    60  
    61  ##### 7.Make Stability test
    62  ```
    63  ./ctool stab
    64  -pkfile      account private key file path, default "./test/privateKeys.txt"(optional)
    65  -times       send transaction times,default 1000 (optional)
    66  -interval    transaction send interval,if input 10 ,the interval will be 10*Millisecond ,default 10(option)
    67  -config      config path (optional)
    68  
    69  eg:  ./ctool.exe stab -pkfile "./test/privateKeys.txt" -times 10000 -interval 10
    70  ```
    71  
    72  note: If the command exits normally,the next time you can continue to run with the generated accounts and the command exits abnormally, you need to re-use the pre command to generate the test accounts.
    73  
    74  ##### Config Description: The config parameter is not passed in the command, and the `config.json` file in the current directory is read by default.
    75  
    76  The config.json file is as follows:
    77  
    78  ```
    79  {
    80    "url":"http://192.168.9.73:6789",
    81    "gas": "0x76c0",
    82    "gasPrice": "0x9184e72a000",
    83    "from":"0xfb8c2fa47e84fbde43c97a0859557a36a5fb285b"
    84  }
    85  ```
    86  
    87