github.com/lmittmann/w3@v0.20.0/docs/pages/rpc-methods/admin.mdx (about)

     1  # `admin`-Namespace
     2  
     3  List of supported RPC methods for `w3.Client` in the `admin`-namespace.
     4  
     5  ## `admin_addPeer`
     6  `AddPeer` adds a new peer to the node's peer set and returns a bool indicating success.
     7  ```go {3}
     8  var success bool
     9  client.Call(
    10      admin.AddPeer(url).Returns(&success),
    11  )
    12  ```
    13  
    14  ## `admin_removePeer`
    15  `RemovePeer` removes a peer from the node's peer set and returns a bool indicating success.
    16  ```go {3}
    17  var success bool
    18  client.Call(
    19      admin.RemovePeer(url).Returns(&success),
    20  )
    21  ```
    22  
    23  ## `admin_addTrustedPeer`
    24  `AddTrustedPeer` adds a new trusted peer to the node's trusted peer set and returns a bool indicating success.
    25  ```go {3}
    26  var success bool
    27  client.Call(
    28      admin.AddTrustedPeer(url).Returns(&success),
    29  )
    30  ```
    31  
    32  ## `admin_removeTrustedPeer`
    33  `RemoveTrustedPeer` removes a trusted peer from the node's trusted peer set and returns a bool indicating success.
    34  ```go {3}
    35  var success bool
    36  client.Call(
    37      admin.RemoveTrustedPeer(url).Returns(&success),
    38  )
    39  ```
    40  
    41  ## `admin_nodeInfo`
    42  `NodeInfo` returns information about the running node.
    43  ```go {3}
    44  var nodeInfo *admin.NodeInfoResponse
    45  client.Call(
    46      admin.NodeInfo().Returns(&nodeInfo),
    47  )
    48  ```