ADMIN methods

Note
The ADMIN API methods are not enabled by default for JSON-RPC. To enable the ADMIN API methods, use the --rpc-http-api or --rpc-ws-api options.
POST : admin_addPeer
Adds a static node
Caution
If connections are timing out, ensure the node ID in the enode URL is correct.
Parameters
string : Enode URL of peer to add
Returns
result : boolean - true if peer added or false if peer already a static node.
BODY
{
"jsonrpc": "2.0",
"method": "admin_addPeer",
"params": [
"enode://c93f69ddd83d3db3e93e5165d60b4f5d93a9731df776beee94c5f8a0c770e41bd[email protected]127.0.0.1:30303"
],
"id": 1
}
Example Request
POST / HTTP/1.1
Host: localhost:8545
Content-Length: 254
{
"jsonrpc": "2.0",
"method": "admin_addPeer",
"params": [
"enode://c93f69ddd83d3db3e93e5165d60b4f5d93a9731df776beee94c5f8a0c770e41bd[email protected]127.0.0.1:30303"
],
"id": 1
Example Response
{
"jsonrpc": "2.0",
"id": 1,
"result": true
}
POST : admin_changeLogLevel
Changes the log level without restarting QI. You can change the log level for all logs, or you can change the log level for specific packages or classes.
You can specify only one log level per RPC call.
Parameters
level - Log level
log_filter: Array - Packages or classes to change the log level for. Optional.
Returns
result : Success if the log level has changed, otherwise error.
BODY
{
"jsonrpc": "2.0",
"method": "admin_changeLogLevel",
"params": [
"DEBUG"
],
"id": 1
}
Example Request
POST / HTTP/1.1
Host: localhost:8545
Content-Length: 114
{
"jsonrpc": "2.0",
"method": "admin_changeLogLevel",
"params": [
"DEBUG"
],
"id": 1
Example Response
{
"jsonrpc": "2.0",
"id": 1,
"result": "Success"
}
POST : admin_generateLogBloomCache
Generates cached log bloom indexes for blocks. APIs such as eth_getLogs and eth_getFilterLogs use the cache for improved performance.
note
Each index file contains 100000 blocks. The last fragment of blocks less than 100000 are not indexed.
tip
Manually executing admin_generateLogBloomCache is not required unless the --auto-log-bloom-caching-enabled command line option was set to false.
Parameters
integer - Block to start generating indexes.
integer - Block to stop generating indexes.
Returns
result : object - Log bloom index details:
  • quantity : startBlock - Starting block for the last requested cache generation.
  • quantity : endBlock - Ending block for the last requested cache generation.
  • quantity : currentBlock - The most recent block added to the cache.
  • boolean : indexing - true if indexing is in progress.
  • boolean : true indicates acceptance of the request from this call to generate the cache.
BODY
{
"jsonrpc": "2.0",
"method": "admin_generateLogBloomCache",
"params": [
"0x0",
"0x10000"
],
"id": 1
}
Example Request
POST / HTTP/1.1
Host: localhost:8545
Content-Length: 138
{
"jsonrpc": "2.0",
"method": "admin_generateLogBloomCache",
"params": [
"0x0",
"0x10000"
],
Example Response
{
"jsonrpc": "2.0",
"id": 1,
"result": {
"startBlock": "0x0",
"endBlock": "0x10000",
"currentBlock": "0x0",
"indexing": true,
"requestAccepted": true
}
}
POST : admin_logsRepairCache
Repairs cached logs by fixing all segments starting with the specified block number.
Parameters
quantity - Decimal index of the starting block to fix. If left empty, the head block is used as the starting point.
Returns
result - Status of the repair request. Either Started, or Already running.
BODY
{
"jsonrpc": "2.0",
"method": "admin_logsRepairCache",
"params": [
"1200"
],
"id": 1
}
Example Request
POST / HTTP/1.1
Host: localhost:8545
Content-Length: 114
{
"jsonrpc": "2.0",
"method": "admin_logsRepairCache",
"params": [
"1200"
],
"id": 1
Example Response
{
"jsonrpc": "2.0",
"id": 1,
"result": {
"Status": "Started"
}
}
POST : admin_nodeInfo
Returns networking information about the node. The information includes general information about the node and specific information from each running Ethereum sub-protocol (for example, QIE).
Parameters
None
Returns
result : Node object
Properties of the node object are:
  • enode - Enode URL of the node.
  • listenAddr - Host and port for the node.
  • name - Client name.
  • id - Node public key.
  • ports - Peer discovery and listening ports.
  • protocols - List of objects containing information for each Ethereum sub-protocol.
note
If the node is running locally, the host of the enode and listenAddr display as [::] in the result. When advertising externally, the external address displayed for the enode and listenAddr is defined by --nat-method.
BODY
{
"jsonrpc": "2.0",
"method": "admin_nodeInfo",
"params": [],
"id": 1
}
Example Request
POST / HTTP/1.1
Host: localhost:8545
Content-Length: 87
{
"jsonrpc": "2.0",
"method": "admin_nodeInfo",
"params": [],
"id": 1
}
Example Response
{
"jsonrpc": "2.0",
"id": 1,
"result": {
"enode": "enode://87ec35d558352cc55cd1bf6a472557797f91287b78fe5e86760219124563450ad[email protected][::]:30303",
"listenAddr": "[::]:30303",
"name": "besu/v1.0.1-dev-0d2294a5/osx-x86_64/oracle-java-1.8",
"id": "87ec35d558352cc55cd1bf6a472557797f91287b78fe5e86760219124563450ad1bb807e4cc61e86c574189a851733227155551a14b9d0e1f62c5e11332a18a3",
"ports": {
"discovery": 30303,
"listener": 30303
POST : admin_peers
Returns networking information about connected remote nodes.
Parameters
None
Returns
result : array of objects - Object returned for each remote node.
Properties of the remote node object are:
  • version - P2P protocol version.
  • name - Client name.
  • caps - List of Ethereum sub-protocol capabilities.
  • network - Local and remote addresses established at time of bonding with the peer. The remote address might not match the hex value for port. The remote address depends on which node initiated the connection.
  • port - Port on the remote node on which P2P discovery is listening.
  • id - Node public key. Excluding the 0x prefix, the node public key is the ID in the enode URL enode://<id ex 0x>@<host>:<port>.
  • protocols - Current state of peer including difficulty and head. head is the hash of the highest known block for the peer.
BODY
{
"jsonrpc": "2.0",
"method": "admin_peers",
"params": [],
"id": 1
}
Example Request
POST / HTTP/1.1
Host: localhost:8545
Content-Length: 84
{
"jsonrpc": "2.0",
"method": "admin_peers",
"params": [],
"id": 1
}
Example Response
{
"jsonrpc": "2.0",
"id": 1,
"result": [
{
"version": "0x5",
"name": "besu/v20.10.4-dev-0905d1b2/osx-x86_64/adoptopenjdk-java-11",
"caps": [
"eth/62",
"eth/63",
"eth/64",
POST : admin_removePeer
Removes a static node.
Parameters
string : Enode URL of peer to remove.
Returns
result : boolean - true if peer removed or false if peer not a static node).
BODY
{
"jsonrpc": "2.0",
"method": "admin_removePeer",
"params": [
"enode://f59c0ab603377b6ec88b89d5bb41b98fc385030ab1e4b03752db6f7dab364559d[email protected]127.0.0.1:30304"
],
"id": 1