Go to the documentation of this file.
6 #include <boost/optional/optional.hpp>
7 #include <boost/thread/mutex.hpp>
8 #include <boost/utility/string_ref.hpp>
10 #include "net/http_client.h"
11 #include "storages/http_abstract_invoke.h"
22 std::function<std::map<std::string, bool>()> get_public_nodes,
23 bool rpc_payment_enabled);
26 boost::optional<epee::net_utils::http::login> credentials,
27 bool rpc_payment_enabled);
29 std::string
address()
const noexcept;
33 template <
class t_request,
class t_response>
34 bool invoke_http_json(
const boost::string_ref uri,
const t_request &out_struct, t_response &result_struct)
41 const bool result = epee::net_utils::invoke_http_json(uri, out_struct, result_struct,
m_http_client);
45 template <
class t_request,
class t_response>
46 bool invoke_http_bin(
const boost::string_ref uri,
const t_request &out_struct, t_response &result_struct)
53 const bool result = epee::net_utils::invoke_http_bin(uri, out_struct, result_struct,
m_http_client);
57 template <
class t_request,
class t_response>
58 bool invoke_http_json_rpc(
const boost::string_ref command_name,
const t_request &out_struct, t_response &result_struct)
65 const bool result = epee::net_utils::invoke_http_json_rpc(
67 std::string(command_name.begin(), command_name.end()),
75 bool set_server(
const std::string &
address,
const boost::optional<epee::net_utils::http::login> &credentials = boost::none);
81 const std::unique_ptr<bootstrap_node::selector>
m_selector;
bootstrap_daemon(std::function< std::map< std::string, bool >()> get_public_nodes, bool rpc_payment_enabled)
Definition: bootstrap_daemon.cpp:17
boost::mutex m_selector_mutex
Definition: bootstrap_daemon.h:82
bool invoke_http_bin(const boost::string_ref uri, const t_request &out_struct, t_response &result_struct)
Definition: bootstrap_daemon.h:46
const bool m_rpc_payment_enabled
Definition: bootstrap_daemon.h:80
boost::optional< uint64_t > get_height()
Definition: bootstrap_daemon.cpp:48
bool switch_server_if_needed()
Definition: bootstrap_daemon.cpp:94
Definition: bootstrap_daemon.h:19
bool invoke_http_json_rpc(const boost::string_ref command_name, const t_request &out_struct, t_response &result_struct)
Definition: bootstrap_daemon.h:58
expect< void > success() noexcept
Definition: expect.h:397
std::string address() const noexcept
Definition: bootstrap_daemon.cpp:38
Holds cryptonote related classes and helpers.
Definition: blockchain_db.cpp:45
bool invoke_http_json(const boost::string_ref uri, const t_request &out_struct, t_response &result_struct)
Definition: bootstrap_daemon.h:34
bool set_server(const std::string &address, const boost::optional< epee::net_utils::http::login > &credentials=boost::none)
Definition: bootstrap_daemon.cpp:81
bool handle_result(bool success, const std::string &status)
Definition: bootstrap_daemon.cpp:66
epee::net_utils::http::http_simple_client m_http_client
Definition: bootstrap_daemon.h:79
const std::unique_ptr< bootstrap_node::selector > m_selector
Definition: bootstrap_daemon.h:81