Skip to content

RPC API

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

  • URL: {host}/ping

Check that the SASEUL node is active.

Return Value
{
"code": 200,
"data": []
}

Info

  • URL: {host}/info

Get the SASEUL node’s process status and the latest main and resource block information.

Return Value
{
"code": 200,
"data": {
"chain_maker_policy": true,
"resource_miner_policy": true,
"peer_searcher_policy": true,
"collector_policy": true,
"mining": false,
"last_block": {
...
},
"last_resource_block": {
...
}
}
}

Tracker Operation

Peer

  • URL: {host}/peer

Get the list of nodes on the network that are associated with the SASEUL node.

Request Parameters
ParameterRequirementsTypeMaxlengthDescription
registeroptionalBoolean(int)Determines whether to send a request to the target node to register itself.
hostoptionalStringIf the ‘register’ variable is true, enter the host variable to register.
authenticationoptionalBoolean(int)Requests the network information of the target node.
heightoptionalIntIf the ‘authentication’ variable is true, add the verification block number to be registered.
Return value
{
"code": 200,
"data": {
"peers": {
...
},
"known_hosts": [
...
],
"node": {
...
}
},
"register": true,
"registerResult": true,
"authentication": true
}

Round Operation

Round

  • URL: {host}/round

Get information of a specific block height.

Request Parameters
ParameterRequirementsTypeMaxlengthDescription
chain_typeoptionalStringmain
heightoptionalintheight of recent block
Return value
{
"code": 200,
"data": {
"block": {
...
},
"sync_limit": 40362,
"timestamp": 1656048496844843
}
}

Broadcast

  • URL: {host}/broadcast

Get consensus information of the current round.

Request Parameters
ParameterRequirementsTypeMaxlengthDescription
chain_typeoptionalStringmain
round_keyoptionalStringblock_hash(latest)
Return value
{
"code": 200,
"data": {
"transactions": {
...
},
"chunks": {
...
},
"hypotheses": {
...
}
}
}

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
ParameterRequirementsTypeMaxlengthDescription
requestmandatoryString{“type”:“<method_name>”, …}
public_keyoptionalString""
signatureoptionalString""
Example
Terminal window
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
ParameterRequirementsTypeMaxlengthDescription
bodymandatoryObject{“request”:{“type”:“<method_name>”, …}, “public_key”:…}
Example
Terminal window
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
ParameterRequirementsTypeMaxlengthDescription
transactionmandatoryString{“type”:“<method_name>”, …}
public_keyoptionalString""
signatureoptionalString""
Example
Terminal window
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
ParameterRequirementsTypeMaxlengthDescription
bodymandatoryString{“transaction”:{“type”:“<method_name>”, …}, “public_key”:…}
Example
Terminal window
curl -X POST main.saseul.net/sendrawtransaction --data \
'{"transaction":{"type":"Send","to":"<address>","amount":"<amount>"},"public_key":"<public_key>","signature":"<signature>"}'