![]() |
Ethereum
PoC-8
The C++ Implementation of Ethereum
|
Main API hub for interfacing with Web 3 components. This doesn't do any local multiplexing, so you can only have one running on any given machine for the provided DB path. More...
#include <WebThree.h>
Public Member Functions | |
| WebThreeDirect (std::string const &_clientVersion, boost::filesystem::path const &_dbPath, boost::filesystem::path const &_snapshotPath, eth::ChainParams const &_params, WithExisting _we=WithExisting::Trust, p2p::NetworkConfig const &_n=p2p::NetworkConfig{}, bytesConstRef _network=bytesConstRef(), bool _testing=false) | |
| ~WebThreeDirect () override | |
| Destructor. More... | |
| eth::Client * | ethereum () const |
| std::string const & | clientVersion () const |
| std::vector< p2p::PeerSessionInfo > | peers () override |
| Get information on the current peer set. More... | |
| size_t | peerCount () const override |
| Same as peers().size(), but more efficient. More... | |
| virtual void | addPeer (p2p::NodeSpec const &_node, p2p::PeerType _t) override |
| Generalised peer addition. More... | |
| virtual void | addNode (p2p::NodeID const &_node, bi::tcp::endpoint const &_hostEndpoint) override |
| Add node to connect to. More... | |
| void | addNode (p2p::NodeID const &_node, std::string const &_hostString) |
| Add node to connect to. More... | |
| void | addNode (bi::tcp::endpoint const &_endpoint) |
| Add node to connect to. More... | |
| void | addNode (std::string const &_hostString) |
| Add node to connect to. More... | |
| void | requirePeer (p2p::NodeID const &_node, bi::tcp::endpoint const &_endpoint) override |
| Require connection to peer. More... | |
| void | requirePeer (p2p::NodeID const &_node, std::string const &_hostString) |
| Require connection to peer. More... | |
| dev::bytes | saveNetwork () override |
| Save peers. More... | |
| void | setIdealPeerCount (size_t _n) override |
| Sets the ideal number of peers. More... | |
| void | setPeerStretch (size_t _n) |
| Experimental. Sets ceiling for incoming connections to multiple of ideal peer count. More... | |
| p2p::NodeInfo | nodeInfo () const override |
| Get information concerning this node. More... | |
| u256 | networkId () const override |
| Get network id. More... | |
| std::string | enode () const override |
| Get enode string. More... | |
| void | startNetwork () override |
| Start the network subsystem. More... | |
| void | stopNetwork () override |
| Stop the network subsystem. More... | |
| bool | isNetworkStarted () const override |
| Is network working? there may not be any peers yet. More... | |
Public Member Functions inherited from dev::NetworkFace | |
| virtual | ~NetworkFace ()=default |
Static Public Member Functions | |
| static std::string | composeClientVersion (std::string const &_client) |
Main API hub for interfacing with Web 3 components. This doesn't do any local multiplexing, so you can only have one running on any given machine for the provided DB path.
Keeps a libp2p Host going (administering the work thread with m_workNet).
Encapsulates a bunch of P2P protocols (interfaces), each using the same underlying libp2p Host.
Provides a baseline for the multiplexed multi-protocol session class, WebThree.
Definition at line 108 of file WebThree.h.
| WebThreeDirect::WebThreeDirect | ( | std::string const & | _clientVersion, |
| boost::filesystem::path const & | _dbPath, | ||
| boost::filesystem::path const & | _snapshotPath, | ||
| eth::ChainParams const & | _params, | ||
| WithExisting | _we = WithExisting::Trust, |
||
| p2p::NetworkConfig const & | _n = p2p::NetworkConfig{}, |
||
| bytesConstRef | _network = bytesConstRef(), |
||
| bool | _testing = false |
||
| ) |
Constructor for private instance. If there is already another process on the machine using _dbPath, then this will throw an exception. ethereum() may be safely static_cast()ed to a eth::Client*.
Definition at line 37 of file WebThree.cpp.
|
override |
Destructor.
Definition at line 59 of file WebThree.cpp.
|
inline |
Add node to connect to.
Definition at line 153 of file WebThree.h.
|
overridevirtual |
|
inline |
Add node to connect to.
Definition at line 150 of file WebThree.h.
|
inline |
Add node to connect to.
Definition at line 156 of file WebThree.h.
|
overridevirtual |
Generalised peer addition.
Implements dev::NetworkFace.
Definition at line 116 of file WebThree.cpp.
|
inline |
Definition at line 133 of file WebThree.h.
|
static |
Definition at line 74 of file WebThree.cpp.
|
inlineoverridevirtual |
|
inline |
Definition at line 123 of file WebThree.h.
|
inlineoverridevirtual |
Is network working? there may not be any peers yet.
Implements dev::NetworkFace.
Definition at line 186 of file WebThree.h.
|
inlineoverridevirtual |
|
inlineoverridevirtual |
Get information concerning this node.
Implements dev::NetworkFace.
Definition at line 173 of file WebThree.h.
|
overridevirtual |
Same as peers().size(), but more efficient.
Implements dev::NetworkFace.
Definition at line 86 of file WebThree.cpp.
|
overridevirtual |
Get information on the current peer set.
Implements dev::NetworkFace.
Definition at line 81 of file WebThree.cpp.
|
overridevirtual |
Require connection to peer.
Implements dev::NetworkFace.
Definition at line 111 of file WebThree.cpp.
|
inline |
Require connection to peer.
Definition at line 162 of file WebThree.h.
|
overridevirtual |
|
overridevirtual |
Sets the ideal number of peers.
Implements dev::NetworkFace.
Definition at line 91 of file WebThree.cpp.
| void WebThreeDirect::setPeerStretch | ( | size_t | _n | ) |
Experimental. Sets ceiling for incoming connections to multiple of ideal peer count.
Definition at line 96 of file WebThree.cpp.
|
inlineoverridevirtual |
Start the network subsystem.
Implements dev::NetworkFace.
Definition at line 180 of file WebThree.h.
|
inlineoverridevirtual |