Skip to main content
Version: Next

admin namespace

admin_addPeer

Adds given node.

curl localhost:8545 \
-X POST \
-H "Content-Type: application/json" \
--data '{
"jsonrpc": "2.0",
"id": 0,
"method": "admin_addPeer",
"params": [enode, addToStaticNodes]
}'

admin_addTrustedPeer

Adds given node as a trusted peer, allowing the node to always connect even if slots are full.

curl localhost:8545 \
-X POST \
-H "Content-Type: application/json" \
--data '{
"jsonrpc": "2.0",
"id": 0,
"method": "admin_addTrustedPeer",
"params": [enode]
}'

admin_dataDir

Returns the absolute path to the node's data directory.

curl localhost:8545 \
-X POST \
-H "Content-Type: application/json" \
--data '{
"jsonrpc": "2.0",
"id": 0,
"method": "admin_dataDir",
"params": []
}'

admin_isStateRootAvailable

True if state root for the block is available

curl localhost:8545 \
-X POST \
-H "Content-Type: application/json" \
--data '{
"jsonrpc": "2.0",
"id": 0,
"method": "admin_isStateRootAvailable",
"params": [block]
}'

admin_nodeInfo

Displays relevant information about this node.

curl localhost:8545 \
-X POST \
-H "Content-Type: application/json" \
--data '{
"jsonrpc": "2.0",
"id": 0,
"method": "admin_nodeInfo",
"params": []
}'

admin_peers

Displays a list of connected peers including information about them (clientId, host, port, address, isBootnode, isStatic, enode).

curl localhost:8545 \
-X POST \
-H "Content-Type: application/json" \
--data '{
"jsonrpc": "2.0",
"id": 0,
"method": "admin_peers",
"params": [includeDetails]
}'

admin_removePeer

Removes given node.

curl localhost:8545 \
-X POST \
-H "Content-Type: application/json" \
--data '{
"jsonrpc": "2.0",
"id": 0,
"method": "admin_removePeer",
"params": [enode, removeFromStaticNodes]
}'

admin_removeTrustedPeer

Removes the given node from the trusted peers list.

curl localhost:8545 \
-X POST \
-H "Content-Type: application/json" \
--data '{
"jsonrpc": "2.0",
"id": 0,
"method": "admin_removeTrustedPeer",
"params": [enode]
}'

admin_subscribe

Subscribes to a particular event over WebSocket. For every event that matches the subscription, a notification with event details and subscription id is sent to a client.

curl localhost:8545 \
-X POST \
-H "Content-Type: application/json" \
--data '{
"jsonrpc": "2.0",
"id": 0,
"method": "admin_subscribe",
"params": [subscriptionName, args]
}'

admin_unsubscribe

Unsubscribes from a subscription.

curl localhost:8545 \
-X POST \
-H "Content-Type: application/json" \
--data '{
"jsonrpc": "2.0",
"id": 0,
"method": "admin_unsubscribe",
"params": [subscriptionId]
}'