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 harvester uses port 8560 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"
}

Harvester

The harvester RPC API is exposed, by default, on port 8560 and contains methods for managing plot files and directories.

Add a plot directory to the harvester configuration.

Add a plot directory to the harvester configuration.

Authorizations:
bearerAuth
Request Body schema: application/json
required

The directory name to add

dirname
required
string

Responses

Request samples

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

Response samples

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

Removes a plot directory from the harvester configuration.

Removes a plot directory from the harvester configuration.

Authorizations:
bearerAuth
Request Body schema: application/json
required

The directory name to remove

dirname
required
string

Responses

Request samples

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

Response samples

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

Get the list of plot directories from the harvester configuration.

Get the list of plot directories from the harvester configuration.

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
{
  • "directories": [
    ],
  • "success": true,
  • "error": "string"
}

Refresh the list of plots.

Refresh the list of plots.

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

Get information about the plots the harvester knows about.

Get information about the plots the harvester knows about.

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
{
  • "failed_to_open_filenames": [
    ],
  • "not_found_filenames": [
    ],
  • "plots": [
    ],
  • "success": true,
  • "error": "string"
}

Permanently delete a plot file.

Permanently delete a plot file.

Authorizations:
bearerAuth
Request Body schema: application/json
required

the file name of the plot

filename
required
string

Responses

Request samples

Content type
application/json
{
  • "filename": "plot-k33-2021-06-12-03-55-1d5a2afe637578d6c9dfa04484854831012b678921a8dce5a8aee9c0fd3c1470.plot"
}

Response samples

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

Gets harvester configuration.

Gets harvester configuration.

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
{
  • "use_gpu_harvesting": true,
  • "gpu_index": 0,
  • "enforce_gpu_index": true,
  • "disable_cpu_affinity": true,
  • "parallel_decompressor_count": 0,
  • "decompressor_thread_count": 0,
  • "recursive_plot_scan": true,
  • "refresh_parameter_interval_seconds": 0,
  • "success": true,
  • "error": "string"
}

Updates the harvester configuration.

Updates the harvester configuration.

Authorizations:
bearerAuth
Request Body schema: application/json
required

Config details

use_gpu_harvesting
boolean
gpu_index
integer <int>
enforce_gpu_index
boolean
disable_cpu_affinity
boolean
parallel_decompressor_count
integer <int>
decompressor_thread_count
integer <int>
recursive_plot_scan
boolean
refresh_parameter_interval_seconds
integer <uint32>

Responses

Request samples

Content type
application/json
{
  • "use_gpu_harvesting": true,
  • "gpu_index": 0,
  • "enforce_gpu_index": true,
  • "disable_cpu_affinity": true,
  • "parallel_decompressor_count": 0,
  • "decompressor_thread_count": 0,
  • "recursive_plot_scan": true,
  • "refresh_parameter_interval_seconds": 0
}

Response samples

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