跳到主要内容

Solver CLI

The Solver service accepts JSON-RPC over TLS on port 8667 by default (solver.rpc_port in config.yaml). HTTP endpoints are documented on Solver RPC. From the shell, call chia rpc solver <method> '<json>' like other services (see RPC overview).

Sources: chia/cmds/solver.py, chia/cmds/solver_funcs.py, chia/solver/solver_rpc_api.py.

Reference

chia solver get_state

Functionality: Return runtime state from the Solver service over the CLI helper (same data as chia rpc solver get_state).

Usage: chia solver get_state [OPTIONS]

Options:

Short CommandLong CommandTypeRequiredDescription
-sp--solver-rpc-portINTEGERFalseSolver RPC port (see solver.rpc_port in config.yaml).
-h--helpNoneFalseShow a help message and exit.
Example (CLI)
chia solver get_state
chia solver get_state -sp 8667

Response:

get_state prints json.dumps(..., indent=2) from the RPC client. Payload matches SolverRpcApi.get_state:

{
"started": true
}

On failure the same function prints Failed to get solver state: … with the exception message (for example TLS connection errors).

Example (chia rpc)

See also Windows quoting notes on RPC overview.

chia rpc solver get_state '{}'

Response:

HTTP JSON body matches the solver RPC handler (same keys as above):

{
"started": true
}

(Service JSON matches SolverRpcApi.get_state; the chia rpc CLI may add transport metadata depending on version.)

When TLS services are down, the client prints a connection error instead of JSON.

Farmer integration