Scroll down for example requests and responses.
goloop management
Base URLs:
Node Management
Code samples
GET /system
Return system information.
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
}
}
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | Success | System |
500 | Internal Server Error | Internal Server Error | None |
This operation does not require authentication
Code samples
GET /system/configure
Return system configuration.
Example responses
200 Response
{
"eeInstances": 1,
"rpcDefaultChannel": "",
"rpcIncludeDebug": false
}
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | Success | SystemConfig |
500 | Internal Server Error | Internal Server Error | None |
This operation does not require authentication
Code samples
POST /system/configure
Configure system, configurable properties refer to SystemConfig
Body parameter
{
"key": "string",
"value": "string"
}
Name | In | Type | Required | Description |
---|---|---|---|---|
body | body | ConfigureParam | true | key-value to configure |
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | Success | None |
500 | Internal Server Error | Internal Server Error | None |
This operation does not require authentication
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"
}
]
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | Success | BackupList |
500 | Internal Server Error | Internal Server Error | None |
This operation does not require authentication
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"
}
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | Success | RestoreStatus |
500 | Internal Server Error | Internal Server Error | None |
This operation does not require authentication
Code samples
POST /system/restore
Start to restore chain from the backup
Body parameter
{
"name": "0x178977_0x1_1_20200715-111057.zip",
"overwrite": true
}
Name | In | Type | Required | Description |
---|---|---|---|---|
body | body | RestoreParam | true | Name of backup and options |
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | Success | None |
500 | Internal Server Error | Internal Server Error | None |
This operation does not require authentication
Code samples
DELETE /system/restore
Stop restoring operation
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | Success | None |
500 | Internal Server Error | Internal Server Error | None |
This operation does not require authentication
Chain Management
Code samples
GET /chain
Returns a list of chains
Example responses
200 Response
[
{
"cid": "0x782b03",
"nid": "0x000000",
"channel": "000000",
"state": "started",
"height": 100,
"lastError": ""
}
]
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | Success | Inline |
500 | Internal Server Error | Internal Server Error | None |
Status Code 200
array of chains
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
anonymous | [Chain] | 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
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
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 | ChainConfig | 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 ValidatorRuntime-Configurable
»» nodeCache: Node cache:
none
- No cachesmall
- Memory Lv1 ~ Lv5 for alllarge
- 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
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | Success | ChainID |
409 | Conflict | Conflict | None |
500 | Internal Server Error | Internal Server Error | None |
This operation does not require authentication
Code samples
GET /chain/{cid}
Return low-level information about a chain.
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": {}
}
}
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | Success | ChainInspect |
404 | Not Found | Not Found | None |
500 | Internal Server Error | Internal Server Error | None |
This operation does not require authentication
Code samples
DELETE /chain/{cid}
Leave Chain.
Name | In | Type | Required | Description |
---|---|---|---|---|
cid | path | string("0x" + lowercase HEX string) | true | chain-id of chain |
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | Success | None |
404 | Not Found | Not Found | None |
500 | Internal Server Error | Internal Server Error | None |
This operation does not require authentication
Code samples
POST /chain/{cid}/start
Start Chain.
Name | In | Type | Required | Description |
---|---|---|---|---|
cid | path | string("0x" + lowercase HEX string) | true | chain-id of chain |
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | Success | None |
404 | Not Found | Not Found | None |
500 | Internal Server Error | Internal Server Error | None |
This operation does not require authentication
Code samples
POST /chain/{cid}/stop
Stop Chain.
Name | In | Type | Required | Description |
---|---|---|---|---|
cid | path | string("0x" + lowercase HEX string) | true | chain-id of chain |
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | Success | None |
404 | Not Found | Not Found | None |
500 | Internal Server Error | Internal Server Error | None |
This operation does not require authentication
Code samples
POST /chain/{cid}/reset
Reset Chain.
Name | In | Type | Required | Description |
---|---|---|---|---|
cid | path | string("0x" + lowercase HEX string) | true | chain-id of chain |
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | Success | None |
404 | Not Found | Not Found | None |
500 | Internal Server Error | Internal Server Error | None |
This operation does not require authentication
Code samples
POST /chain/{cid}/import
Import a chain from legacy database.
Body parameter
{
"dbPath": "/path/to/database",
"height": 1
}
Name | In | Type | Required | Description |
---|---|---|---|---|
cid | path | string("0x" + lowercase HEX string) | true | chain-id of chain |
body | body | ChainImportParam | true | none |
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | Success | None |
404 | Not Found | Not Found | None |
500 | Internal Server Error | Internal Server Error | None |
This operation does not require authentication
Code samples
POST /chain/{cid}/prune
Prune chain data from the specific height
Body parameter
{
"dbType": "goleveldb",
"height": 1
}
Name | In | Type | Required | Description |
---|---|---|---|---|
cid | path | string("0x" + lowercase HEX string) | true | chain-id of chain |
body | body | PruneParam | true | none |
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | Success | None |
404 | Not Found | Not Found | None |
500 | Internal Server Error | Internal Server Error | None |
This operation does not require authentication
Code samples
POST /chain/{cid}/backup
Backup chain data to the specific file
Name | In | Type | Required | Description |
---|---|---|---|---|
cid | path | string("0x" + lowercase HEX string) | true | chain-id of chain |
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | Success | None |
404 | Not Found | Not Found | None |
500 | Internal Server Error | Internal Server Error | None |
This operation does not require authentication
Code samples
GET /chain/{cid}/genesis
Download Genesis-Storage zip file
Name | In | Type | Required | Description |
---|---|---|---|---|
cid | path | string("0x" + lowercase HEX string) | true | chain-id of chain |
Example responses
200 Response
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | Success | string |
404 | Not Found | Not Found | None |
500 | Internal Server Error | Internal Server Error | None |
This operation does not require authentication
Code samples
GET /chain/{cid}/configure
Return chain configuration.
Name | In | Type | Required | Description |
---|---|---|---|---|
cid | path | string("0x" + lowercase HEX string) | true | chain-id of chain |
Example responses
200 Response
{
"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
}
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | Success | ChainConfig |
404 | Not Found | Not Found | None |
500 | Internal Server Error | Internal Server Error | None |
This operation does not require authentication
Code samples
POST /chain/{cid}/configure
Configure chain, configurable properties refer to ChainConfig
Body parameter
{
"key": "string",
"value": "string"
}
Name | In | Type | Required | Description |
---|---|---|---|---|
cid | path | string("0x" + lowercase HEX string) | true | chain-id of chain |
body | body | ConfigureParam | true | key-value to configure |
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | Success | None |
404 | Not Found | Not Found | None |
500 | Internal Server Error | Internal Server Error | None |
This operation does not require authentication
"0x782b03"
chain-id of chain, "0x" + lowercase HEX string
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
anonymous | string | false | none | chain-id of chain, "0x" + lowercase HEX string |
{
"cid": "0x782b03",
"nid": "0x000000",
"channel": "000000",
"state": "started",
"height": 100,
"lastError": ""
}
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 |
{
"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": {}
}
}
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 | ChainConfig | false | none | none |
» module | object | false | none | none |
»» additionalProperties | object | false | none | none |
{
"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
}
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 |
role | integer | false | none | Role: _ 0 - None _ 1 - Seed _ 2 - Validator _ 3 - Seed and Validator Runtime-Configurable |
concurrencyLevel | integer | false | none | Maximum number of executors to use for concurrency |
normalTxPool | integer | false | none | Size of normal transaction pool |
patchTxPool | integer | false | none | Size of patch transaction pool |
maxBlockTxBytes | integer | false | none | Max size of transactions in a block |
nodeCache | string | false | none | Node cache: _ none - No cache _ small - Memory Lv1 ~ Lv5 for all * large - Memory Lv1 ~ Lv5 for all and File Lv6 for store |
channel | string | false | none | Chain-alias of node |
secureSuites | string | false | none | Supported Secure suites with order (none,tls,ecdhe) - Comma separated string |
secureAeads | string | false | none | Supported Secure AEAD with order (chacha,aes128,aes256) - Comma separated string |
defaultWaitTimeout | integer | false | none | Default wait timeout in milli-second(0:disable) |
maxWaitTimeout | integer | false | none | Max wait timeout in milli-second(0:uses same value of defaultWaitTimeout) |
txTimeout | integer | false | none | Transaction timeout in milli-second(0:uses system default value) |
autoStart | boolean | false | none | Start the chain automatically on node start |
Enumerated Values
Property | Value |
---|---|
dbType | badgerdb |
dbType | goleveldb |
dbType | boltdb |
dbType | mapdb |
role | 0 |
role | 1 |
role | 2 |
role | 3 |
nodeCache | none |
nodeCache | small |
nodeCache | large |
{
"dbPath": "/path/to/database",
"height": 1
}
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
dbPath | string | true | none | Database path |
height | int64 | true | none | Block Height |
{
"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
}
}
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
buildVersion | string | false | none | build version |
buildTags | string | false | none | buildTags |
setting | object | false | none | none |
» address | string | false | none | wallet address |
» p2p | string | false | none | p2p address |
» p2pListen | string | false | none | p2p listen address |
» rpcAddr | string | false | none | Listen ip-port of JSON-RPC |
» rpcDump | boolean | false | none | JSON-RPC Request, Response Dump flag |
config | SystemConfig | false | none | none |
{
"eeInstances": 1,
"rpcDefaultChannel": "",
"rpcIncludeDebug": false
}
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
eeInstances | integer | false | none | eeInstances |
rpcDefaultChannel | string | false | none | default channel for legacy api |
rpcIncludeDebug | boolean | false | none | JSON-RPC Response with detail information |
{
"key": "string",
"value": "string"
}
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
key | string | true | none | configuration field name |
value | string | true | none | configuration value |
{
"dbType": "goleveldb",
"height": 1
}
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
dbType | string | false | none | Database type |
height | int64 | true | none | Block Height |
[
{
"name": "0x178977_0x1_1_20200715-111057.zip",
"cid": "0x178977",
"nid": "0x1",
"channel": "1",
"height": 2021,
"codec": "rlp"
}
]
None
{
"name": "0x178977_0x1_1_20200715-111057.zip",
"overwrite": true,
"state": "started 23/128"
}
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
state | string | true | none | State of the job (stopped, started N/T, stopping, failed, success) |
name | string | false | none | Name of backup |
overwrite | boolean | false | none | Whether it replaces existing chain data |
{
"name": "0x178977_0x1_1_20200715-111057.zip",
"overwrite": true
}
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
name | string | true | none | Name of the backup to restore |
overwrite | boolean | false | none | Whether it replaces existing chain |