Mainnet full node miner API

We support HTTP now.

EndPoint URL Protocol
http://localhost:9688 HTTP

client related APIs

blockchain related APIs

mining related APIs

GetClientStatus

It is to get the status of current MASS Miner Client.

GET /v1/client/status

Parameters:

null

Returns:

  • String - version, version of current MASS Miner Client
  • Boolean - peer_listening, is listening peer or not
  • Boolean - syncing, is syncing blocks with peers or not
  • Boolean - mining, is mining new blocks or not
  • Boolean - space_keeping, is SpaceKeeper running or not
  • String - chain_id, chain_id of the blockchain
  • Integer - local_best_height
  • Integer - known_best_height
  • String - p2p_id
  • Object - peer_count, count of peers
  • Integer - total
  • Integer - outbound
  • Integer - inbound
  • Object - peers, peer infos
  • Array of Object - outbound, infos of outbound peers
    • String - id, p2p id
    • String - address, ip address
    • String - direction, outbound
  • Array of Object - inbound, infos of inbound peers
    • String - id, p2p id
    • String - address, ip address
    • String - direction, inbound
  • Array of Object - other, infos of other(maybe dialing) peers
    • String - id, p2p id
    • String - address, ip address
    • String - direction

Example

{
  "version": "1.0.0+61248729",
  "peer_listening": true,
  "syncing": false,
  "mining": false,
  "space_keeping": false,
  "chain_id": "5433524b370b149007ba1d06225b5d8e53137a041869834cff5860b02bebc5c7",
  "local_best_height": "192000",
  "known_best_height": "192000",
  "p2p_id": "2E8B3F2C926F491E85B048705B3BBB33F7429F9E4CFC52AAD37598281E33D58C",
  "peer_count": {
    "total": 5,
    "outbound": 5,
    "inbound": 0
  },
  "peers": {
    "outbound": [
      {
        "id": "4C321F5FD1E274A68FC13DA078B0C04B9059E6843505A7D33FE1B42F56715D65",
        "address": "106.15.233.21:43453",
        "direction": "outbound"
      },
      {
        "id": "61258089AC8AB407D094D9E1E45A168383A611F6A739A7361E8B55BF46618C94",
        "address": "47.108.89.132:43453",
        "direction": "outbound"
      },
      {
        "id": "012C69A46122A1292D4BE87E120E6C6F1EB7E77F9E3ECEA5540E2D5B14AC776D",
        "address": "39.108.215.150:43453",
        "direction": "outbound"
      },
      {
        "id": "42651DC7A0BB9D524B6D8D0E46167891395F44E7705D2EAFBDC60B541272D25E",
        "address": "47.108.88.140:43453",
        "direction": "outbound"
      },
      {
        "id": "FC62D88E9CD3BC967486C4209ED1FC59C2A34C95913ADFCA75BD7A592A7B5001",
        "address": "39.100.57.28:43453",
        "direction": "outbound"
      }
    ],
    "inbound": [],
    "other": []
  }
}

GetBestBlock

It is to get the best block of current node.

GET /v1/blocks/best

Parameters:

null

Returns:

  • String - hash
  • Integer - height

Example

{
  "height": "192000",
  "hash": "b3d895147da4c896c72ef4d28d8750765da9bd5c2672c6d20dd4676300b2c432"
}

GetBlock

It is to get block data by block hash.

GET /v1/blocks/{hash}

Parameters:

Parameter Type Attribute Usage Note hash string required block hash

Returns

  • String - hash
  • String - chain_id
  • Integer - version
  • Integer - height
  • Integer - confirmations
  • Integer - time
  • String - previous_hash
  • String - next_hash
  • String - transaction_root
  • String - witness_root
  • String - proposal_root
  • String - target
  • String - quality
  • String - challenge
  • String - public_key
  • Object - proof
  • String - x
  • String - x_prime
  • Integer - bit_length
  • Object - block_signature
  • String - r
  • String - s
  • Array of String - ban_list
  • Object - proposal_area
  • Array of Object - punishment_area
    • Integer - version
    • Integer - proposal_type
    • String - public_key
    • Array of Object - testimony
    • String - hash
    • String - chain_id
    • Integer - version
    • Integer - height
    • Integer - time
    • String - previous_hash
    • String - transaction_root
    • String - witness_root
    • String - proposal_root
    • String - target
    • String - challenge
    • String - public_key
    • Object - proof
    • String - x
    • String - x_prime
    • Integer - bit_length
    • Object - block_signature
    • String - r
    • String - s
    • Array of String - ban_list
  • Array of Object - other_area
    • Integer - version
    • Integer - proposal_type
    • String - data
  • Array of String - tx
  • Array of object - raw_tx
  • String - txid
  • Integer - version
  • Integer - lock_time
  • Object - block
    • Integer - height
    • String - block_hash
    • Integer - timestamp
  • Array of Object - vin
    • String - txid
    • Integer - vout
    • Integer - sequence
    • Array of String - witness
  • Array of Object - vout
    • String - value
    • Integer - n
    • Object - script_public_key
    • String - asm
    • String - hex
    • Integer - req_sigs
    • String - type
    • Integer - frozen_period
    • String - reward_address
    • Array of String - addresses
  • Array of String - from_address
  • Array of Object - to
    • Array of String - address
    • String - value
  • Array of Object - inputs
    • String - txid
    • Integer - index
    • Array of String - address
    • String - value
  • String - payload
  • Integer - confirmations
  • Integer - size
  • String - fee
  • Integer - status
  • Integer - type
  • Integer - size
  • String - time_utc
  • Integer - tx_count

Example

{
  "hash": "b3d895147da4c896c72ef4d28d8750765da9bd5c2672c6d20dd4676300b2c432",
  "chain_id": "5433524b370b149007ba1d06225b5d8e53137a041869834cff5860b02bebc5c7",
  "version": "1",
  "height": "192000",
  "confirmations": "4204",
  "time": "1575078576",
  "previous_hash": "9a1b91850598b397c36be4cb34a99c183812ce05a8c3c6afdf244f654d738422",
  "next_hash": "772220d2dfca2d319f1699ded69a634458ca987c343f4ed8a73c1d05f74c6357",
  "transaction_root": "965f0c473adca41416436906a4af88708fe454382deef128139b006576882bd9",
  "witness_root": "965f0c473adca41416436906a4af88708fe454382deef128139b006576882bd9",
  "proposal_root": "9663440551fdcd6ada50b1fa1b0003d19bc7944955820b54ab569eb9a7ab7999",
  "target": "900151a5dfab34",
  "quality": "9ba22b427ac198",
  "challenge": "2b71e099dc30234bf86aefe06ba92cf91c6cc1c1557debd453017c5159fcaf08",
  "public_key": "023ae4379095eed46d30503384a8624ae7dc31cc361865b1ef6154e1fb6ceb284b",
  "proof": {
    "x": "79c8525f",
    "x_prime": "425d779f",
    "bit_length": 32
  },
  "block_signature": {
    "r": "f1dec9ce034fde28906e07bc3539dad633c0347f69c6f19b85685db2ee31202c",
    "s": "68590736858f9df3318c112e3a59a896a9abd6a3f49387776bf826b2af1b62d1"
  },
  "ban_list": [],
  "proposal_area": {
    "punishment_area": [],
    "other_area": []
  },
  "tx": [],
  "raw_tx": [
    {
      "txid": "965f0c473adca41416436906a4af88708fe454382deef128139b006576882bd9",
      "version": 1,
      "lock_time": "0",
      "block": {
        "height": "192000",
        "block_hash": "b3d895147da4c896c72ef4d28d8750765da9bd5c2672c6d20dd4676300b2c432",
        "timestamp": "1575078576"
      },
      "vin": [
        {
          "txid": "0000000000000000000000000000000000000000000000000000000000000000",
          "vout": 0,
          "sequence": "18446744073709551615",
          "witness": []
        }
      ],
      "vout": [
        {
          "value": "104",
          "n": 0,
          "script_public_key": {
            "asm": "0 6dae90c56ddac07b5df818e035793c7114fd9545a986d442cc83466ef0a2b5fc",
            "hex": "00206dae90c56ddac07b5df818e035793c7114fd9545a986d442cc83466ef0a2b5fc",
            "req_sigs": 1,
            "type": "witness_v0_scripthash",
            "frozen_period": 0,
            "reward_address": "",
            "addresses": [
              "ms1qqdkhfp3tdmtq8kh0crrsr27fuwy20m9294xrdgskvsdrxau9zkh7qs7v3yd"
            ]
          }
        },
        {
          "value": "24",
          "n": 1,
          "script_public_key": {
            "asm": "0 54fb35b5bd9ad0eecae51a679b0d364343cfa10f7d2d9e83b98c0e82f3a7c64c",
            "hex": "002054fb35b5bd9ad0eecae51a679b0d364343cfa10f7d2d9e83b98c0e82f3a7c64c",
            "req_sigs": 1,
            "type": "witness_v0_scripthash",
            "frozen_period": 0,
            "reward_address": "",
            "addresses": [
              "ms1qq2nantddantgwajh9rfnekrfkgdpulgg005keaqae3s8g9ua8cexqgqeh4z"
            ]
          }
        }
      ],
      "from_address": [],
      "to": [
        {
          "address": [
            "ms1qqdkhfp3tdmtq8kh0crrsr27fuwy20m9294xrdgskvsdrxau9zkh7qs7v3yd"
          ],
          "value": "104"
        },
        {
          "address": [
            "ms1qq2nantddantgwajh9rfnekrfkgdpulgg005keaqae3s8g9ua8cexqgqeh4z"
          ],
          "value": "24"
        }
      ],
      "inputs": [],
      "payload": "00ee02000000000001000000",
      "confirmations": "4204",
      "size": 152,
      "fee": "0",
      "status": 4,
      "type": 4
    }
  ],
  "size": 1491,
  "time_utc": "2019-11-30T01:49:36Z",
  "tx_count": 1
}

GetBlockHashByHeight

It is to get block hash by block height. GET /v1/blocks/hash/{height}

Parameters:

Parameter Type Attribute Usage Note height uint64 required block height

Returns:

  • Integer - height

Example

{
  "hash": "b3d895147da4c896c72ef4d28d8750765da9bd5c2672c6d20dd4676300b2c432"
}

GetBlockByHeight

It is to get block data by block height.

GET /v1/blocks/height/{height}

Parameters:

Parameter Type Attribute Usage Note height uint64 required block height

Returns:

same as GetBlock.

  • String - hash
  • String - chain_id
  • Integer - version
  • Integer - height
  • Integer - confirmations
  • Integer - time
  • String - previous_hash
  • String - next_hash
  • String - transaction_root
  • String - witness_root
  • String - proposal_root
  • String - target
  • String - quality
  • String - challenge
  • String - public_key
  • Object - proof
  • String - x
  • String - x_prime
  • Integer - bit_length
  • Object - block_signature
  • String - r
  • String - s
  • Array of String - ban_list
  • Object - proposal_area
  • Array of Object - punishment_area
    • Integer - version
    • Integer - proposal_type
    • String - public_key
    • Array of Object - testimony
    • String - hash
    • String - chain_id
    • Integer - version
    • Integer - height
    • Integer - time
    • String - previous_hash
    • String - transaction_root
    • String - witness_root
    • String - proposal_root
    • String - target
    • String - challenge
    • String - public_key
    • Object - proof
    • String - x
    • String - x_prime
    • Integer - bit_length
    • Object - block_signature
    • String - r
    • String - s
    • Array of String - ban_list
  • Array of Object - other_area
    • Integer - version
    • Integer - proposal_type
    • String - data
  • Array of String - tx
  • Array of object - raw_tx
  • String - txid
  • Integer - version
  • Integer - lock_time
  • Object - block
    • Integer - height
    • String - block_hash
    • Integer - timestamp
  • Array of Object - vin
    • String - txid
    • Integer - vout
    • Integer - sequence
    • Array of String - witness
  • Array of Object - vout
    • String - value
    • Integer - n
    • Object - script_public_key
    • String - asm
    • String - hex
    • Integer - req_sigs
    • String - type
    • Integer - frozen_period
    • String - reward_address
    • Array of String - addresses
  • Array of String - from_address
  • Array of Object - to
    • Array of String - address
    • String - value
  • Array of Object - inputs
    • String - txid
    • Integer - index
    • Array of String - address
    • String - value
  • String - payload
  • Integer - confirmations
  • Integer - size
  • String - fee
  • Integer - status
  • Integer - type
  • Integer - size
  • String - time_utc
  • Integer - tx_count

Example

{
  "hash": "b3d895147da4c896c72ef4d28d8750765da9bd5c2672c6d20dd4676300b2c432",
  "chain_id": "5433524b370b149007ba1d06225b5d8e53137a041869834cff5860b02bebc5c7",
  "version": "1",
  "height": "192000",
  "confirmations": "4276",
  "time": "1575078576",
  "previous_hash": "9a1b91850598b397c36be4cb34a99c183812ce05a8c3c6afdf244f654d738422",
  "next_hash": "772220d2dfca2d319f1699ded69a634458ca987c343f4ed8a73c1d05f74c6357",
  "transaction_root": "965f0c473adca41416436906a4af88708fe454382deef128139b006576882bd9",
  "witness_root": "965f0c473adca41416436906a4af88708fe454382deef128139b006576882bd9",
  "proposal_root": "9663440551fdcd6ada50b1fa1b0003d19bc7944955820b54ab569eb9a7ab7999",
  "target": "900151a5dfab34",
  "quality": "9ba22b427ac198",
  "challenge": "2b71e099dc30234bf86aefe06ba92cf91c6cc1c1557debd453017c5159fcaf08",
  "public_key": "023ae4379095eed46d30503384a8624ae7dc31cc361865b1ef6154e1fb6ceb284b",
  "proof": {
    "x": "79c8525f",
    "x_prime": "425d779f",
    "bit_length": 32
  },
  "block_signature": {
    "r": "f1dec9ce034fde28906e07bc3539dad633c0347f69c6f19b85685db2ee31202c",
    "s": "68590736858f9df3318c112e3a59a896a9abd6a3f49387776bf826b2af1b62d1"
  },
  "ban_list": [],
  "proposal_area": {
    "punishment_area": [],
    "other_area": []
  },
  "tx": [],
  "raw_tx": [
    {
      "txid": "965f0c473adca41416436906a4af88708fe454382deef128139b006576882bd9",
      "version": 1,
      "lock_time": "0",
      "block": {
        "height": "192000",
        "block_hash": "b3d895147da4c896c72ef4d28d8750765da9bd5c2672c6d20dd4676300b2c432",
        "timestamp": "1575078576"
      },
      "vin": [
        {
          "txid": "0000000000000000000000000000000000000000000000000000000000000000",
          "vout": 0,
          "sequence": "18446744073709551615",
          "witness": []
        }
      ],
      "vout": [
        {
          "value": "104",
          "n": 0,
          "script_public_key": {
            "asm": "0 6dae90c56ddac07b5df818e035793c7114fd9545a986d442cc83466ef0a2b5fc",
            "hex": "00206dae90c56ddac07b5df818e035793c7114fd9545a986d442cc83466ef0a2b5fc",
            "req_sigs": 1,
            "type": "witness_v0_scripthash",
            "frozen_period": 0,
            "reward_address": "",
            "addresses": [
              "ms1qqdkhfp3tdmtq8kh0crrsr27fuwy20m9294xrdgskvsdrxau9zkh7qs7v3yd"
            ]
          }
        },
        {
          "value": "24",
          "n": 1,
          "script_public_key": {
            "asm": "0 54fb35b5bd9ad0eecae51a679b0d364343cfa10f7d2d9e83b98c0e82f3a7c64c",
            "hex": "002054fb35b5bd9ad0eecae51a679b0d364343cfa10f7d2d9e83b98c0e82f3a7c64c",
            "req_sigs": 1,
            "type": "witness_v0_scripthash",
            "frozen_period": 0,
            "reward_address": "",
            "addresses": [
              "ms1qq2nantddantgwajh9rfnekrfkgdpulgg005keaqae3s8g9ua8cexqgqeh4z"
            ]
          }
        }
      ],
      "from_address": [],
      "to": [
        {
          "address": [
            "ms1qqdkhfp3tdmtq8kh0crrsr27fuwy20m9294xrdgskvsdrxau9zkh7qs7v3yd"
          ],
          "value": "104"
        },
        {
          "address": [
            "ms1qq2nantddantgwajh9rfnekrfkgdpulgg005keaqae3s8g9ua8cexqgqeh4z"
          ],
          "value": "24"
        }
      ],
      "inputs": [],
      "payload": "00ee02000000000001000000",
      "confirmations": "4276",
      "size": 152,
      "fee": "0",
      "status": 4,
      "type": 4
    }
  ],
  "size": 1491,
  "time_utc": "2019-11-30T01:49:36Z",
  "tx_count": 1
}

GetBlockHeader

It is to get block header by block hash.

GET /v1/blocks/{hash}/header

Parameters:

Parameter Type Attribute Usage Note hash string required block hash

Returns:

  • String - hash
  • String - chain_id
  • Integer - version
  • Integer - height
  • Integer - confirmations
  • Integer - time
  • String - previous_hash
  • String - next_hash
  • String - transaction_root
  • String - witness_root
  • String - proposal_root
  • String - target, hex string
  • String - quality, decimal string
  • String - challenge
  • String - public_key
  • Object - proof
  • String - x
  • String - x_prime
  • Integer - bit_length
  • Object - block_signature
  • String - r
  • String - s
  • Array of String - ban_list
  • String - time_utc

Example

{
  "hash": "b3d895147da4c896c72ef4d28d8750765da9bd5c2672c6d20dd4676300b2c432",
  "chain_id": "5433524b370b149007ba1d06225b5d8e53137a041869834cff5860b02bebc5c7",
  "version": "1",
  "height": "192000",
  "confirmations": "4276",
  "timestamp": "1575078576",
  "previous_hash": "9a1b91850598b397c36be4cb34a99c183812ce05a8c3c6afdf244f654d738422",
  "next_hash": "772220d2dfca2d319f1699ded69a634458ca987c343f4ed8a73c1d05f74c6357",
  "transaction_root": "965f0c473adca41416436906a4af88708fe454382deef128139b006576882bd9",
  "witness_root": "",
  "proposal_root": "9663440551fdcd6ada50b1fa1b0003d19bc7944955820b54ab569eb9a7ab7999",
  "target": "900151a5dfab34",
  "quality": "43806928072786328",
  "challenge": "2b71e099dc30234bf86aefe06ba92cf91c6cc1c1557debd453017c5159fcaf08",
  "public_key": "023ae4379095eed46d30503384a8624ae7dc31cc361865b1ef6154e1fb6ceb284b",
  "proof": {
    "x": "79c8525f",
    "x_prime": "425d779f",
    "bit_length": 32
  },
  "block_signature": {
    "r": "f1dec9ce034fde28906e07bc3539dad633c0347f69c6f19b85685db2ee31202c",
    "s": "68590736858f9df3318c112e3a59a896a9abd6a3f49387776bf826b2af1b62d1"
  },
  "ban_list": [],
  "time_utc": "2019-11-30T01:49:36Z"
}

GetTxPool

It is to get a brief summary of transaction pool.

GET /v1/transactions/pool

Parameters:

null

Returns:

  • Integer - tx_count
  • Integer - orphan_count
  • Integer - tx_plain_size
  • Integer - tx_packet_size
  • Integer - orphan_plain_size
  • Integer - orphan_packet_size
  • Array of String - txs, an array of txids
  • Array of String - orphans, an array of orphan txids

Example

{
  "tx_count": 0,
  "orphan_count": 0,
  "tx_plain_size": "0",
  "tx_packet_size": "0",
  "orphan_plain_size": "0",
  "orphan_packet_size": "0",
  "txs": [],
  "orphans": []
}

ConfigureCapacity

It is to configure miner by required DiskSize.

POST /v1/spaces

Parameters:

Parameter Type Attribute Usage Note capacity int required overall mining disk size represented by MiB payout_addresses [ ]string required array of payout addresses passphrase string required passphrase to unlock wallet same as what -P argument set

Returns:

  • Integer - space_count
  • Array of Object, spaces
  • Integer - ordinal
  • String - public_key
  • String - address
  • Integer - bit_length
  • String - state
  • Float - progress
  • Integer - error_code
  • String - error_message

Example

//request
{
"capacity": 400,
"payout_addresses": ["ms1qq7xrd32awhvaj9lkgn6tzm2n76gcu5zglxguzyu3kxrs9pz7tk32qvw70ky"],
"passphrase": "123456"
}
//response
{
"space_count": 4,
"spaces": [
{
"ordinal": "0",
"public_key": "02905d92f83d1519fa4f9b9e8bf2b91361438eeb7d74223c3f0371460e62cfa441",
"address": "165xgckgUQym6wvmtn8adXnpsQcZhPJ2pV",
"bit_length": 24,
"state": "registered",
"progress": 0
},
{
"ordinal": "1",
"public_key": "0325f91597e68f0427300ad35b40dc91373b9c3264a745f25908cb5ceb12a96be4",
"address": "1EjyGZLJnrHDkDT6A54XzsQNRoXsMLVSiM",
"bit_length": 24,
"state": "registered",
"progress": 0
},
{
"ordinal": "2",
"public_key": "03ae8e4eb760487b774e3a6125180ccc924c96b7feb54abb17dcc7d9c5db0ee58e",
"address": "1CB2n7iMYUKyy6e49PykNtXXhyP4aFppvK",
"bit_length": 24,
"state": "registered",
"progress": 0
},
{
"ordinal": "3",
"public_key": "02854885799adb8953c588a0f170149e6b48d979c4d74486dcc446d91835a42c40",
"address": "1CpD8DW8XX59tJwQr9Cyem7nDn7rTbfoSy",
"bit_length": 24,
"state": "registered",
"progress": 0
}
],
"error_code": 200,
"error_message": ""
}

GetCapacitySpaces

It is to get all configured miner spaces.

GET /v1/spaces

Parameters:

null

Returns:

  • Integer - space_count
  • Array of Object, spaces
  • Integer - ordinal
  • String - public_key
  • String - address
  • Integer - bit_length
  • String - state
  • Float - progress
  • Integer - error_code
  • String - error_message

Example

{
  "space_count": 4,
  "spaces": [
    {
      "ordinal": "0",
      "public_key": "02905d92f83d1519fa4f9b9e8bf2b91361438eeb7d74223c3f0371460e62cfa441",
      "address": "165xgckgUQym6wvmtn8adXnpsQcZhPJ2pV",
      "bit_length": 24,
      "state": "registered",
      "progress": 0
    },
    {
      "ordinal": "1",
      "public_key": "0325f91597e68f0427300ad35b40dc91373b9c3264a745f25908cb5ceb12a96be4",
      "address": "1EjyGZLJnrHDkDT6A54XzsQNRoXsMLVSiM",
      "bit_length": 24,
      "state": "registered",
      "progress": 0
    },
    {
      "ordinal": "2",
      "public_key": "03ae8e4eb760487b774e3a6125180ccc924c96b7feb54abb17dcc7d9c5db0ee58e",
      "address": "1CB2n7iMYUKyy6e49PykNtXXhyP4aFppvK",
      "bit_length": 24,
      "state": "registered",
      "progress": 0
    },
    {
      "ordinal": "3",
      "public_key": "02854885799adb8953c588a0f170149e6b48d979c4d74486dcc446d91835a42c40",
      "address": "1CpD8DW8XX59tJwQr9Cyem7nDn7rTbfoSy",
      "bit_length": 24,
      "state": "registered",
      "progress": 0
    }
  ],
  "error_code": 200,
  "error_message": ""
}

GetCapacitySpace

It is to get configured miner space by space_id.

GET /v1/spaces/{space_id}

Parameters:

Parameter Type Attribute Usage Note space_id string required Space ID, formatted as ("%s-%d", public_key, bit_length)

Returns:

  • Object, space
  • Integer - ordinal
  • String - public_key
  • String - address
  • Integer - bit_length
  • String - state
  • Float - progress
  • Integer - error_code
  • String - error_message

Example

{
  "space": {
    "ordinal": "0",
    "public_key": "02905d92f83d1519fa4f9b9e8bf2b91361438eeb7d74223c3f0371460e62cfa441",
    "address": "165xgckgUQym6wvmtn8adXnpsQcZhPJ2pV",
    "bit_length": 24,
    "state": "registered",
    "progress": 0
  },
  "error_code": 200,
  "error_message": ""
}

PlotCapacitySpaces

It is to plot all configured miner spaces.

POST /v1/spaces/plot

Parameters:

null

Returns:

  • Integer - error_code
  • String - error_message

Example

{
  "error_code": 200,
  "error_message": ""
}

PlotCapacitySpace

It is to plot configured miner space by space_id.

POST /v1/spaces/{space_id}/plot

Parameters:

Parameter Type Attribute Usage Note space_id string required Space ID, formatted as ("%s-%d", public_key, bit_length)

Returns:

  • Integer - error_code
  • String - error_message

Example

{
  "error_code": 200,
  "error_message": ""
}

MineCapacitySpaces

It is to mine all configured miner spaces.

POST /v1/spaces/mine

Parameters:

null

Returns:

  • Integer - error_code
  • String - error_message

Example

{
  "error_code": 200,
  "error_message": ""
}

MineCapacitySpace

It is to mine configured miner space by space_id.

POST /v1/spaces/{space_id}/mine

Parameters:

Parameter Type Attribute Usage Note space_id string required Space ID, formatted as ("%s-%d", public_key, bit_length)

Returns:

  • Integer - error_code
  • String - error_message

Example

{
  "error_code": 200,
  "error_message": ""
}

StopCapacitySpaces

It is to stop all configured miner spaces.

POST /v1/spaces/stop

Parameters:

null

Returns:

  • Integer - error_code
  • String - error_message

Example

{
  "error_code": 200,
  "error_message": ""
}

StopCapacitySpace

It is to stop configured miner space by space_id.

POST /v1/spaces/{space_id}/stop

Parameters:

Parameter Type Attribute Usage Note space_id string required Space ID, formatted as ("%s-%d", public_key, bit_length)

Returns:

  • Integer - error_code
  • String - error_message

Example

{
  "error_code": 200,
  "error_message": ""
}

GetKeystore

It is to get all keystore in the wallet.

GET /v1/wallets

Parameters:

null

Returns:

  • Array of object - wallets
  • String - wallet_id
  • String - remark

Example

{
  "wallets": [
    {
      "wallet_id": "ac108dg4my870c0t07u22y6kurkfwjvk2580lk98m0",
      "remark": ""
    }
  ]
}

ExportKeystore

It is to export keystore.

POST /v1/wallets/export

Parameters:

Parameter Type Attribute Usage Note wallet_id string required wallet_id to be exported passphrase string required passphrase export_path string required file path of exported keystore

Returns:

  • String - keystore

Example

//request
{
"wallet_id": "ac108dg4my870c0t07u22y6kurkfwjvk2580lk98m0",
"passphrase": "123456",
"export_path": "."
}

//response
{
"keystore": "{\"remark\":\"\",\"crypto\":{\"cipher\":\"Stream cipher\",\"masterHDPrivKeyEnc\":\"2bc4592eb1e8b5e3aede665c310b3da4b8670e8315e717896b4ce35d26cef8c59a43e5b3de6dfde0f8aadbf77a2e2a87cb5948e622c7d4a198b60ef134f4d20675589753dcc1327a412f95ef111d08a2becb3d10dcbd31cc3eba6208b9cf98f3cffd3b38b1246c85230161e52de51587fa5c8ef066720e2e5bf7fd65c12eaff99494add5a334c8879924c50a6299ff22f51988eeb5c40b\",\"kdf\":\"scrypt\",\"pubParams\":\"8b6672e43801b807cc8e2b84e7451140f4a0ccefd95fd0517645a3fa46c1212941e809953ee35ad776bd5454011e55edb677d02b9226a002d288cde88b33a3f5000004000000000008000000000000000100000000000000\",\"privParams\":\"2db906258e0a0430d64dcd88cc9234cf56642dc0075ae2def430018b21962bf8fb5c380ce4a3d229f930776a1965a4a03448d46796afe9a5e1fe985f3d129df7000004000000000008000000000000000100000000000000\",\"cryptoKeyPubEnc\":\"bd59ebac79b1a20a8d666ccf734b86e928f2b48419db9409c0c17b9a9cdad39fc71eec5d03ef09536b224b60c322c9e8eb5f72452b379a502009cb9d6c1c4e0a4c67cbb0f7130582\",\"cryptoKeyPrivEnc\":\"b324172e95537af9406ce89a4ae439804bb90585027d18648f62bddd7d38600fdf41de5f6fcf74b1206ae173b4f3c2200c8bd385b472968bff931e2492e0cb5f27b651bac01e482c\"},\"hdPath\":{\"Purpose\":44,\"Coin\":297,\"Account\":0,\"ExternalChildNum\":4,\"InternalChildNum\":0}}"
}

ImportKeystore

It is to import keystore.

POST /v1/wallets/import

Parameters:

Parameter Type Attribute Usage Note import_path string required filepath of target keystore old_passphrase string required old passphrase new_passphrase string required new passphrase

Returns:

  • Boolean - status
  • String - wallet_id
  • String - remark

Example

//request
{
"import_path": "./keystore-ac108dg4my870c0t07u22y6kurkfwjvk2580lk98m0.json",
"old_passphrase": "654321",
"new_passphrase": "123456"
}
//response
{
"status": true,
"wallet_id": "ac108dg4my870c0t07u22y6kurkfwjvk2580lk98m0",
"remark": ""
}

UnlockWallet

It is to unlock wallet.

POST /v1/wallets/unlocking

Parameters:

Parameter Type Attribute Usage Note passphrase string required passphrase

Returns:

  • Boolean - success
  • String - error

Example

// request
{
"passphrase": "123456"
}
// response
{
"success": true,
"error": ""
}

LockWallet

It is to lock wallet.

POST /v1/wallets/locking

Parameters:

null

Returns:

  • Boolean - success
  • String - error

Example

{
  "success": true,
  "error": ""
}

ChangePrivatePass

It is to change private pass of the wallet.

POST /v1/wallets/privpass/changing

Parameters:

Parameter Type Attribute Usage Note old_privpass string required old private password new_privpass string required new private password

Returns:

  • Boolean - success

Example

// request
{
"old_privpass": "123456",
"new_privpass": "654321"
}
// response
{
"success": true
}

ChangePublicPass

It is to change public pass of the wallet.

POST /v1/wallets/pubpass/changing

Parameters:

Parameter Type Attribute Usage Note old_pubpass string required old pubpass new_pubpass string required new pubpass

Returns:

  • Boolean - success

Example

// request
{
"old_pubpass": "pubPassword",
"new_pubpass": "newPubPassword"
}

// response
{
"success": true
}