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.


Obtain Network Information

get_info

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

Return general network information, such as p2p port.

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.

get_potential_peers

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

Return list of potential peers.

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.



Change Network Settings

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

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