# Networking Operations

## Add Peer

Add a peer to the list of known peers and attempt to connect to it. Password protected like the [Debug Operations](/pzm/prizm-api/debug-operations.md). POST only.

**Request:**

* requestType is addPeer
* peer is the IP address or domain name of the peer (plus optional port)

**Response:** refer to [Get Peer](/pzm/prizm-api/prizm-api-examples.md#get-peer)

* isNewlyAdded is true if the peer was not already known, omitted otherwise

**Example:** Refer to [Add Peer](/pzm/prizm-api/prizm-api-examples.md#add-peer) example.

## Blacklist API Proxy Peer

Blacklist a remote node from the UI, so it won't be used when in roaming and light client modes.&#x20;

POST only.

**Request:**

* requestType is blacklistAPIProxyPeer
* peer is the IP address or domain name of the peer (plus optional port)
* adminPassword is a string with the admin password (optional)

**Response:**

* done (B) is true if the peer is blacklisted
* requestProcessingTime (N) is the API request processing time (in millisec)

**Example:** Refer to [Blacklist API Proxy Peer](/pzm/prizm-api/prizm-api-examples.md#blacklist-api-proxy-peer) example.

## Blacklist Peer

Blacklist a peer for the default blacklisting period. Password protected like the [Debug Operations](/pzm/prizm-api/debug-operations.md). POST only.

**Request:**

* requestType is blacklistPeer
* peer is the IP address or domain name of the peer (plus optional port)

**Response:**

* done (B) is true if the peer is blacklisted
* requestProcessingTime (N) is the API request processing time (in millisec)

**Example:** Refer to [Blacklist Peer](/pzm/prizm-api/prizm-api-examples.md#blacklist-peer) example.

## Get Inbound Peers

Get all peers that have sent a request to this peer in the last 30 minutes.

**Request:**

* requestType is getInboundPeers
* includePeerInfo is true to include peer information, otherwise include only the address (optional)

**Response:**

* peers (A) is an array of peer addresses or peer objects (refer to [Get Peer](/pzm/prizm-api/prizm-api-examples.md#get-peer) for details) depending on includePeerInfo
* requestProcessingTime (N) is the API request processing time (in millisec)

**Example:** Refer to [Get Inbound Peers](/pzm/prizm-api/prizm-api-examples.md#get-inbound-peers) example.

## Get My Info

Get hostname and address of the requesting node.

**Request:**

* requestType is getMyInfo

**Response:**

* host (S) is the node hostname
* address (S) is the node address
* requestProcessingTime (N) is the API request processing time (in millisec)

**Example:** Refer to [Get My Info](/pzm/prizm-api/prizm-api-examples.md#get-my-info) example.

## Get Peer

Get information about a given peer.

**Request:**

* requestType is getPeer
* peer is the IP address or domain name of the peer (plus optional port)

**Response:**

* hallmark (S) is the hex string of the peer's hallmark, if it is defined
* downloadedVolume (N) is the number of bytes downloaded by the peer
* address (S) the IP address or DNS name of the peer
* weight (N) is the peer's weight value
* uploadedVolume (N) is the number of bytes uploaded by the peer
* version (S) is the version of the software running on the peer
* platform (S) is a string representing the peer's platform
* lastUpdated (N) is the timestamp (in seconds since the genesis block) of the last peer status update
* blacklisted (B) is true if the peer is blacklisted
* services (A) is an array of strings with the services the node provides
* blacklistingCause (S) is the cause of blacklisting (if blacklisted is true)
* announcedAddress (S) is the name that the peer announced to the network (could be a DNS name, IP address, or any other string)
* application (S) is the name of the software application, typically NRS
* state (N) defines the state of the peer: 0 for NON\_CONNECTED, 1 for CONNECTED, or 2 for DISCONNECTED
* shareAddress (B) is true if the address is allowed to be shared with other peers
* inbound (B) is true if the peer has made a request to this node
* inboundWebSocket (B) is true if an inbound websocket has been established from this node
* outboundWebSocket (B) is true if an outbound websocket has been established to this node
* lastConnectAttempt (B) is the timestamp (in seconds since the genesis block) of the last connection attempt to the peer
* requestProcessingTime (N) is the API request processing time (in millisec)

**Example:** Refer to [Get Peer](/pzm/prizm-api/prizm-api-examples.md#get-peer) example.

## Get Peers

Get a list of peer IP addresses.

**Request:**

* requestType is getPeers
* active is true for active (not NON\_CONNECTED) peers only (optional, if true overrides state)
* state is the state of the peers, one of NON\_CONNECTED, CONNECTED, or DISCONNECTED (optional)
* includePeerInfo is true to include peer detail as in [Get Peer](/pzm/prizm-api/prizm-api-examples.md#get-peer)
* service to filter on a specific service

**Note:** If neither active nor state is specified, all known peers are retrieved.

**Response:**

* peers (A) is an array of peer addresses
* requestProcessingTime (N) is the API request processing time (in millisec)

**Example:** Refer to [Get Peers](/pzm/prizm-api/prizm-api-examples.md#get-peers) example.

## Set API Proxy Peer

Set the remote node to use when in roaming and light client modes. POST only.

**Request:**

* requestType is setAPIProxyPeer
* peer is the IP address or domain name of the peer (plus optional port)
* adminPassword is a string with the admin password (optional)

**Response:**

* downloadedVolume (N) is the number of bytes downloaded by the peer
* address (S) the IP address or DNS name of the peer
* weight (N) is the peer's weight value
* uploadedVolume (N) is the number of bytes uploaded by the peer
* version (S) is the version of the software running on the peer
* platform (S) is a string representing the peer's platform
* blockchainState (S) is a string describing the state of the blockchain in the peer
* lastUpdated (N) is the timestamp (in seconds since the genesis block) of the last peer status update
* blacklisted (B) is true if the peer is blacklisted
* services (A) is an array of strings with the services the node provides
* apiPort (N) is the API access port of the peer
* apiSSLPort (N) is the SSL API access port of the peer
* blacklistingCause (S) is the cause of blacklisting (if blacklisted is true)
* announcedAddress (S) is the name that the peer announced to the network (could be a DNS name, IP address, or any other string)
* application (S) is the name of the software application, typically NRS
* state (N) defines the state of the peer: 0 for NON\_CONNECTED, 1 for CONNECTED, or 2 for DISCONNECTED
* shareAddress (B) is true if the address is allowed to be shared with other peers
* inbound (B) is true if the peer has made a request to this node
* inboundWebSocket (B) is true if an inbound websocket has been established from this node
* outboundWebSocket (B) is true if an outbound websocket has been established to this node
* lastConnectAttempt (B) is the timestamp (in seconds since the genesis block) of the last connection attempt to the peer
* requestProcessingTime (N) is the API request processing time (in millisec)

**Example:** Refer to [Set API Proxy Peer](/pzm/prizm-api/prizm-api-examples.md#set-api-proxy-peer) example.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://prizm.gitbook.io/pzm/prizm-api/networking-operations.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
