ICON2
Search
⌃K

Maintenance API

Node Management API v0.1.0

Scroll down for example requests and responses.
goloop management
Base URLs:

node

Node Management

View system

Code samples
GET /system
Return system information.

Parameters

Name
In
Type
Required
Description
format
query
string
false
Format the output using the given Go template
Example responses
200 Response
{
"buildVersion": "v0.1.7",
"buildTags": "linux/amd64 tags()-2019-08-20-09:39:15",
"setting": {
"address": "hx4208599c8f58fed475db747504a80a311a3af63b",
"p2p": "localhost:8080",
"p2pListen": "localhost:8080",
"rpcAddr": ":9080",
"rpcDump": false
},
"config": {
"eeInstances": 1,
"rpcDefaultChannel": "",
"rpcIncludeDebug": false
}
}

Responses

Status
Meaning
Description
Schema
200
OK
Success
System
500
Internal Server Error
None
This operation does not require authentication

View system configuration

Code samples
GET /system/configure
Return system configuration.
Example responses
200 Response
{
"eeInstances": 1,
"rpcDefaultChannel": "",
"rpcIncludeDebug": false
}

Responses

Status
Meaning
Description
Schema
200
OK
Success
500
Internal Server Error
None
This operation does not require authentication

Configure system

Code samples
POST /system/configure
Configure system, configurable properties refer to SystemConfig
Body parameter
{
"key": "string",
"value": "string"
}

Parameters

Name
In
Type
Required
Description
body
body
true
key-value to configure

Responses

Status
Meaning
Description
Schema
200
OK
Success
None
500
Internal Server Error
None
This operation does not require authentication

List Backups

Code samples
GET /system/backup
Return list of backups
Example responses
200 Response
[
{
"name": "0x178977_0x1_1_20200715-111057.zip",
"cid": "0x178977",
"nid": "0x1",
"channel": "1",
"height": 2021,
"codec": "rlp"
}
]

Responses

Status
Meaning
Description
Schema
200
OK
Success
500
Internal Server Error
None
This operation does not require authentication

Restore Status

Code samples
GET /system/restore
View the status of restoring
Example responses
200 Response
{
"name": "0x178977_0x1_1_20200715-111057.zip",
"overwrite": true,
"state": "started 23/128"
}

Responses

Status
Meaning
Description
Schema
200
OK
Success
500
Internal Server Error
None
This operation does not require authentication

Start Restore

Code samples
POST /system/restore
Start to restore chain from the backup
Body parameter
{
"name": "0x178977_0x1_1_20200715-111057.zip",
"overwrite": true
}

Parameters

Name
In
Type
Required
Description
body
body
true
Name of backup and options

Responses

Status
Meaning
Description
Schema
200
OK
Success
None
500
Internal Server Error
None
This operation does not require authentication

Stop Restore

Code samples
DELETE /system/restore
Stop restoring operation

Responses

Status
Meaning
Description
Schema
200
OK
Success
None
500
Internal Server Error
None
This operation does not require authentication

chain

Chain Management

List Chains

Code samples
GET /chain
Returns a list of chains
Example responses
200 Response
[
{
"cid": "0x782b03",
"nid": "0x000000",
"channel": "000000",
"state": "started",
"height": 100,
"lastError": ""
}
]

Responses

Status
Meaning
Description
Schema
200
OK
Success
Inline
500
Internal Server Error
None

Response Schema

Status Code 200
array of chains
Name
Type
Required
Restrictions
Description
anonymous
false
none
array of chains
» cid
string("0x" + lowercase HEX string)
false
none
chain-id of chain
» nid
string("0x" + lowercase HEX string)
false
none
network-id of chain
» channel
string
false
none
chain-alias of node
» height
integer(int64)
false
none
block height of chain
» state
string
false
none
state of chain
» lastError
string
false
none
last error of chain
This operation does not require authentication

Join Chain

Code samples
POST /chain
Join Chain
Body parameter
json:
dbType: goleveldb
seedAddress: 'localhost:8080'
role: 3
concurrencyLevel: 1
normalTxPool: 5000
patchTxPool: 1000
maxBlockTxBytes: 1048576
nodeCache: none
channel: '000000'
secureSuites: 'none,tls,ecdhe'
secureAeads: 'chacha,aes128,aes256'
defaultWaitTimeout: 0
txTimeout: 0
maxWaitTimeout: 0
autoStart: false
genesisZip: string

Parameters

Name
In
Type
Required
Description
body
body
object
true
Genesis-Storage zip file and json encoded chain-configuration for join chain using multipart
» json
body
true
json encoded chain-configuration, using multipart 'Content-Disposition: name=json'
»» dbType
body
string
false
Name of database system, ReadOnly
»» seedAddress
body
string
false
List of Seed ip-port, Comma separated string, Runtime-Configurable
»» role
body
integer
false
Role:
»» concurrencyLevel
body
integer
false
Maximum number of executors to use for concurrency
»» normalTxPool
body
integer
false
Size of normal transaction pool
»» patchTxPool
body
integer
false
Size of patch transaction pool
»» maxBlockTxBytes
body
integer
false
Max size of transactions in a block
»» nodeCache
body
string
false
Node cache:
»» channel
body
string
false
Chain-alias of node
»» secureSuites
body
string
false
Supported Secure suites with order (none,tls,ecdhe) - Comma separated string
»» secureAeads
body
string
false
Supported Secure AEAD with order (chacha,aes128,aes256) - Comma separated string
»» defaultWaitTimeout
body
integer
false
Default wait timeout in milli-second(0:disable)
»» maxWaitTimeout
body
integer
false
Max wait timeout in milli-second(0:uses same value of defaultWaitTimeout)
»» txTimeout
body
integer
false
Transaction timeout in milli-second(0:uses system default value)
»» autoStart
body
boolean
false
Start the chain automatically on node start
» genesisZip
body
string(binary)
true
Genesis-Storage zip file, using multipart 'Content-Disposition: name=genesisZip'
Detailed descriptions
»» role: Role:
  • 0 - None
  • 1 - Seed
  • 2 - Validator
  • 3 - Seed and Validator
    Runtime-Configurable
»» nodeCache: Node cache:
  • none - No cache
  • small - Memory Lv1 ~ Lv5 for all
  • large - Memory Lv1 ~ Lv5 for all and File Lv6 for store
Enumerated Values
Parameter
Value
»» dbType
badgerdb
»» dbType
goleveldb
»» dbType
boltdb
»» dbType
mapdb
»» role
0
»» role
1
»» role
2
»» role
3
»» nodeCache
none
»» nodeCache
small
»» nodeCache
large
Example responses
200 Response

Responses

Status
Meaning
Description
Schema
200
OK
Success
ChainID
409
Conflict
Conflict
None
500
Internal Server Error
None
This operation does not require authentication

Inspect Chain

Code samples
GET /chain/{cid}
Return low-level information about a chain.

Parameters

Name
In
Type
Required
Description
cid
path
string("0x" + lowercase HEX string)
true
chain-id of chain
format
query
string
false
Format the output using the given Go template
informal
query
boolean
false
Inspect with informal data
Example responses
200 Response
{
"cid": "0x782b03",
"nid": "0x000000",
"channel": "000000",
"state": "started",
"height": 100,
"lastError": "",
"genesisTx": {},
"config": {
"dbType": "goleveldb",
"seedAddress": "localhost:8080",
"role": 3,
"concurrencyLevel": 1,
"normalTxPool": 5000,
"patchTxPool": 1000,
"maxBlockTxBytes": 1048576,
"nodeCache": "none",
"channel": "000000",
"secureSuites": "none,tls,ecdhe",
"secureAeads": "chacha,aes128,aes256",
"defaultWaitTimeout": 0,
"txTimeout": 0,
"maxWaitTimeout": 0,
"autoStart": false
},
"module": {
"property1": {},
"property2": {}
}
}

Responses

Status
Meaning
Description
Schema
200
OK
Success
404
Not Found
Not Found
None
500
Internal Server Error
None
This operation does not require authentication

Leave Chain

Code samples
DELETE /chain/{cid}
Leave Chain.

Parameters

Name
In
Type
Required
Description
cid
path
string("0x" + lowercase HEX string)
true
chain-id of chain

Responses

Status
Meaning
Description
Schema
200
OK
Success
None
404
Not Found
Not Found
None
500
Internal Server Error
None
This operation does not require authentication

Start Chain

Code samples
POST /chain/{cid}/start
Start Chain.

Parameters

Name
In
Type
Required
Description
cid
path
string("0x" + lowercase HEX string)
true
chain-id of chain

Responses

Status
Meaning
Description
Schema
200
OK
Success
None
404
Not Found
Not Found
None
500
Internal Server Error
None
This operation does not require authentication

Stop Chain

Code samples
POST /chain/{cid}/stop
Stop Chain.

Parameters

Name
In
Type
Required
Description
cid
path
string("0x" + lowercase HEX string)
true
chain-id of chain

Responses

Status
Meaning
Description
Schema
200
OK
Success
None
404
Not Found
Not Found
None
500
Internal Server Error
None
This operation does not require authentication

Reset Chain

Code samples
POST /chain/{cid}/reset
Reset Chain.

Parameters

Name
In
Type
Required
Description
cid