Getting Started
You can access the SASEUL node with HTTP or HTTPS and use RPC in the GET or POST method.
In case of GET method, provide request parameters in query string.
- URL: {host}/{RPC_API_NAME}?{request parameters}
In case of POST method, provide request parameters in form-data with key-value format.
- URL: {host}/{RPC_API_NAME}
- Body: {request parameters}
Basic Operation
Ping
Check that the SASEUL node is active.
Return Value
Info
Get the SASEUL node’s process status and the latest main and resource block information.
Return Value
"chain_maker_policy": true,
"resource_miner_policy": true,
"peer_searcher_policy": true,
"collector_policy": true,
Tracker Operation
Peer
Get the list of nodes on the network that are associated with the SASEUL node.
Request Parameters
| Parameter | Requirements | Type | Maxlength | Description |
|---|
| register | optional | Boolean(int) | | Determines whether to send a request to the target node to register itself. |
| host | optional | String | | If the ‘register’ variable is true, enter the host variable to register. |
| authentication | optional | Boolean(int) | | Requests the network information of the target node. |
| height | optional | Int | | If the ‘authentication’ variable is true, add the verification block number to be registered. |
Return value
Round Operation
Round
Get information of a specific block height.
Request Parameters
| Parameter | Requirements | Type | Maxlength | Description |
|---|
| chain_type | optional | String | | main |
| height | optional | int | | height of recent block |
Return value
"timestamp": 1656048496844843
Broadcast
Get consensus information of the current round.
Request Parameters
| Parameter | Requirements | Type | Maxlength | Description |
|---|
| chain_type | optional | String | | main |
| round_key | optional | String | | block_hash(latest) |
Return value
Smart Contracts and Requests
Request
- Execute the method of a smart contract based on data stored in the current node, and display the information
Request Parameters
| Parameter | Requirements | Type | Maxlength | Description |
|---|
| request | mandatory | String | | {“type”:“<method_name>”, …} |
| public_key | optional | String | | "" |
| signature | optional | String | | "" |
Example
curl -X POST main.saseul.net/request --data 'request={"type":"GetBalance","address":"<address>"}'
RawRequest
- Execute the method of a smart contract based on data stored in the current node, and display the information
- Execute a registered reqeust code with raw data.
Request Parameter
| Parameter | Requirements | Type | Maxlength | Description |
|---|
| body | mandatory | Object | | {“request”:{“type”:“<method_name>”, …}, “public_key”:…} |
Example
curl -X POST main.saseul.net/rawrequest --data '{"request":{"type":"GetBalance","address":"<address>"}}'
SendTransaction
- Execute the method of the smart contract to create a transaction and broadcast it.
Request Parameters
| Parameter | Requirements | Type | Maxlength | Description |
|---|
| transaction | mandatory | String | | {“type”:“<method_name>”, …} |
| public_key | optional | String | | "" |
| signature | optional | String | | "" |
Example
curl -X POST main.saseul.net/sendtransaction --data \
'transaction={"type":"Send","to":"<address>","amount":"<amount>"}&public_key=<public_key>&signature=<signature>'
SendRawTransaction
- Execute the method of the smart contract to create a transaction and broadcast it.
- Execute a registered contract code with raw data.
Request Parameters
| Parameter | Requirements | Type | Maxlength | Description |
|---|
| body | mandatory | String | | {“transaction”:{“type”:“<method_name>”, …}, “public_key”:…} |
Example
curl -X POST main.saseul.net/sendrawtransaction --data \
'{"transaction":{"type":"Send","to":"<address>","amount":"<amount>"},"public_key":"<public_key>","signature":"<signature>"}'