admin namespace
admin_addPeer
Adds given node.
- Parameters
- Request
- Response
-
enode
: string -
addToStaticNodes
: boolean
curl localhost:8545 \
-X POST \
-H "Content-Type: application/json" \
--data '{
"jsonrpc": "2.0",
"id": 0,
"method": "admin_addPeer",
"params": [enode, addToStaticNodes]
}'
Added node
{
"jsonrpc": "2.0",
"id": 0,
"result": result
}
result
: string
admin_nodeInfo
Displays relevant information about this node.
- Request
- Response
curl localhost:8545 \
-X POST \
-H "Content-Type: application/json" \
--data '{
"jsonrpc": "2.0",
"id": 0,
"method": "admin_nodeInfo",
"params": []
}'
Information about this node
{
"jsonrpc": "2.0",
"id": 0,
"result": result
}
result
: object
enode
: stringid
: stringip
: stringlistenAddress
: stringname
: stringports
: objectdiscovery
: string (hex integer)listener
: string (hex integer)
protocols
: map of objectdifficulty
: string (hex integer)genesisHash
: string (hash)headHash
: string (hash)newtorkId
: string (hex integer)
admin_peers
Displays a list of connected peers including information about them (clientId
, host
, port
, address
, isBootnode
, isStatic
, enode
).
- Parameters
- Request
- Response
includeDetails
: boolean
curl localhost:8545 \
-X POST \
-H "Content-Type: application/json" \
--data '{
"jsonrpc": "2.0",
"id": 0,
"method": "admin_peers",
"params": [includeDetails]
}'
List of connected peers including information
{
"jsonrpc": "2.0",
"id": 0,
"result": result
}
result
: array of object
address
: stringclientId
: stringclientType
: stringenode
: stringethDetails
: stringhost
: stringisBootnode
: booleanisStatic
: booleanisTrusted
: booleanlastSignal
: stringport
: string (hex integer)
admin_prune
Runs full pruning if enabled.
- Request
- Response
curl localhost:8545 \
-X POST \
-H "Content-Type: application/json" \
--data '{
"jsonrpc": "2.0",
"id": 0,
"method": "admin_prune",
"params": []
}'
{
"jsonrpc": "2.0",
"id": 0,
"result": result
}
result
: integer
admin_removePeer
Removes given node.
- Parameters
- Request
- Response
-
enode
: string -
removeFromStaticNodes
: boolean
curl localhost:8545 \
-X POST \
-H "Content-Type: application/json" \
--data '{
"jsonrpc": "2.0",
"id": 0,
"method": "admin_removePeer",
"params": [enode, removeFromStaticNodes]
}'
Removed node
{
"jsonrpc": "2.0",
"id": 0,
"result": result
}
result
: string