rpc

package
v0.0.0-...-163fc3c Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 30, 2021 License: MIT Imports: 48 Imported by: 0

README

SKT Miner API

SKT Miner exposes a number of APIs over gRPC and HTTP for developers to interact with.

gRPC is a high-performance open-source RPC framework could be easily implemented across different languages and platforms.

HTTP API provides another clear and universal way to interact by wrapping gRPC. HTTP API's supported MIME content type is application/json.

Usage

Endpoints

By default, both gPRC and HTTP API will be served at the following ports when SKT Miner starts.

Supported Protocols Default URL and port
gRPC http://localhost:9685
HTTP http://localhost:9686
Configuration
Item Default Description
api_port_grpc 9685 gRPC port
api_port_http 9686 HTTP port
api_whitelist false whitelist(IP), * means allow all
api_allowed_lan (empty) whitelist for IPs with LAN prefix(10, 172, 192)
API Documentation

Sukhavati Miner provides a configuration file for Swagger which provides a user-friendly HTTP API documentation accessible from web browser.

  1. Register an account at Swagger Hub.
  2. Login and Import API from ./api/proto/api.swagger.json.
  3. Preview Docs.

Alternatively, check ./api/proto/api.swagger.json directly for full definition of all RPC APIs.

Errors
Errors in Response CodeGetClientStatus
Response Code Error message
400 Invalid request.
403 User does not have permission to access the resource.
404 Resource does not exist.
503 Service unavailable.

API Methods


GetClientStatus
GET /v1/client/status

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

Parameters

null

Returns
  • String - version, version of current Sukhavati 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
GET /v1/blocks/best

It is to get the best block of current node.

Parameters

null

Returns
  • String - hash
  • Integer - height
Example
{
    "height": "192000",
    "hash": "b3d895147da4c896c72ef4d28d8750765da9bd5c2672c6d20dd4676300b2c432"
}

GetBlock
GET /v1/blocks/{hash}

It is to get block data by block 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
$ curl localhost:9686/v1/blocks/b3d895147da4c896c72ef4d28d8750765da9bd5c2672c6d20dd4676300b2c432
{
    "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": [
                            "sk1qqdkhfp3tdmtq8kh0crrsr27fuwy20m9294xrdgskvsdrxau9zkh7qs7v3yd"
                        ]
                    }
                },
                {
                    "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": [
                            "sk1qq2nantddantgwajh9rfnekrfkgdpulgg005keaqae3s8g9ua8cexqgqeh4z"
                        ]
                    }
                }
            ],
            "from_address": [],
            "to": [
                {
                    "address": [
                        "sk1qqdkhfp3tdmtq8kh0crrsr27fuwy20m9294xrdgskvsdrxau9zkh7qs7v3yd"
                    ],
                    "value": "104"
                },
                {
                    "address": [
                        "sk1qq2nantddantgwajh9rfnekrfkgdpulgg005keaqae3s8g9ua8cexqgqeh4z"
                    ],
                    "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
GET /v1/blocks/hash/{height}

It is to get block hash by block height.

Parameters
Parameter Type Attribute Usage Note
height uint64 required block height
Returns
  • Integer - height
Example
$ curl localhost:9686/v1/blocks/hash/192000
{
    "hash": "b3d895147da4c896c72ef4d28d8750765da9bd5c2672c6d20dd4676300b2c432"
}

GetBlockByHeight
GET /v1/blocks/height/{height}

It is to get block data by block 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
$ curl localhost:9686/v1/blocks/height/192000
{
    "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": [
                            "sk1qqdkhfp3tdmtq8kh0crrsr27fuwy20m9294xrdgskvsdrxau9zkh7qs7v3yd"
                        ]
                    }
                },
                {
                    "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": [
                            "sk1qq2nantddantgwajh9rfnekrfkgdpulgg005keaqae3s8g9ua8cexqgqeh4z"
                        ]
                    }
                }
            ],
            "from_address": [],
            "to": [
                {
                    "address": [
                        "sk1qqdkhfp3tdmtq8kh0crrsr27fuwy20m9294xrdgskvsdrxau9zkh7qs7v3yd"
                    ],
                    "value": "104"
                },
                {
                    "address": [
                        "sk1qq2nantddantgwajh9rfnekrfkgdpulgg005keaqae3s8g9ua8cexqgqeh4z"
                    ],
                    "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
GET /v1/blocks/{hash}/header

It is to get block header by block 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, 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
$ curl localhost:9686/v1/blocks/b3d895147da4c896c72ef4d28d8750765da9bd5c2672c6d20dd4676300b2c432/header
{
    "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
GET /v1/transactions/pool

It is to get a brief summary of transaction 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
POST /v1/spaces

It is to configure miner by required DiskSize.

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": ["sk1qq7xrd32awhvaj9lkgn6tzm2n76gcu5zglxguzyu3kxrs9pz7tk32qvw70ky"],
	"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": 0,
    "error_message": ""
}

GetCapacitySpaces
GET /v1/spaces

It is to get all configured miner 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": 0,
    "error_message": ""
}

ConfigureCapacityByDirs
POST /v1/spaces/directory

It is to configure miner by required directories and corresponding disk sizes.

Parameters
Parameter Type Attribute Usage Note
allocations []struct required consists of directory and capacity
directory string required directory to save PocDBs path should be existed
capacity int required mining disk size for corresponding directory represented by MiB
payout_addresses []string required array of payout addresses
passphrase string required passphrase to unlock wallet same as what -P argument set
  • Array of Object, allocations
    • String - directory
    • Int - capacity
  • Array of String, payout_addresses
  • String - passphrase
Returns
  • Integer - directory_count
  • Array of Object, allocations
    • String - directory
    • String - capacity
    • 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

{
    "allocations": [
        {
            "directory": "spaces1",
            "capacity": 100
        },
        {
            "directory": "spaces2",
            "capacity": 200
        }
    ],
    "payout_addresses": [
        "sk1qqamtl9nd8x38plenkgdzecpvsfuaqw3szhglhffcxler0jmsd840sueckv0"
    ],
    "passphrase": "123456"
}

response

{
    "directory_count": 2,
    "allocations": [
        {
            "directory": "/root/spaces1",
            "capacity": "96",
            "space_count": 1,
            "spaces": [
                {
                    "ordinal": "0",
                    "public_key": "032d5465c60bf7e43b96b39f77fa433a2c083e055860e50d332b279f0e78fb336d",
                    "address": "181zD466dKPEDFebeVXG7uJwKsjnbXTCtv",
                    "bit_length": 24,
                    "state": "mining",
                    "progress": 100
                }
            ]
        },
        {
            "directory": "/root/spaces2",
            "capacity": "192",
            "space_count": 2,
            "spaces": [
                {
                    "ordinal": "1",
                    "public_key": "03d18ce607b80af663da3e47ce7b7b53a068d56dfc95603e57ee87616a9894c2b9",
                    "address": "1KZg1RfPL9GkQoN6yFcC2R6N8HfQrUGAcv",
                    "bit_length": 24,
                    "state": "mining",
                    "progress": 100
                },
                {
                    "ordinal": "2",
                    "public_key": "02eb0aefdc273a5083b3bf03b21bdd1159479e6eedc4d5c7a41595229d43f6d45f",
                    "address": "1Mvn6yva8q9Le5eKCU7pR3G1ryYqY7oCVP",
                    "bit_length": 24,
                    "state": "mining",
                    "progress": 100
                }
            ]
        }
    ],
    "error_code": 0,
    "error_message": ""
}

GetCapacitySpacesByDirs
GET /v1/spaces/directory

It is to get all configured miner spaces.

Parameters

null

Returns
  • Integer - directory_count
  • Array of Object, allocations
    • String - directory
    • String - capacity
    • 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
{
    "directory_count": 2,
    "allocations": [
        {
            "directory": "/root/spaces1",
            "capacity": "96",
            "space_count": 1,
            "spaces": [
                {
                    "ordinal": "0",
                    "public_key": "032d5465c60bf7e43b96b39f77fa433a2c083e055860e50d332b279f0e78fb336d",
                    "address": "181zD466dKPEDFebeVXG7uJwKsjnbXTCtv",
                    "bit_length": 24,
                    "state": "mining",
                    "progress": 100
                }
            ]
        },
        {
            "directory": "/root/spaces2",
            "capacity": "192",
            "space_count": 2,
            "spaces": [
                {
                    "ordinal": "1",
                    "public_key": "03d18ce607b80af663da3e47ce7b7b53a068d56dfc95603e57ee87616a9894c2b9",
                    "address": "1KZg1RfPL9GkQoN6yFcC2R6N8HfQrUGAcv",
                    "bit_length": 24,
                    "state": "mining",
                    "progress": 100
                },
                {
                    "ordinal": "2",
                    "public_key": "02eb0aefdc273a5083b3bf03b21bdd1159479e6eedc4d5c7a41595229d43f6d45f",
                    "address": "1Mvn6yva8q9Le5eKCU7pR3G1ryYqY7oCVP",
                    "bit_length": 24,
                    "state": "mining",
                    "progress": 100
                }
            ]
        }
    ],
    "error_code": 0,
    "error_message": ""
}

GetCapacitySpace
GET /v1/spaces/{space_id}

It is to get configured miner space by 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
$ curl localhost:9686/v1/spaces/02905d92f83d1519fa4f9b9e8bf2b91361438eeb7d74223c3f0371460e62cfa441-24
{
    "space": {
        "ordinal": "0",
        "public_key": "02905d92f83d1519fa4f9b9e8bf2b91361438eeb7d74223c3f0371460e62cfa441",
        "address": "165xgckgUQym6wvmtn8adXnpsQcZhPJ2pV",
        "bit_length": 24,
        "state": "registered",
        "progress": 0
    },
    "error_code": 0,
    "error_message": ""
}

PlotCapacitySpaces
POST /v1/spaces/plot

It is to plot all configured miner spaces.

Parameters

null

Returns
  • Integer - error_code
  • String - error_message
Example
{
    "error_code": 0,
    "error_message": ""
}

PlotCapacitySpace
POST /v1/spaces/{space_id}/plot

It is to plot configured miner space by space_id.

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": 0,
    "error_message": ""
}

MineCapacitySpaces
POST /v1/spaces/mine

It is to mine all configured miner spaces.

Parameters

null

Returns
  • Integer - error_code
  • String - error_message
Example
{
    "error_code": 0,
    "error_message": ""
}

MineCapacitySpace
POST /v1/spaces/{space_id}/mine

It is to mine configured miner space by space_id.

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": 0,
    "error_message": ""
}

StopCapacitySpaces
POST /v1/spaces/stop

It is to stop all configured miner spaces.

Parameters

null

Returns
  • Integer - error_code
  • String - error_message
Example
{
    "error_code": 0,
    "error_message": ""
}

StopCapacitySpace
POST /v1/spaces/{space_id}/stop

It is to stop configured miner space by space_id.

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": 0,
    "error_message": ""
}

GetKeystore
GET /v1/wallets

It is to get all keystore in the wallet.

Parameters

null

Returns
  • Array of object - wallets
    • String - wallet_id
    • String - remark
Example
{
    "wallets": [
        {
            "wallet_id": "ac108dg4my870c0t07u22y6kurkfwjvk2580lk98m0",
            "remark": ""
        }
    ]
}

ExportKeystore
POST /v1/wallets/export

It is to export keystore.

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

ExportKeystoreByDir

ImportKeystore
POST /v1/wallets/import

It is to import keystore.

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": ""
}
ImportKeystoreByDir
POST /v1/wallets/import/directory

It is to import other keystore by a directory.

Parameters
Parameter Type Attribute Usage Note
wallet_dir string required the directory of target keystore
import_passphrase string required wallet passphrase
import_wallet_passphrase string required import wallet passphrase
wallet_passphrase string required new passphrase
Returns
  • Boolean - status
  • String - wallet_id
  • String - remark
Example

request

{
  "wallet_dir":"C:\\Users\\jack\\Downloads\\miner.mass\\miner",
  "import_passphrase":"pub1234",
  "import_wallet_passphrase":"priv1234",
  "wallet_passphrase":"123456"
}

response

{
    "status": true,
    "wallet_id": "ac108dg4my870c0t07u22y6kurkfwjvk2580lk98m0",
    "remark": ""
}

UnlockWallet
POST /v1/wallets/unlocking

It is to unlock wallet.

Parameters
Parameter Type Attribute Usage Note
passphrase string required passphrase
Returns
  • Boolean - success
  • String - error
Example

request

{
	"passphrase": "123456"
}

response

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

LockWallet
POST /v1/wallets/locking

It is to lock wallet.

Parameters

null

Returns
  • Boolean - success
  • String - error
Example
{
    "success": true,
    "error": ""
}

ChangePrivatePass
POST /v1/wallets/privpass/changing

It is to change private pass of the wallet.

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
POST /v1/wallets/pubpass/changing

It is to change public pass of the wallet.

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
}
GetGovernConfig
GET /v1/govern/config/current/{id}

It is to change public pass of the wallet.

Parameters
Parameter Type Attribute Usage Note
config_type uint32 required config type
Returns
  • Boolean - success
Example

request

{
	"config_type": 0
}

response

{
  "txid": "",
  "height": "0",
  "config_type": 0,
  "senate_nodes_config": {
    "nodes": [
      {
        "address": "sk1qqggu42p34335mwrutv88t7fqh6sp5eqlawglmx457dhn0w7ks2nzsm0rq7q",
        "equities": "10000"
      }
    ]
  }
}

Documentation

Index

Constants

View Source
const (
	// transaction err
	ErrAPINoTxInfo          = 1101
	ErrAPINoTxOut           = 1102
	ErrAPIRawTx             = 1103
	ErrAPIDuplicateTx       = 1104
	ErrAPIInsufficient      = 1105
	ErrAPIFailedToSukhavati = 1106
	ErrAPIFindingUtxo       = 1107
	ErrAPIFindingBalance    = 1108
	ErrAPIEstimateTxFee     = 1109
	ErrAPIUserTxFee         = 1110

	// block err
	ErrAPINewestHash          = 1201
	ErrAPIBlockNotFound       = 1202
	ErrAPINextBlock           = 1203
	ErrAPIBlockHashByHeight   = 1204
	ErrAPIBlockHeaderNotFound = 1205

	// txScript
	ErrAPICreatePkScript  = 1401
	ErrAPISignTx          = 1402
	ErrAPINewEngine       = 1403
	ErrAPIExecute         = 1404
	ErrAPIRejectTx        = 1405
	ErrAPIExtractPKScript = 1406

	// Invalid Parameter
	ErrAPIInvalidParameter  = 1501
	ErrAPIInvalidLockTime   = 1502
	ErrAPIInvalidAmount     = 1503
	ErrAPIInvalidAddress    = 1504
	ErrAPIInvalidFlag       = 1505
	ErrAPIInvalidIndex      = 1506
	ErrAPIInvalidHash       = 1507
	ErrAPIInvalidPublicKey  = 1508
	ErrAPIInvalidWalletId   = 1509
	ErrAPIInvalidPassphrase = 1510
	ErrAPIInvalidSpaceID    = 1511
	// wallet
	ErrAPIInvalidTxHex = 1517
	ErrAPIInvalidTxId  = 1518

	// Decode, Encode and deserialize err
	ErrAPIFailedDecodeAddress = 1601
	ErrAPIDecodeHexString     = 1602
	ErrAPIShaHashFromStr      = 1603
	ErrAPIEncode              = 1604
	ErrAPIDeserialization     = 1605
	ErrAPIDecodePrivKey       = 1606
	ErrAPIDisasmScript        = 1607

	// other err
	ErrAPIUnknownErr     = 1701
	ErrAPINet            = 1702
	ErrNoMinningAddrress = 1703

	// Miner err
	ErrAPIMinerInternal          = 1801
	ErrAPIMinerNoConfig          = 1802
	ErrAPIMinerSpaceNotFound     = 1803
	ErrAPIMinerSpaceNotReady     = 1804
	ErrAPIMinerNotStopped        = 1805
	ErrAPIMinerInvalidAddress    = 1806
	ErrAPIMinerInvalidCapacity   = 1807
	ErrAPIMinerInvalidSpaceID    = 1808
	ErrAPIMinerNoAddress         = 1809
	ErrAPIMinerWrongPassphrase   = 1810
	ErrAPIMinerInvalidAllocation = 1811

	// Wallet err
	ErrAPIExportWallet   = 1901
	ErrAPIOpenFile       = 1902
	ErrAPIWriteFile      = 1903
	ErrAPIFlush          = 1904
	ErrAPIWalletInternal = 1905
	ErrAPIWalletIsMining = 1906
)
View Source
const (
	UndeclaredTX int32 = -1
	StakingTX    int32 = 1
	BindingTX    int32 = 2
	OrdinaryTX   int32 = 3
	CoinbaseTX   int32 = 4
	PoolingTX    int32 = 5
)
View Source
const (
	LenHash     = 64
	LenAddress  = 63
	LenTxId     = 64
	LenPkString = 66
	LenWalletId = 42
	LenPassMax  = 40
	LenPassMin  = 6
	// evaluate value
	LenSpaceIDMax = 80
)
View Source
const (
	DefaultHTTPLimit = 128 // DefaultHTTPLimit default max http connections
)
View Source
const (
	GRPCListenAddress = "127.0.0.1"
)

Variables

View Source
var (
	RegexpBlockHeightPattern = `^height-\d+$`
	RegexpBlockHashPattern   = `^hash-[a-fA-F0-9]{64}$`
	RegexpBlockHeight        *regexp.Regexp
	RegexpBlockHash          *regexp.Regexp
)
View Source
var ErrCode = map[uint32]string{

	ErrAPINoTxInfo:               "No information available about transaction",
	ErrAPIInvalidIndex:           "Invalid OutPoint index",
	ErrAPINoTxOut:                "Invalid preOutPoint",
	ErrAPIDuplicateTx:            "OutPoint index has been spent",
	ErrAPIInsufficient:           "Insufficient balance",
	ErrAPIFailedToSukhavati:      "Failed convert the amount",
	ErrAPIFindingUtxo:            "Failed to find Utxo",
	ErrAPIFindingBalance:         "Failed to find balance",
	ErrAPIInvalidParameter:       "Invalid parameter",
	ErrAPIInvalidLockTime:        "Invalid locktime",
	ErrAPIInvalidAmount:          "Invalid amount",
	ErrAPIInvalidAddress:         "Invalid address",
	ErrAPIInvalidFlag:            "Invalid sighash parameter",
	ErrAPICreatePkScript:         "Failed to create pkScript",
	ErrAPIFailedDecodeAddress:    "Failed to decode address",
	ErrAPIDecodeHexString:        "Argument must be hexadecimal string",
	ErrAPIShaHashFromStr:         "Failed to decode hash from string",
	ErrAPIEncode:                 "Failed to encode data",
	ErrAPIDeserialization:        "Failed to deserialize",
	ErrAPIDecodePrivKey:          "Failed to decode WIF for the privkey",
	ErrAPIDisasmScript:           "Failed to disasm script to string",
	ErrAPINet:                    "Mismatched network",
	ErrAPISignTx:                 "Failed to sign transaction",
	ErrAPINewEngine:              "Failed to create new engine",
	ErrAPIExecute:                "Failed to execute engine",
	ErrAPIRejectTx:               "Reject receive transaction",
	ErrAPIExtractPKScript:        "Failed to extract info from pkScript",
	ErrAPINewestHash:             "Failed to get newest hash",
	ErrAPIBlockNotFound:          "Failed to find block",
	ErrAPIRawTx:                  "Failed to create raw transaction",
	ErrAPINextBlock:              "No next block",
	ErrAPIBlockHashByHeight:      "Failed to get block hash by height",
	ErrAPIBlockHeaderNotFound:    "Failed to find block header",
	ErrNoMinningAddrress:         "No payment addresses specified via --miningaddr",
	ErrAPIUnknownErr:             "Unknown error",
	ErrAPIEstimateTxFee:          "Failed to estimateTxFee",
	ErrAPIUserTxFee:              "Invalid userTxFee",
	ErrAPIMinerInternal:          "Error in miner internal",
	ErrAPIMinerNoConfig:          "No config specified",
	ErrAPIMinerSpaceNotFound:     "Fail to find space",
	ErrAPIMinerSpaceNotReady:     "Not Ready space",
	ErrAPIMinerNotStopped:        "Invalid miner status, should be stopped",
	ErrAPIMinerInvalidAddress:    "Invalid miner payout address",
	ErrAPIMinerInvalidCapacity:   "Invalid miner capacity",
	ErrAPIMinerInvalidSpaceID:    "Invalid spaceID",
	ErrAPIInvalidHash:            "Invalid hash",
	ErrAPIInvalidPublicKey:       "Invalid public key",
	ErrAPIInvalidWalletId:        "Invalid walletId",
	ErrAPIInvalidPassphrase:      "Invalid passphrase",
	ErrAPIInvalidSpaceID:         "Invalid space id",
	ErrAPIMinerNoAddress:         "Missing miner payout addresses",
	ErrAPIMinerWrongPassphrase:   "Wrong miner passphrase",
	ErrAPIMinerInvalidAllocation: "Invalid miner allocation",
	ErrAPIInvalidTxId:            "Invalid transaction id",
	ErrAPIInvalidTxHex:           "Invalid txHex",

	ErrAPIExportWallet:   "Failed to export wallet",
	ErrAPIOpenFile:       "Failed to open keystore file",
	ErrAPIWriteFile:      "Failed to write keystore file to cache",
	ErrAPIFlush:          "Failed to write keystore file to disk",
	ErrAPIWalletInternal: "Internal error in wallet",
	ErrAPIWalletIsMining: "Fail to lock wallet while mining",
}
View Source
var ErrInvalidBlockID = errors.New("invalid id for block")

Functions

func AmountToString

func AmountToString(m int64) (string, error)

AmountToString converts m(in Sukhavati) to the string representation(float, in Skt)

func Run

func Run(cfg *config.Config) error

func StringToAmount

func StringToAmount(s string) (chainutil.Amount, error)

StringToAmount converts s(float, in Skt) to amount(in Sukhavati)

Types

type Server

type Server struct {
	// contains filtered or unexported fields
}

func NewServer

func NewServer(db database.DB, pocMiner pocminer.PoCMiner, spaceKeeper mining.SpaceKeeper, chain *blockchain.Blockchain,
	txMemPool *blockchain.TxPool, sm *netsync.SyncManager, pocWallet *wallet.PoCWallet, quitClient func(), config *config.Config) (*Server, error)

func (*Server) ChangePrivatePass

func (*Server) ChangePublicPass

func (*Server) ConfigureCapacity

func (s *Server) ConfigureCapacity(ctx context.Context, in *pb.ConfigureSpaceKeeperRequest) (*pb.WorkSpacesResponse, error)

func (*Server) ConfigureCapacityByDirs

func (*Server) ExportKeystore

func (s *Server) ExportKeystore(ctx context.Context, in *pb.ExportKeystoreRequest) (*pb.ExportKeystoreResponse, error)

func (*Server) ExportKeystoreByDir

func (*Server) GetBestBlock

func (s *Server) GetBestBlock(ctx context.Context, msg *empty.Empty) (*pb.GetBestBlockResponse, error)

func (*Server) GetBlock

func (s *Server) GetBlock(ctx context.Context, in *pb.GetBlockRequest) (*pb.GetBlockResponse, error)

func (*Server) GetBlockByHeight

func (s *Server) GetBlockByHeight(ctx context.Context, in *pb.GetBlockByHeightRequest) (*pb.GetBlockResponse, error)

func (*Server) GetBlockHashByHeight

func (*Server) GetBlockHeader

func (s *Server) GetBlockHeader(ctx context.Context, in *pb.GetBlockHeaderRequest) (*pb.GetBlockHeaderResponse, error)

func (*Server) GetBlockHeaderV2

func (s *Server) GetBlockHeaderV2(ctx context.Context, in *pb.GetBlockRequestV2) (*pb.GetBlockHeaderResponse, error)

func (*Server) GetBlockV2

func (s *Server) GetBlockV2(ctx context.Context, in *pb.GetBlockRequestV2) (*pb.GetBlockResponseV2, error)

func (*Server) GetBlockVerbose1V2

func (s *Server) GetBlockVerbose1V2(ctx context.Context, in *pb.GetBlockRequestV2) (*pb.GetBlockResponse, error)

func (*Server) GetCapacitySpace

func (s *Server) GetCapacitySpace(ctx context.Context, in *pb.WorkSpaceRequest) (*pb.WorkSpaceResponse, error)

func (*Server) GetCapacitySpaces

func (s *Server) GetCapacitySpaces(ctx context.Context, in *empty.Empty) (*pb.WorkSpacesResponse, error)

func (*Server) GetCapacitySpacesByDirs

func (s *Server) GetCapacitySpacesByDirs(ctx context.Context, in *empty.Empty) (*pb.WorkSpacesByDirsResponse, error)

TODO auto get all spaces info

func (*Server) GetClientStatus

func (s *Server) GetClientStatus(ctx context.Context, in *empty.Empty) (*pb.GetClientStatusResponse, error)

func (*Server) GetCoinbase

func (s *Server) GetCoinbase(ctx context.Context, in *pb.GetCoinbaseRequest) (*pb.GetCoinbaseResponse, error)

func (*Server) GetGovernConfig

func (*Server) GetKeystore

func (s *Server) GetKeystore(ctx context.Context, msg *empty.Empty) (*pb.GetKeystoreResponse, error)

func (*Server) GetKeystoreDetail

func (*Server) GetRawTransaction

func (s *Server) GetRawTransaction(ctx context.Context, in *pb.GetRawTransactionRequest) (*pb.TxRawResult, error)

func (*Server) GetStakingTxPoolInfo

func (s *Server) GetStakingTxPoolInfo(ctx context.Context, in *empty.Empty) (*pb.GetStakingTxPoolInfoResponse, error)

func (*Server) GetTxPool

func (s *Server) GetTxPool(ctx context.Context, in *empty.Empty) (*pb.GetTxPoolResponse, error)

func (*Server) GetTxPoolVerbose0

func (s *Server) GetTxPoolVerbose0(ctx context.Context, in *empty.Empty) (*pb.GetTxPoolVerbose0Response, error)

func (*Server) GetTxPoolVerbose1

func (s *Server) GetTxPoolVerbose1(ctx context.Context, in *empty.Empty) (*pb.GetTxPoolVerbose1Response, error)

func (*Server) ImportKeystore

func (s *Server) ImportKeystore(ctx context.Context, in *pb.ImportKeystoreRequest) (*pb.ImportKeystoreResponse, error)

func (*Server) ImportKeystoreByDir

func (*Server) LockWallet

func (s *Server) LockWallet(ctx context.Context, msg *empty.Empty) (*pb.LockWalletResponse, error)

func (*Server) MineCapacitySpace

func (s *Server) MineCapacitySpace(ctx context.Context, in *pb.WorkSpaceRequest) (*pb.ActOnSpaceKeeperResponse, error)

func (*Server) MineCapacitySpaces

func (s *Server) MineCapacitySpaces(ctx context.Context, in *empty.Empty) (*pb.ActOnSpaceKeeperResponse, error)

func (*Server) PlotCapacitySpace

func (s *Server) PlotCapacitySpace(ctx context.Context, in *pb.WorkSpaceRequest) (*pb.ActOnSpaceKeeperResponse, error)

func (*Server) PlotCapacitySpaces

func (s *Server) PlotCapacitySpaces(ctx context.Context, in *empty.Empty) (*pb.ActOnSpaceKeeperResponse, error)

func (*Server) QuitClient

func (s *Server) QuitClient(ctx context.Context, in *empty.Empty) (*pb.QuitClientResponse, error)

func (*Server) RunGateway

func (s *Server) RunGateway()

func (*Server) Start

func (s *Server) Start() error

func (*Server) Stop

func (s *Server) Stop()

func (*Server) StopCapacitySpace

func (s *Server) StopCapacitySpace(ctx context.Context, in *pb.WorkSpaceRequest) (*pb.ActOnSpaceKeeperResponse, error)

func (*Server) StopCapacitySpaces

func (s *Server) StopCapacitySpaces(ctx context.Context, in *empty.Empty) (*pb.ActOnSpaceKeeperResponse, error)

func (*Server) UnlockWallet

func (s *Server) UnlockWallet(ctx context.Context, in *pb.UnlockWalletRequest) (*pb.UnlockWalletResponse, error)

Directories

Path Synopsis
Package rpcprotobuf is a reverse proxy.
Package rpcprotobuf is a reverse proxy.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL