> ## 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\_addnode

Ingests an address into the addrbook with `source=manual`. Manual entries persist across restarts, are exempt from source-aware bucket eviction, and are heavily weighted in dial selection (a 4x chance multiplier over other sources, not a strict front-of-queue guarantee). Accepts either plain `ip:port` (v2.0-native peers, `KeyType=0x00`) or the legacy `enode://<nodeID>@ip:port` form (v1.x peers, `KeyType=0x01`).

Returns `true` if the entry was inserted or updated, `false` otherwise.

| CLIENT  | METHOD INVOCATION                                 |
| ------- | ------------------------------------------------- |
| Console | admin.addnode(address)                            |
| RPC     | \{method": "admin\_addnode", "params": \[string]} |

#### Example

```javascript theme={null}
> admin.addnode("69.62.94.166:32110")
true
```

### 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\_addrbookResetKey

Regenerates the addrbook's per-node secret `nKey` and clears the tried table atomically. Use after a credible `nKey` leak — without a fresh key, an attacker who learned the old one can predict which buckets future peers will land in and skew the address selection. Destructive: every entry currently in the tried table is moved back to the new table or evicted.

Returns `true` on success.

| CLIENT  | METHOD INVOCATION                     |
| ------- | ------------------------------------- |
| Console | admin.addrbookResetKey()              |
| RPC     | \{method": "admin\_addrbookResetKey"} |

### admin\_addrbookStatus

Returns a read-only snapshot of the addrbook: total entry count, the new/tried split, and per-source counts (`manual`, `dns_seed`, `tcp_gossip`, `legacy_udp`, plus `self_advertised` when present).

| CLIENT  | METHOD INVOCATION                   |
| ------- | ----------------------------------- |
| Console | admin.addrbookStatus()              |
| RPC     | \{method": "admin\_addrbookStatus"} |

#### Example

```javascript theme={null}
> admin.addrbookStatus()
{
  total: 1247,
  new: 1118,
  tried: 129,
  perSource: {
    dns_seed: 64,
    legacy_udp: 0,
    manual: 2,
    tcp_gossip: 1181
  }
}
```

### 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\_clearbanned

Removes every entry from the persistent ban list (`<datadir>/banlist.json`). Does **not** touch the in-memory discourage filter, which is restart-cleared by design.

Returns `true` on success.

| CLIENT  | METHOD INVOCATION                |
| ------- | -------------------------------- |
| Console | admin.clearbanned()              |
| RPC     | \{method": "admin\_clearbanned"} |

### 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\_dialV2

Directly opens a BIP324-style v2 RLPx connection to the given `ip:port`. Bypasses the addrman routability filter, so it can target loopback / RFC1918 addresses for testing. Operator-testing entry point — peers established via `admin_dialV2` are still subject to all the normal post-handshake checks (peer cap, ban list, self-endpoint guard).

Returns `true` if the dial was launched, `false` otherwise.

| CLIENT  | METHOD INVOCATION                                |
| ------- | ------------------------------------------------ |
| Console | admin.dialV2(address)                            |
| RPC     | \{method": "admin\_dialV2", "params": \[string]} |

#### Example

```javascript theme={null}
> admin.dialV2("127.0.0.1:32110")
true
```

### 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\_listbanned

Returns the active (non-expired) entries from the persistent ban list as a JSON array, matching Bitcoin Core's `listbanned` output shape. Each entry has the CIDR-formatted subnet, the Unix-second timestamps for `ban_created` and `banned_until`, plus the derived `ban_duration` and `time_remaining` in seconds. Expired entries are pruned lazily on each call.

| CLIENT  | METHOD INVOCATION               |
| ------- | ------------------------------- |
| Console | admin.listbanned()              |
| RPC     | \{method": "admin\_listbanned"} |

#### Example

```javascript theme={null}
> admin.listbanned()
[
  {
    address: "10.0.0.0/24",
    ban_created: 1730000000,
    banned_until: 1730086400,
    ban_duration: 86400,
    time_remaining: 82500
  }
]
```

### 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).

| 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: "Parallax/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).

| 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: "Parallax/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: "Parallax/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\_removenode

Drops an address from the addrbook regardless of which table holds it. Inverse of `admin_addnode`. Returns `true` if the entry was removed, `false` if it was not present.

| CLIENT  | METHOD INVOCATION                                    |
| ------- | ---------------------------------------------------- |
| Console | admin.removenode(address)                            |
| RPC     | \{method": "admin\_removenode", "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\_setban

Adds or removes an entry in the persistent ban list. Banned IPs are hard-rejected at the listener for every inbound, with no trusted-peer exemption — the rejection happens before the handshake, so the node cannot yet know whether the remote is trusted. If a banned range must reach a trusted peer, unban it rather than working around the check.

Arguments:

* `subnet` — IP or CIDR string. `"1.2.3.4"` is treated as `/32`; `"10.0.0.0/24"` as a CIDR. IPv6 supported similarly.
* `command` — `"add"` or `"remove"`.
* `bantime` — seconds. Honored only on `"add"`. Omitted, `0`, or negative falls back to the daemon's `DefaultBanDuration` (24 h) — relative form only.
* `absolute` — when `true`, `bantime` is interpreted as a Unix timestamp instead of an offset from now and must lie in the future (`0` is an error in this form). Defaults to `false`.

On `"add"` any currently-connected peer whose remote address matches the subnet is also disconnected, and re-adding a currently-active ban is an error (`IP/subnet already banned`) unless the new expiry extends the old one. On `"remove"` the call returns an error if the subnet was not previously banned.

Note for the interactive console: `admin.setban` requires all four positional arguments there — pass `null` for the optional ones, e.g. `admin.setban("1.2.3.4", "add", null, null)`. The JSON-RPC and `parallax-cli` surfaces accept omitted optionals.

Returns `true` on success.

| CLIENT  | METHOD INVOCATION                                                     |
| ------- | --------------------------------------------------------------------- |
| Console | admin.setban(subnet, command, bantime, absolute)                      |
| RPC     | \{method": "admin\_setban", "params": \[string, string, int64, bool]} |

#### Example

```javascript theme={null}
> admin.setban("10.0.0.0/24", "add", 86400, false)
true
> admin.setban("10.0.0.0/24", "remove")
true
```

### 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\_uptime

Returns the number of seconds the node has been running since its most recent `Start`. Returns 0 if the node is not yet fully started. Mirrors Bitcoin Core's `uptime` command and backs the `parallax-cli uptime` command-line helper.

| CLIENT  | METHOD INVOCATION              |
| ------- | ------------------------------ |
| Go      | admin.Uptime() (uint64, error) |
| Console | admin.uptime()                 |
| RPC     | \{method": "admin\_uptime"}    |

#### Example

```javascript theme={null}
> admin.uptime()
86400
```

### admin\_stop

Gracefully shuts down the running node. The method schedules the shutdown on a short delay (about 100 ms) and returns immediately so the RPC response can be delivered before the RPC server itself tears down. Client callers should therefore tolerate the RPC connection being closed without a final response — that outcome still indicates a successful shutdown.

This is the underlying method used by the `parallax-cli stop` command-line helper, analogous to `bitcoin-cli stop` in Bitcoin Core.

| CLIENT  | METHOD INVOCATION          |
| ------- | -------------------------- |
| Go      | admin.Stop() (bool, error) |
| Console | admin.stop()               |
| RPC     | \{method": "admin\_stop"}  |

#### Example

```javascript theme={null}
> admin.stop()
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
```
