20 #include <libethashseal/Ethash.h>
24 #include <aleth/buildinfo.h>
26 #include <boost/filesystem.hpp>
27 #include <boost/algorithm/string.hpp>
35 static_assert(BOOST_VERSION >= 106400,
"Wrong boost headers version");
37 WebThreeDirect::WebThreeDirect(std::string
const& _clientVersion,
38 boost::filesystem::path
const& _dbPath, boost::filesystem::path
const& _snapshotPath,
41 : m_clientVersion(_clientVersion), m_net(_clientVersion, _n, _network)
45 _params, (
int)_params.
networkID, m_net, shared_ptr<GasPricer>(), _dbPath, _we));
48 shared_ptr<GasPricer>(), _dbPath, _snapshotPath, _we));
50 m_ethereum->startWorking();
51 const auto* buildinfo = aleth_get_buildinfo();
52 m_ethereum->setExtraData(
rlpList(0,
string{buildinfo->project_version}.substr(0, 5) +
"++" +
53 string{buildinfo->git_commit_hash}.substr(0, 4) +
54 string{buildinfo->build_type}.substr(0, 1) +
55 string{buildinfo->system_name}.substr(0, 5) +
56 string{buildinfo->compiler_id}.substr(0, 3)));
76 const auto* buildinfo = aleth_get_buildinfo();
77 return _client +
"/" + buildinfo->project_version +
"/" + buildinfo->system_name +
"/" +
78 buildinfo->compiler_id + buildinfo->compiler_version +
"/" + buildinfo->build_type;
83 return m_net.peerSessionInfo();
88 return m_net.peerCount();
93 return m_net.setIdealPeerCount(_n);
98 return m_net.setPeerStretch(_n);
103 return m_net.saveNetwork();
108 m_net.addNode(_node, NodeIPEndpoint(_host.address(), _host.port(), _host.port()));
113 m_net.requirePeer(_node, NodeIPEndpoint(_host.address(), _host.port(), _host.port()));
118 m_net.addPeer(_s, _t);