# Network Nodes API

The network node API is available from the full node via web-sockets.

## Obtain Network Information

### get\_info

Return general network information, such as p2p port.

```cpp
fc::variant_object graphene::app::network_node_api:get_info()const
```

### get\_connected\_peers

Get status of all current connections to peers.

```cpp
std::vector<net::peer_status> graphene::app::network_node_api::get_connected_peers()const
```

### get\_potential\_peers

Return list of potential peers.

```cpp
std::vector<net::potential_peer_record> graphene::app::network_node_api::get_potential_peers()const
```

### get\_advanced\_node\_parameters

Get advanced node parameters, such as desired and max number of connections.

```cpp
fc::variant_object graphene::app::network_node_api::get_advanced_node_parameters()const
```

## Change Network Settings

### add\_node

Connect to a new peer

```cpp
void graphene::app::network_node_api::add_node(
    const fc::ip::endpoint &ep)
```

{% tabs %}
{% tab title="Parameters" %}

* **`ep`**: The IP/Port of the peer to connect to
  {% endtab %}
  {% endtabs %}

### **set\_advanced\_node\_parameters**

Set advanced node parameters, such as desired and max number of connections.

```cpp
void graphene::app::network_node_api::set_advanced_node_parameters(
    const fc::variant_object &params)
```

{% tabs %}
{% tab title="Parameters" %}

* **`params`**: a JSON object containing the name/value pairs for the parameters to set
  {% endtab %}
  {% endtabs %}


---

# 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://community.peerplays.com/api/peerplays-core-api/network-nodes-api.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.
