4.8. Network Nodes API

The network node API is available from the full node via websockets.

If you have not set up your websockets connection, please read this article.


4.8.1. Obtain Network Information

4.8.1.1. get_info

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

Return general network information, such as p2p port.

4.8.1.2. get_connected_peers

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

Get status of all current connections to peers.

4.8.1.3. get_potential_peers

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

Return list of potential peers.

4.8.1.4. get_advanced_node_parameters

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

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



4.8.2. Change Network Settings

4.8.2.1. add_node

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

add_node Connect to a new peer

Parameters
  • ep: The IP/Port of the peer to connect to

4.8.2.2. set_advanced_node_parameters

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

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

Parameters
  • params: a JSON object containing the name/value pairs for the parameters to set