Installation and usage of the platform

REST API: hash calculation, working with scripts and sending auxiliary queries

https://img.shields.io/badge/auth-required-orange.svg

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.

Response example:

POST /utils/hash/secure

The method returns the double hash sum of the string passed in the query.

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: