ADMIN methods

  • 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://f59c0ab603377b6ec88b89d5bb41b98fc385030ab1e4b03752db6f7dab364559d92c757c13116ae6408d2d33f0138e7812eb8b696b2a22fe3332c4b5127b22a3@127.0.0.1:30304"
    ],
    "id": 1

Last updated