Modules: admin

admin_addPeer

AddPeer requests connecting to a remote node, and also maintaining the new connection at all times, even reconnecting if it is lost.

Params (1)

Parameters must be given by position.

1: url string

  • Required: ✓ Yes

Result

bool

  • Required: ✓ Yes

Client Method Invocation Examples

"Shell HTTP"

curl -X POST -H "Content-Type: application/json" http://localhost:8545 --data '{"jsonrpc": "2.0", "id": 42, "method": "admin_addPeer", "params": [<url>]}'

"Shell WebSocket"

wscat -c ws://localhost:8546 -x '{"jsonrpc": "2.0", "id": 1, "method": "admin_addPeer", "params": [<url>]}'

"Javascript Console"


admin_datadir

Datadir retrieves the current data directory the node is using.

Params (0)

None

Result

string

  • Required: ✓ Yes

Client Method Invocation Examples

"Shell HTTP"

"Shell WebSocket"

"Javascript Console"


admin_exportChain

ExportChain exports the current blockchain into a local file, or a range of blocks if first and last are non-nil.

Params (3)

Parameters must be given by position.

1: file string

  • Required: ✓ Yes

2: first *uint64

  • Required: ✓ Yes

"Schema"

"Raw"

3: last *uint64

  • Required: ✓ Yes

"Schema"

"Raw"

Result

bool

  • Required: ✓ Yes

Client Method Invocation Examples

"Shell HTTP"

"Shell WebSocket"

Javascript Console"


admin_maxPeers

MaxPeers sets the maximum peer limit for the protocol manager and the p2p server.

Params (1)

Parameters must be given by position.

1: n int

  • Required: ✓ Yes

"Schema"

"Raw"

Result

bool

  • Required: ✓ Yes

Client Method Invocation Examples

"Shell HTTP"

"Shell WebSocket"

"Javascript Console"


admin_peerEvents

PeerEvents creates an RPC subscription which receives peer events from the node's p2p.Server

Params (0)

None

Result

*rpc.Subscription

  • Required: ✓ Yes

"Schema"

"Raw"

Client Method Invocation Examples

"Shell WebSocket"


admin_removePeer

RemovePeer disconnects from a remote node if the connection exists

Params (1)

Parameters must be given by position.

1: url string

  • Required: ✓ Yes

Result

bool

  • Required: ✓ Yes

Client Method Invocation Examples

"Shell HTTP"

"Shell WebSocket"

"Javascript Console"


admin_startHTTP

StartHTTP starts the HTTP RPC API server.

Params (5)

Parameters must be given by position.

1: host *string

  • Required: ✓ Yes

2: port *int

  • Required: ✓ Yes

"Schema"

"Raw"

3: cors *string

  • Required: ✓ Yes

4: apis *string

  • Required: ✓ Yes

5: vhosts *string

  • Required: ✓ Yes

Result

bool

  • Required: ✓ Yes

Client Method Invocation Examples

"Shell HTTP"

"Shell WebSocket"

"Javascript Console"


admin_startRPC

StartRPC starts the HTTP RPC API server. Deprecated: use StartHTTP instead.

Params (5)

Parameters must be given by position.

1: host *string

  • Required: ✓ Yes

2: port *int

  • Required: ✓ Yes

"Schema"

"Raw"

3: cors *string

  • Required: ✓ Yes

4: apis *string

  • Required: ✓ Yes

5: vhosts *string

  • Required: ✓ Yes

Result

bool

  • Required: ✓ Yes

Client Method Invocation Examples

"Shell HTTP"

"Shell WebSocket"

"Javascript Console"


admin_stopHTTP

StopHTTP shuts down the HTTP server.

Params (0)

None

Result

bool

  • Required: ✓ Yes

Client Method Invocation Examples

"Shell HTTP"

"Shell WebSocket"

"Javascript Console"


admin_stopWS

StopWS terminates all WebSocket servers.

Params (0)

None

Result

bool

  • Required: ✓ Yes

Client Method Invocation Examples

"Shell HTTP"

"Shell WebSocket"

"Javascript Console"

Last updated