RPC

Start the JSON-RPC service. Only available in console mode.
Parameters: None

> rpc.start()

Stop the JSON-RPC service. Available in console and attach mode.
Private: Requires authentication.
Parameters: None
Curl Example:
curl -X POST --data '{"jsonrpc":"2.0", "method":"rpc_stop", "id":21 }'

> rpc.stop()

Boolean

{
"id": 21,
"jsonrpc": "2.0",
"result": true
}

Get all JSON-RPC methods.
Parameters: None
Curl Example:
curl -X POST --data '{"jsonrpc":"2.0", "method":"rpc_methods", "id":21 }'

> rpc.methods()

Array<Object>
Field
Type
Description
name
String
The name of the method. (format: <namespace>_<method_name>)
description
String
A brief description of the method.
private
Boolean
Indicate that the method is private or not.

{
"id": 21,
"jsonrpc": "2.0",
"result": [
{
"description": "Add a peer address",
"name": "net_addPeer",
"private": true
}
]
}

Send a value to the server and have it resent back. Used for testing.
Parameters:
Argument
Type
Description
value
Any
The value to be sent and echoed.
Curl Example:
curl -X POST --data '{"jsonrpc":"2.0", "method":"rpc_echo", "params": "Hello, world!", "id":21 }'

> rpc.echo("Hello, world!")

Any

{
"id": 21,
"jsonrpc": "2.0",
"result": "Hello, world!"
}
Copy link
On this page
rpc.start
rpc_stop
rpc_methods
rpc_echo