Chia RPC (2.3.0)

Download OpenAPI specification:Download

The Chia node and services come with a JSON RPC API server that allows you to access information and control the services. These are accessible via HTTPS, WebSockets, or via client SDKs. The ports can be configured in ~/.chia/mainnet/config/config.yaml. The RPC ports should not be exposed to the internet. TLS certificates are used to secure the communication using mutualTLS. The data layer uses port 8562 by default.

Shared

Methods shared by all services.

Stop the node.

Stop the node.

Authorizations:
bearerAuth
Request Body schema: application/json
required

Empty request body

object

Responses

Request samples

Content type
application/json
{ }

Response samples

Content type
application/json
{
  • "success": true,
  • "error": "string"
}

Add a connection to another node.

Add a connection to another node.

Authorizations:
bearerAuth
Request Body schema: application/json
required

the address of the connection

ip
required
string <ipaddress>
port
required
integer

Responses

Request samples

Content type
application/json
{
  • "ip": "string",
  • "port": 0
}

Response samples

Content type
application/json
{
  • "success": true,
  • "error": "string"
}

Removes a connection.

Removes a connection.

Authorizations:
bearerAuth
Request Body schema: application/json
required

the node id of the connection

node_id
required
string

Responses

Request samples

Content type
application/json
{
  • "node_id": "string"
}

Response samples

Content type
application/json
{
  • "success": true,
  • "error": "string"
}

Retrieve the list of connections.

Retrieve the list of connections.

Authorizations:
bearerAuth
Request Body schema: application/json
required

Empty request body

object

Responses

Request samples

Content type
application/json
{ }

Response samples

Content type
application/json
{
  • "connections": [
    ],
  • "success": true,
  • "error": "string"
}

Heartbeat.

Heartbeat.

Authorizations:
bearerAuth
Request Body schema: application/json
required

Empty request body

object

Responses

Request samples

Content type
application/json
{ }

Response samples

Content type
application/json
{
  • "success": true,
  • "error": "string"
}

Retrieve the list of routes exposed by the service.

Retrieve the list of routes/endpoints exposed by the service.

Authorizations:
bearerAuth
Request Body schema: application/json
required

Empty request body

object

Responses

Request samples

Content type
application/json
{ }

Response samples

Content type
application/json
{
  • "routes": [
    ],
  • "success": true,
  • "error": "string"
}

Retrieves some information about the current network.

Retrieves some information about the current network.

Authorizations:
bearerAuth
Request Body schema: application/json
required

Empty request body

object

Responses

Request samples

Content type
application/json
{ }

Response samples

Content type
application/json
{
  • "network_name": "mainnet",
  • "network_prefix": "xch",
  • "success": true,
  • "error": "string"
}

Data Layer

The data layer RPC API is exposed, by default, on port 8561 and contains methods interacting with =off-chain data.

Creates a data store.

Creates a data store.

Authorizations:
bearerAuth
Request Body schema: application/json
required
fee
integer <uint64>
Default: 0

Responses

Request samples

Content type
application/json
{
  • "fee": 0
}

Response samples

Content type
application/json
{
  • "txs": [
    ],
  • "id": "string",
  • "success": true,
  • "error": "string"
}

Gets the list of owned store ids.

Gets the list of owned store ids.

Authorizations:
bearerAuth
Request Body schema: application/json
required

Empty request body

object

Responses

Request samples

Content type
application/json
{ }

Response samples

Content type
application/json
{
  • "store_ids": [
    ],
  • "success": true,
  • "error": "string"
}

Applies a batch of updates.

Applies a batch of updates.

Authorizations:
bearerAuth
Request Body schema: application/json
required
id
required
string <bytes32>
Array of objects
fee
integer <uint64>
Default: 0
submit_on_chain
boolean
Default: true

Responses

Request samples

Content type
application/json
{
  • "id": "string",
  • "changelist": [
    ],
  • "fee": 0,
  • "submit_on_chain": true
}

Response samples

Content type
application/json
{
  • "tx_id": "string",
  • "success": true,
  • "error": "string"
}

Get the value for a given id/key pair.

Get the value for a given id/key pair.

Authorizations:
bearerAuth
Request Body schema: application/json
required
id
required
string <bytes32>
key
required
string <bytes32>
root_hash
string <bytes32>

Responses

Request samples

Content type
application/json
{
  • "id": "string",
  • "key": "string",
  • "root_hash": "string"
}

Response samples

Content type
application/json
{
  • "value": "string",
  • "success": true,
  • "error": "string"
}

Get the keys for a given id/root_hash pair.

Get the keys for a given id/root_hash pair.

Authorizations:
bearerAuth
Request Body schema: application/json
required
id
required
string <bytes32>
root_hash
required
string <bytes32>
page
integer <int32>
max_page_size
integer <int32>

Responses

Request samples

Content type
application/json
{
  • "id": "string",
  • "root_hash": "string",
  • "page": 0,
  • "max_page_size": 0
}

Response samples

Content type
application/json
{
  • "keys": [
    ],
  • "root_hash": "string",
  • "total_pages": 0,
  • "total_bytes": 0,
  • "success": true,
  • "error": "string"
}

Get the keys and values for a given id/root_hash pair.

Get the keys and values for a given id/root_hash pair.

Authorizations:
bearerAuth
Request Body schema: application/json
required
id
required
string <bytes32>
root_hash
required
string <bytes32>
page
integer <int32>
max_page_size
integer <int32>

Responses

Request samples

Content type
application/json
{
  • "id": "string",
  • "root_hash": "string",
  • "page": 0,
  • "max_page_size": 0
}

Response samples

Content type
application/json
{
  • "keys_values": [
    ],
  • "root_hash": "string",
  • "total_pages": 0,
  • "total_bytes": 0,
  • "success": true,
  • "error": "string"
}

Gets the list of ancestors for a given id/hash pair.

Gets the list of ancestors for a given id/hash pair.

Authorizations:
bearerAuth
Request Body schema: application/json
required
id
required
string <bytes32>
hash
required
string <bytes32>

Responses

Request samples

Content type
application/json
{
  • "id": "string",
  • "hash": "string"
}

Response samples

Content type
application/json
{
  • "ancestors": [
    ],
  • "success": true,
  • "error": "string"
}

Gets the sync status of a store.

Gets the sync status of a store.

Authorizations:
bearerAuth
Request Body schema: application/json
required
id
required
string <bytes32>

Responses

Request samples

Content type
application/json
{
  • "id": "string"
}

Response samples

Content type
application/json
{
  • "sync_status": {
    },
  • "success": true,
  • "error": "string"
}

Gets hash of latest tree root.

Gets hash of latest tree root.

Authorizations:
bearerAuth
Request Body schema: application/json
required
id
required
string <bytes32>

Responses

Request samples

Content type
application/json
{
  • "id": "string"
}

Response samples

Content type
application/json
{
  • "hash": "string",
  • "confirmed": true,
  • "timestamp": 0,
  • "success": true,
  • "error": "string"
}

Gets hash of latest tree root saved in our local datastore.

Gets hash of latest tree root saved in our local datastore.

Authorizations:
bearerAuth
Request Body schema: application/json
required
id
required
string <bytes32>

Responses

Request samples

Content type
application/json
{
  • "id": "string"
}

Response samples

Content type
application/json
{
  • "hash": "string",
  • "success": true,
  • "error": "string"
}

Gets state hashes for a list of roots

Gets state hashes for a list of roots.

Authorizations:
bearerAuth
Request Body schema: application/json
required
ids
required
Array of strings <bytes32> [ items <bytes32 > ]

Responses

Request samples

Content type
application/json
{
  • "ids": [
    ]
}

Response samples

Content type
application/json
{
  • "root_hashes": [
    ],
  • "success": true,
  • "error": "string"
}

Removes a list of rows.

Removes a list of rows.

Authorizations:
bearerAuth
Request Body schema: application/json
required
key
required
string <bytes32>
id
required
string <bytes32>
fee
integer <uint64>
Default: 0

Responses

Request samples

Content type
application/json
{
  • "key": "string",
  • "id": "string",
  • "fee": 0
}

Response samples

Content type
application/json
{
  • "tx_id": "string",
  • "success": true,
  • "error": "string"
}

Adds a list of clvm objects as bytes to add to table.

Adds a list of clvm objects as bytes to add to table.

Authorizations:
bearerAuth
Request Body schema: application/json
required
value
required
string <bytes32>
id
required
string <bytes32>
fee
integer <uint64>
Default: 0

Responses

Request samples

Content type
application/json
{
  • "value": "string",
  • "id": "string",
  • "fee": 0
}

Response samples

Content type
application/json
{
  • "tx_id": "string",
  • "success": true,
  • "error": "string"
}

Get kv diff between two root hashes.

Get kv diff between two root hashes.

Authorizations:
bearerAuth
Request Body schema: application/json
required
id
required
string <bytes32>
hash_1
required
string <bytes32>
hash_2
required
string <bytes32>
page
integer <int32>
max_page_size
integer <int32>

Responses

Request samples

Content type
application/json
{
  • "id": "string",
  • "hash_1": "string",
  • "hash_2": "string",
  • "page": 0,
  • "max_page_size": 0
}

Response samples

Content type
application/json
{
  • "diff": [
    ],
  • "total_pages": 0,
  • "total_bytes": 0,
  • "success": true,
  • "error": "string"
}

Get history of state hashes for a store.

Get history of state hashes for a store.

Authorizations:
bearerAuth
Request Body schema: application/json
required
id
required
string <bytes32>

Responses

Request samples

Content type
application/json
{
  • "id": "string"
}

Response samples

Content type
application/json
{
  • "root_history": [
    ],
  • "success": true,
  • "error": "string"
}

Complete the data server files.

Complete the data server files.

Authorizations:
bearerAuth
Request Body schema: application/json
required
ids
required
Array of strings <bytes32> [ items <bytes32 > ]
overwrite
boolean
Default: false
foldername
string

Responses

Request samples

Content type
application/json
{
  • "ids": [
    ],
  • "overwrite": false,
  • "foldername": "string"
}

Response samples

Content type
application/json
{
  • "success": true,
  • "error": "string"
}

Logs into the wallet.

Logs into the wallet.

Authorizations:
bearerAuth
Request Body schema: application/json
required
fingerprint
required
integer <uint32>

Responses

Request samples

Content type
application/json
{
  • "fingerprint": 0
}

Response samples

Content type
application/json
{
  • "success": true,
  • "error": "string"
}

Retrieves a proof.

Retrieves a proof.

Authorizations:
bearerAuth
Request Body schema: application/json
required
store_id
required
string <bytes32>
keys
Array of strings <bytes32> [ items <bytes32 > ]

Responses

Request samples

Content type
application/json
{
  • "store_id": "string",
  • "keys": [
    ]
}

Response samples

Content type
application/json
{
  • "proof": {
    },
  • "success": true,
  • "error": "string"
}

Verifies a proof.

Verifies a proof.

Authorizations:
bearerAuth
Request Body schema: application/json
required
coin_id
string <bytes32>
inner_puzzle_hash
string <bytes32>
object (store_proofs)

Responses

Request samples

Content type
application/json
{
  • "coin_id": "string",
  • "inner_puzzle_hash": "string",
  • "store_proofs": {
    }
}

Response samples

Content type
application/json
{
  • "current_root": true,
  • "verified_clvm_hashes": {
    },
  • "success": true,
  • "error": "string"
}

Submits a pending root.

Submits a pending root.

Authorizations:
bearerAuth
Request Body schema: application/json
required
store_id
required
string <bytes32>
fee
integer <uint64>
Default: 0

Responses

Request samples

Content type
application/json
{
  • "store_id": "string",
  • "fee": 0
}

Response samples

Content type
application/json
{
  • "tx_id": "string",
  • "success": true,
  • "error": "string"
}

Mirrors

Methods for managing mirrors.

Adds a mirror.

Adds a mirror.

Authorizations:
bearerAuth
Request Body schema: application/json
required
id
required
string <bytes32>
amount
required
integer <uint64>
urls
required
Array of strings <bytes32> [ items <bytes32 > ]
fee
integer <uint64>
Default: 0

Responses

Request samples

Content type
application/json
{
  • "id": "string",
  • "amount": 0,
  • "urls": [
    ],
  • "fee": 0
}

Response samples

Content type
application/json
{
  • "success": true,
  • "error": "string"
}

Deletes a mirror.

Deletes a mirror.

Authorizations:
bearerAuth
Request Body schema: application/json
required
coin_id
required
string <bytes32>
fee
integer <uint64>
Default: 0

Responses

Request samples

Content type
application/json
{
  • "coin_id": "string",
  • "fee": 0
}

Response samples

Content type
application/json
{
  • "success": true,
  • "error": "string"
}

Gets the mirrors for a given store id.

Gets the mirrors for a given store id.

Authorizations:
bearerAuth
Request Body schema: application/json
required
id
required
string <bytes32>

Responses

Request samples

Content type
application/json
{
  • "id": "string"
}

Response samples

Content type
application/json
{
  • "mirrors": [],
  • "success": true,
  • "error": "string"
}

Subscriptions

Methods related to singleton subscriptions.

Subscribe to singleton.

Subscribe to singleton.

Authorizations:
bearerAuth
Request Body schema: application/json
required
urls
Array of strings <bytes32> [ items <bytes32 > ]
id
required
string <bytes32>

Responses

Request samples

Content type
application/json
{
  • "urls": [
    ],
  • "id": "string"
}

Response samples

Content type
application/json
{
  • "success": true,
  • "error": "string"
}

Unsubscribe from singleton.

Unsubscribe from singleton.

Authorizations:
bearerAuth
Request Body schema: application/json
required
id
required
string <bytes32>
retain
boolean
Default: false

Responses

Request samples

Content type
application/json
{
  • "id": "string",
  • "retain": false
}

Response samples

Content type
application/json
{
  • "success": true,
  • "error": "string"
}

Removes subscriptions for the given id.

Removes subscriptions for the given id.

Authorizations:
bearerAuth
Request Body schema: application/json
required
urls
Array of strings <bytes32> [ items <bytes32 > ]
id
required
string <bytes32>

Responses

Request samples

Content type
application/json
{
  • "urls": [
    ],
  • "id": "string"
}

Response samples

Content type
application/json
{
  • "success": true,
  • "error": "string"
}

List current subscriptions.

List current subscriptions.

Authorizations:
bearerAuth
Request Body schema: application/json
required

Empty request body

object

Responses

Request samples

Content type
application/json
{ }

Response samples

Content type
application/json
{
  • "store_ids": [
    ],
  • "success": true,
  • "error": "string"
}

Checks the status of plugins.

Checks the status of plugins.

Authorizations:
bearerAuth
Request Body schema: application/json
required

Empty request body

object

Responses

Request samples

Content type
application/json
{ }

Response samples

Content type
application/json
{
  • "uploaders": {
    },
  • "downloaders": {
    },
  • "success": true,
  • "error": "string"
}

Clears pending roots.

Clears pending roots.

Authorizations:
bearerAuth
Request Body schema: application/json
required
store_id
required
string <bytes32>

Responses

Request samples

Content type
application/json
{
  • "store_id": "string"
}

Response samples

Content type
application/json
{
  • "tree_id": "string",
  • "node_hash": "string",
  • "generation": 0,
  • "status": 1,
  • "success": true,
  • "error": "string"
}

Offers

Methods related to offers.

Makes an offer.

Makes an offer.

Authorizations:
bearerAuth
Request Body schema: application/json
required
required
Array of objects (offer_store)
required
Array of objects (offer_store)
fee
integer <uint64>
Default: 0

Responses

Request samples

Content type
application/json
{
  • "maker": [
    ],
  • "taker": [
    ],
  • "fee": 0
}

Response samples

Content type
application/json
{
  • "offer": {
    },
  • "success": true,
  • "error": "string"
}

Takes an offer.

Takes an offer.

Authorizations:
bearerAuth
Request Body schema: application/json
required
required
object (offer)
fee
integer <uint64>
Default: 0

Responses

Request samples

Content type
application/json
{
  • "offer": {
    },
  • "fee": 0
}

Response samples

Content type
application/json
{
  • "trade_id": "string",
  • "success": true,
  • "error": "string"
}

Verifies an offer.

Verifies an offer.

Authorizations:
bearerAuth
Request Body schema: application/json
required
required
object (offer)
fee
integer <uint64>
Default: 0

Responses

Request samples

Content type
application/json
{
  • "offer": {
    },
  • "fee": 0
}

Response samples

Content type
application/json
{
  • "valid": true,
  • "fee": 0,
  • "success": true,
  • "error": "string"
}

Cancels an offer.

Cancels an offer.

Authorizations:
bearerAuth
Request Body schema: application/json
required
object
fee
integer <uint64>
Default: 0

Responses

Request samples

Content type
application/json
{
  • "offer": {
    },
  • "fee": 0
}

Response samples

Content type
application/json
{
  • "success": true,
  • "error": "string"
}