This document is an RPC interface document for transformers chain. The document is applicable to transformers version v0.22.2. The document introduces some commonly used information acquisition interfaces, transaction interfaces and callback interfaces.
Enable RPC interface (important)
Before starting the program, first open the configuration file config.json, refer to the following configuration
If you need to enable rpc power supply, please modify the config.json file and set rpc to true
Query class interface
The following interfaces are the default APIs of the mainnet node and can be called directly.
1.get_height(Get height)
2.get_balance(Get address balance)
3.get_tx_info(Get transaction information interface)
4.get_block interface
This interface is an RPC interface, and the request parameters are as follows:
1.parameter top(start from what height) num(The number of traversal heights starting from top)
2.Call example
http://IP:port/get_block?top=10&num=20
return as follows:
5.info interface(return data in non-json format)