Skip to content

Commit

Permalink
Add network api calls: get_advanced_node_parameters, set_advanced_nod…
Browse files Browse the repository at this point in the history
…e_parameters, get_potential_peers
  • Loading branch information
wackou committed Nov 21, 2015
1 parent de7b427 commit c3dd6c3
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 2 deletions.
17 changes: 16 additions & 1 deletion libraries/app/api.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,22 @@ namespace graphene { namespace app {

std::vector<net::peer_status> network_node_api::get_connected_peers() const
{
return _app.p2p_node()->get_connected_peers();
return _app.p2p_node()->get_connected_peers();
}

std::vector<net::potential_peer_record> network_node_api::get_potential_peers() const
{
return _app.p2p_node()->get_potential_peers();
}

fc::variant_object network_node_api::get_advanced_node_parameters() const
{
return _app.p2p_node()->get_advanced_node_parameters();
}

void network_node_api::set_advanced_node_parameters(const fc::variant_object& params)
{
return _app.p2p_node()->set_advanced_node_parameters(params);
}

fc::api<network_broadcast_api> login_api::network_broadcast()const
Expand Down
23 changes: 22 additions & 1 deletion libraries/app/include/graphene/app/api.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -149,9 +149,27 @@ namespace graphene { namespace app {

/**
* @brief Get status of all current connections to peers
*/
*/
std::vector<net::peer_status> get_connected_peers() const;

/**
* @brief Get advanced node parameters, such as desired and max
* number of connections
*/
fc::variant_object get_advanced_node_parameters() const;

/**
* @brief Set advanced node parameters, such as desired and max
* number of connections
* @param params a JSON object containing the name/value pairs for the parameters to set
*/
void set_advanced_node_parameters(const fc::variant_object& params);

/**
* @brief Return list of potential peers
*/
std::vector<net::potential_peer_record> get_potential_peers() const;

private:
application& _app;
};
Expand Down Expand Up @@ -217,6 +235,9 @@ FC_API(graphene::app::network_node_api,
(get_info)
(add_node)
(get_connected_peers)
(get_potential_peers)
(get_advanced_node_parameters)
(set_advanced_node_parameters)
)
FC_API(graphene::app::login_api,
(login)
Expand Down

0 comments on commit c3dd6c3

Please sign in to comment.