Search…
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
1
{
2
"buildVersion": "v0.1.7",
3
"buildTags": "linux/amd64 tags()-2019-08-20-09:39:15",
4
"setting": {
5
"address": "hx4208599c8f58fed475db747504a80a311a3af63b",
6
"p2p": "localhost:8080",
7
"p2pListen": "localhost:8080",
8
"rpcAddr": ":9080",
9
"rpcDump": false
10
},
11
"config": {
12
"eeInstances": 1,
13
"rpcDefaultChannel": "",
14
"rpcIncludeDebug": false
15
}
16
}
Copied!

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
1
{
2
"eeInstances": 1,
3
"rpcDefaultChannel": "",
4
"rpcIncludeDebug": false
5
}
Copied!

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
1
{
2
"key": "string",
3
"value": "string"
4
}
Copied!

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
1
[
2
{
3
"name": "0x178977_0x1_1_20200715-111057.zip",
4
"cid": "0x178977",
5
"nid": "0x1",
6
"channel": "1",
7
"height": 2021,
8
"codec": "rlp"
9
}
10
]
Copied!

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
1
{
2
"name": "0x178977_0x1_1_20200715-111057.zip",
3
"overwrite": true,
4
"state": "started 23/128"
5
}
Copied!

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
1
{
2
"name": "0x178977_0x1_1_20200715-111057.zip",
3
"overwrite": true
4
}
Copied!

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
1
[
2
{
3
"cid": "0x782b03",
4
"nid": "0x000000",
5
"channel": "000000",
6
"state": "started",
7
"height": 100,
8
"lastError": ""
9
}
10
]
Copied!

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
1
json:
2
dbType: goleveldb
3
seedAddress: 'localhost:8080'
4
role: 3
5
concurrencyLevel: 1
6
normalTxPool: 5000
7
patchTxPool: 1000
8
maxBlockTxBytes: 1048576
9
nodeCache: none
10
channel: '000000'
11
secureSuites: 'none,tls,ecdhe'
12
secureAeads: 'chacha,aes128,aes256'
13
defaultWaitTimeout: 0
14
txTimeout: 0
15
maxWaitTimeout: 0
16
autoStart: false
17
genesisZip: string
Copied!

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
1
{
2
"cid": "0x782b03",
3
"nid": "0x000000",
4
"channel": "000000",
5
"state": "started",
6
"height": 100,
7
"lastError": "",
8
"genesisTx": {},
9
"config": {
10
"dbType": "goleveldb",
11
"seedAddress": "localhost:8080",
12
"role": 3,
13
"concurrencyLevel": 1,
14
"normalTxPool": 5000,
15
"patchTxPool": 1000,
16
"maxBlockTxBytes": 1048576,
17
"nodeCache": "none",
18
"channel": "000000",
19
"secureSuites": "none,tls,ecdhe",
20
"secureAeads": "chacha,aes128,aes256",
21
"defaultWaitTimeout": 0,
22
"txTimeout": 0,
23
"maxWaitTimeout": 0,
24
"autoStart": false
25
},
26
"module": {
27
"property1": {},
28
"property2": {}
29
}
30
}
Copied!

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
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

Import Chain

Code samples
POST /chain/{cid}/import
Import a chain from legacy database.
Body parameter
1
{
2
"dbPath": "/path/to/database",
3
"height": 1
4
}
Copied!

Parameters

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

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

Prune Chain

Code samples
POST /chain/{cid}/prune
Prune chain data from the specific height
Body parameter
1
{
2
"dbType": "goleveldb",
3
"height": 1
4
}
Copied!

Parameters

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

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

Backup Chain

Code samples
POST /chain/{cid}/backup
Backup chain data to the specific file

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

Download Genesis-Storage

Code samples
GET /chain/{cid}/genesis
Download Genesis-Storage zip file

Parameters

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

Responses

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

View chain configuration

Code samples
GET /chain/{cid}/configure
Return chain configuration.

Parameters

Name
In
Type
Required
Description
cid
path
string("0x" + lowercase HEX string)
true
chain-id of chain
Example responses
200 Response
1
{
2
"dbType": "goleveldb",
3
"seedAddress": "localhost:8080",
4
"role": 3,
5
"concurrencyLevel": 1,
6
"normalTxPool": 5000,
7
"patchTxPool": 1000,
8
"maxBlockTxBytes": 1048576,
9
"nodeCache": "none",
10
"channel": "000000",
11
"secureSuites": "none,tls,ecdhe",
12
"secureAeads": "chacha,aes128,aes256",
13
"defaultWaitTimeout": 0,
14
"txTimeout": 0,
15
"maxWaitTimeout": 0,
16
"autoStart": false
17
}
Copied!

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

Configure chain

Code samples
POST /chain/{cid}/configure
Configure chain, configurable properties refer to ChainConfig
Body parameter
1
{
2
"key": "string",
3
"value": "string"
4
}
Copied!

Parameters

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

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

Schemas

ChainID

1
"0x782b03"
Copied!
chain-id of chain, "0x" + lowercase HEX string

Properties

Name
Type
Required
Restrictions
Description
anonymous
string
false
none
chain-id of chain, "0x" + lowercase HEX string

Chain

1
{
2
"cid": "0x782b03",
3
"nid": "0x000000",
4
"channel": "000000",
5
"state": "started",
6
"height": 100,
7
"lastError": ""
8
}
Copied!

Properties

Name
Type
Required
Restrictions
Description
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

ChainInspect

1
{
2
"cid": "0x782b03",
3
"nid": "0x000000",
4
"channel": "000000",
5
"state": "started",
6
"height": 100,
7
"lastError": "",
8
"genesisTx": {},
9
"config": {
10
"dbType": "goleveldb",
11
"seedAddress": "localhost:8080",
12
"role": 3,
13
"concurrencyLevel": 1,
14
"normalTxPool": 5000,
15
"patchTxPool": 1000,
16
"maxBlockTxBytes": 1048576,
17
"nodeCache": "none",
18
"channel": "000000",
19
"secureSuites": "none,tls,ecdhe",
20
"secureAeads": "chacha,aes128,aes256",
21
"defaultWaitTimeout": 0,
22
"txTimeout": 0,
23
"maxWaitTimeout": 0,
24
"autoStart": false
25
},
26
"module": {
27
"property1": {},
28
"property2": {}
29
}
30
}
Copied!

Properties

allOf
Name
Type
Required
Restrictions
Description
anonymous
Chain
false
none
none
and
Name
Type
Required
Restrictions
Description
anonymous
object
false
none
none
» genesisTx
object
false
none
Genesis Transaction
» config
false
none
none
» module
object
false
none
none
»» additionalProperties
object
false
none
none

ChainConfig

1
{
2
"dbType": "goleveldb",
3
"seedAddress": "localhost:8080",
4
"role": 3,
5
"concurrencyLevel": 1,
6
"normalTxPool": 5000,
7
"patchTxPool": 1000,
8
"maxBlockTxBytes": 1048576,
9
"nodeCache": "none",
10
"channel": "000000",
11
"secureSuites": "none,tls,ecdhe",
12
"secureAeads": "chacha,aes128,aes256",
13
"defaultWaitTimeout": 0,
14
"txTimeout": 0,
15
"maxWaitTimeout": 0,
16
"autoStart": false
17
}
Copied!

Properties

Name
Type
Required
Restrictions
Description
dbType
string
false
none
Name of database system, ReadOnly
seedAddress
string
false
none
List of Seed ip-port, Comma separated string, Runtime-Configurable