Installation and usage of the platform
REST API: hash calculation, working with scripts and sending auxiliary queries¶
For hashing, scripting and sending auxiliary requests to the node, there is a group of utils
methods:
Hashing: utils/hash
¶
POST /utils/hash/fast¶
The method returns the hash sum of the string passed in the query.
The incoming string is converted to UTF-8 bytes and the hash is calculated from these bytes. The Blake2b256 algorithm is used for Waves cryptography. The result is converted to Base58 format.
Response example:
POST /utils/hash/secure¶
The method returns the double hash sum of the string passed in the query. Blake2b256 algorithm is applied in WAVES cryptography (the node.crypto.type parameter is assigned the WAVES
value in the node configuration file).
Response example:
Working with scripts: utils/script
¶
This group of methods is designed to convert script code into base64 format and decode them. Scripts are bound to accounts using the 13 transactions (binding a script to an address) and 15 (binding a script to an asset for an address).
POST /utils/script/compile¶
The method converts the script code to base64 format.
Query example:
Parameters returned in the method response:
script
- script body in base64 format;complexity
- a number from 1 to 100 representing the amount of computing resources required to execute the script;extraFee
- fee for outgoing transactions set by the script.
Response example:
POST /utils/script/estimate¶
The method is designed to decode and evaluate the complexity of a script passed in a request in base64 format.
Parameters returned in the method response:
script
- script body in base64 format;scriptText
- the source code of the script;complexity
- a number from 1 to 100 representing the amount of computing resources required to execute the script;extraFee
- fee for outgoing transactions set by the script.
Response example:
Auxiliary queries¶
GET /utils/time¶
The method returns the current node time in two formats:
system
- system time of the node PC;ntp
- network time.
Response example:
POST /utils/reload-wallet¶
The method reloads a node’s keystore. It applies if a new key pair was added to the keystore without restarting the node.
Response example: