> ## Documentation Index
> Fetch the complete documentation index at: https://docs.parallaxprotocol.org/llms.txt
> Use this file to discover all available pages before exploring further.

# admin

The `admin` API gives access to several non-standard RPC methods, which allows fine grained control over an Parallax client instance, including but not limited to network peer and RPC endpoint management.

### admin\_addPeer

The addPeer administrative method requests adding a new remote node to the list of tracked static nodes. The node will try to maintain connectivity to these nodes at all times, reconnecting every once in a while if the remote connection goes down.

The method accepts a single argument, the [enode](../../../parallax-protocol/advanced/networking/addresses) URL of the remote peer to start tracking and returns a BOOL indicating whether the peer was accepted for tracking or some error occurred.

| CLIENT  | METHOD INVOCATION                              |
| ------- | ---------------------------------------------- |
| Go      | admin.AddPeer(url string) (bool, error)        |
| Console | admin.addPeer(url)                             |
| RPC     | \{method": "admin\_addPeer", "params": \[url]} |

#### Example

```javascript theme={null}
> admin.addPeer("enode://a979fb575495b8d6db44f750317d0f4622bf4c2aa3365d6af7c284339968eef29b69ad0dce72a4d8db5ebb4968de0e3bec910127f134779fbcb0cb6d3331163c@52.16.188.185:32110")
true
```

### admin\_addTrustedPeer

Adds the given node to a reserved trusted list which allows the node to always connect, even if the slots are full. It returns a BOOL to indicate whether the peer was successfully added to the list.

| CLIENT  | METHOD INVOCATION                                     |
| ------- | ----------------------------------------------------- |
| Console | admin.addTrustedPeer(url)                             |
| RPC     | \{method": "admin\_addTrustedPeer", "params": \[url]} |

### admin\_datadir

The datadir administrative property can be queried for the absolute path the running the Parallax node currently uses to store all its databases.

| CLIENT  | METHOD INVOCATION               |
| ------- | ------------------------------- |
| Go      | admin.Datadir() (string, error) |
| Console | admin.datadir                   |
| RPC     | \{method": "admin\_datadir"}    |

#### Example

```javascript theme={null}
> admin.datadir
"/home/john/.parallax"
```

### admin\_exportChain

Exports the current blockchain into a local file. It optionally takes a first and last block number, in which case it exports only that range of blocks. It returns a boolean indicating whether the operation succeeded.

| CLIENT  | METHOD INVOCATION                                                     |
| ------- | --------------------------------------------------------------------- |
| Console | admin.exportChain(file, first, last)                                  |
| RPC     | \{method": "admin\_exportChain", "params": \[string, uint64, uint64]} |

### admin\_importChain

Imports an exported list of blocks from a local file. Importing involves processing the blocks and inserting them into the canonical chain. The state from the parent block of this range is required. It returns a boolean indicating whether the operation succeeded.

| CLIENT  | METHOD INVOCATION                                     |
| ------- | ----------------------------------------------------- |
| Console | admin.importChain(file)                               |
| RPC     | \{method": "admin\_importChain", "params": \[string]} |

### admin\_nodeInfo

The nodeInfo administrative property can be queried for all the information known about the running the Parallax node at the networking granularity. These include general information about the node itself as a participant of the [ÐΞVp2p](https://github.com/ethereum/devp2p/blob/master/caps/eth.md) P2P overlay protocol, as well as specialized information added by each of the running application protocols (e.g. eth, les, shh, bzz).

| CLIENT  | METHOD INVOCATION                        |
| ------- | ---------------------------------------- |
| Go      | admin.NodeInfo() (\*p2p.NodeInfo, error) |
| Console | admin.nodeInfo                           |
| RPC     | \{method": "admin\_nodeInfo"}            |

#### Example

```javascript theme={null}
> admin.nodeInfo
{
  enode: "enode://df18e0e4fea492eef74787a67368ada6200f6ed8ab01a9b105904fac442d720591aa9ab87d33c42ad1abcf24cc3eed373c3eb8dbc0df29b206615cc80a949c94@127.0.0.1:32110",
  enr: "enr:-KO4QL1FbkA2y9yCx_bXLIXApQKUgPLiCrhszQfXQH6IoCqaJYKHXCBJHm6A0G7NpvJF-MLyr1cS8imBYdgcEigzUm6GAZmWB3qcg2V0aMfGhN4LIImAgmlkgnY0gmlwhH8AAAGJc2VjcDI1NmsxoQLfGODk_qSS7vdHh6ZzaK2mIA9u2KsBqbEFkE-sRC1yBYRzbmFwwIN0Y3CCfW6DdWRwgn1u",
  id: "6c0a4611b88067d29f43e764475ec3ce70de6139c7316b960deadd29203fa358",
  ip: "127.0.0.1",
  listenAddr: "[::]:32110",
  name: "Prlx/v0.1.1-stable-d9425677/linux-amd64/go1.25.1 X:nodwarf5",
  ports: {
    discovery: 32110,
    listener: 32110
  },
  protocols: {
    parallax: {
      config: {
        berlinBlock: 0,
        byzantiumBlock: 0,
        chainId: 2111,
        constantinopleBlock: 0,
        eip150Block: 0,
        eip150Hash: "0x0000000000000000000000000000000000000000000000000000000000000000",
        eip155Block: 0,
        eip158Block: 0,
        xhash: {...},
        homesteadBlock: 0,
        istanbulBlock: 0,
        minDifficulty: 33554432,
        petersburgBlock: 0
      },
      difficulty: 286554849280,
      genesis: "0x2b0467e57fabfc5d8082765e7bbc1f6aad8f13ddd937142f51c85e3f7051be5f",
      head: "0x39a519def2f7eb13b4bc6affa22d34acb6a70c4b52782b8173f9119d9a5e20a8",
      network: 2111
    },
    snap: {}
  }
}
```

### admin\_peerEvents

PeerEvents creates an [RPC subscription](../json-rpc-server/realtime-events) which receives peer events from the node's p2p server. The type of events emitted by the server are as follows:

* add: emitted when a peer is added
* drop: emitted when a peer is dropped
* msgsend: emitted when a message is successfully sent to a peer
* msgrecv: emitted when a message is received from a peer

### admin\_peers

The peers administrative property can be queried for all the information known about the connected remote nodes at the networking granularity. These include general information about the nodes themselves as participants of the [ÐΞVp2p](https://github.com/ethereum/devp2p/blob/master/caps/eth.md) P2P overlay protocol, as well as specialized information added by each of the running application protocols (e.g. eth, les, shh, bzz).

| CLIENT  | METHOD INVOCATION                        |
| ------- | ---------------------------------------- |
| Go      | admin.Peers() (\[]\*p2p.PeerInfo, error) |
| Console | admin.peers                              |
| RPC     | \{method": "admin\_peers"}               |

#### Example

```javascript theme={null}
> admin.peers
[{
    caps: ["parallax/66", "snap/1"],
    enode: "enode://c8d58742fef51a70267a916949cefd0d7ba5bdb75393bbfcbcbc959b3eebf16353ac15d1f7493d749f7f452ff2bec894b8a8c469306e247d265f4f305c5740f7@69.62.94.166:32110",
    id: "2048d5ae22f7206bc8ad6476a2918bd7558776b0438e0cde4eb579d5d85d8886",
    name: "Prlx/v0.1.1-stable-78d2f22b/linux-amd64/go1.25.1",
    network: {
      inbound: false,
      localAddress: "192.168.3.2:37772",
      remoteAddress: "69.62.94.166:32110",
      static: false,
      trusted: false
    },
    protocols: {
      parallax: {
        difficulty: 286554849280,
        head: "0x39a519def2f7eb13b4bc6affa22d34acb6a70c4b52782b8173f9119d9a5e20a8",
        version: 66
      },
      snap: {
        version: 1
      }
    }
}, {
    caps: ["parallax/66", "snap/1"],
    enode: "enode://d3440cdb8f942e1f01dac2292b7a8f886831800e301c41cf943a4ba4c68e37513920cd94c421fa5e073ed7329d9c3194e3911c857b9ded1677a5234441d9950d@54.94.191.104:32110",
    id: "4dd1f03a46b51083b7fa10bda14a92ddd0c1e80ec1ef3320c229a098e5f81865",
    name: "Prlx/v0.1.1-stable-78d2f22b/linux-arm64/go1.25.1",
    network: {
      inbound: false,
      localAddress: "192.168.3.2:55992",
      remoteAddress: "54.94.191.104:32110",
      static: false,
      trusted: false
    },
    protocols: {
      parallax: {
        difficulty: 286689067008,
        head: "0x46c56ac46f354b18650c623c0605e214f9fb1942e9a77f19489e581d9f39b891",
        version: 66
      },
      snap: {
        version: 1
      }
    }
}]
```

### admin\_removePeer

Disconnects from a remote node if the connection exists. It returns a boolean indicating validations succeeded. Note a true value doesn't necessarily mean that there was a connection which was disconnected.

| CLIENT  | METHOD INVOCATION                                    |
| ------- | ---------------------------------------------------- |
| Console | admin.removePeer(url)                                |
| RPC     | \{method": "admin\_removePeer", "params": \[string]} |

### admin\_removeTrustedPeer

Removes a remote node from the trusted peer set, but it does not disconnect it automatically. It returns a boolean indicating validations succeeded.

| CLIENT  | METHOD INVOCATION                                           |
| ------- | ----------------------------------------------------------- |
| Console | admin.removeTrustedPeer(url)                                |
| RPC     | \{method": "admin\_removeTrustedPeer", "params": \[string]} |

### admin\_startHTTP

The startHTTP administrative method starts an HTTP based JSON-RPC [API](../json-rpc-server/overview) webserver to handle client requests. All the parameters are optional:

* host: network interface to open the listener socket on (defaults to "localhost")
* port: network port to open the listener socket on (defaults to 8545)
* cors: [cross-origin resource sharing](https://en.wikipedia.org/wiki/Cross-origin_resource_sharing) header to use (defaults to "")
* apis: API modules to offer over this interface (defaults to "eth,net,web3")

The method returns a boolean flag specifying whether the HTTP RPC listener was opened or not. Please note, only one HTTP endpoint is allowed to be active at any time.

| CLIENT  | METHOD INVOCATION                                                                                |
| ------- | ------------------------------------------------------------------------------------------------ |
| Go      | admin.StartHTTP(host \*string, port \*rpc.HexNumber, cors \*string, apis \*string) (bool, error) |
| Console | admin.startHTTP(host, port, cors, apis)                                                          |
| RPC     | \{method": "admin\_startHTTP", "params": \[host, port, cors, apis]}                              |

#### Example

```javascript theme={null}
> admin.startHTTP("127.0.0.1", 8545)
true
```

### admin\_startWS

The startWS administrative method starts an WebSocket based [JSON RPC](../json-rpc-server/overview) API webserver to handle client requests. All the parameters are optional:

* host: network interface to open the listener socket on (defaults to "localhost")
* port: network port to open the listener socket on (defaults to 8546)
* cors: [cross-origin resource sharing](https://en.wikipedia.org/wiki/Cross-origin_resource_sharing) header to use (defaults to "")
* apis: API modules to offer over this interface (defaults to "eth,net,web3")

The method returns a boolean flag specifying whether the WebSocket RPC listener was opened or not. Please note, only one WebSocket endpoint is allowed to be active at any time.

| CLIENT  | METHOD INVOCATION                                                                              |
| ------- | ---------------------------------------------------------------------------------------------- |
| Go      | admin.StartWS(host \*string, port \*rpc.HexNumber, cors \*string, apis \*string) (bool, error) |
| Console | admin.startWS(host, port, cors, apis)                                                          |
| RPC     | \{method": "admin\_startWS", "params": \[host, port, cors, apis]}                              |

#### Example

```javascript theme={null}
> admin.startWS("127.0.0.1", 8546)
true
```

### admin\_stopHTTP

The stopHTTP administrative method closes the currently open HTTP RPC endpoint. As the node can only have a single HTTP endpoint running, this method takes no parameters, returning a boolean whether the endpoint was closed or not.

| CLIENT  | METHOD INVOCATION              |
| ------- | ------------------------------ |
| Go      | admin.StopHTTP() (bool, error) |
| Console | admin.stopHTTP()               |
| RPC     | \{method": "admin\_stopHTTP"}  |

#### Example

```javascript theme={null}
> admin.stopHTTP()
true
```

### admin\_stopWS

The stopWS administrative method closes the currently open WebSocket RPC endpoint. As the node can only have a single WebSocket endpoint running, this method takes no parameters, returning a boolean whether the endpoint was closed or not.

| CLIENT  | METHOD INVOCATION            |
| ------- | ---------------------------- |
| Go      | admin.StopWS() (bool, error) |
| Console | admin.stopWS()               |
| RPC     | \{method": "admin\_stopWS"}  |

#### Example

```javascript theme={null}
> admin.stopWS()
true
```
