Struct ethsync::EthSync
[−]
[src]
pub struct EthSync { /* fields omitted */ }
Ethereum network protocol handler
Methods
impl EthSync
[src]
fn new(params: Params) -> Result<Arc<EthSync>, NetworkError>
Creates and register protocol with the network service
Trait Implementations
impl SyncProvider for EthSync
[src]
fn status(&self) -> SyncStatus
Get sync status
fn peers(&self) -> Vec<PeerInfo>
Get sync peers
fn enode(&self) -> Option<String>
Get the enode if available.
fn transactions_stats(&self) -> BTreeMap<H256, TransactionStats>
Returns propagation count for pending transactions.
impl ChainNotify for EthSync
[src]
fn new_blocks(&self,
imported: Vec<H256>,
invalid: Vec<H256>,
enacted: Vec<H256>,
retracted: Vec<H256>,
sealed: Vec<H256>,
proposed: Vec<Bytes>,
_duration: u64)
imported: Vec<H256>,
invalid: Vec<H256>,
enacted: Vec<H256>,
retracted: Vec<H256>,
sealed: Vec<H256>,
proposed: Vec<Bytes>,
_duration: u64)
fires when chain has new blocks.
fn start(&self)
fires when chain achieves active mode
fn stop(&self)
fires when chain achieves passive mode
fn broadcast(&self, message: Vec<u8>)
fires when chain broadcasts a message
fn transactions_received(&self, hashes: Vec<H256>, peer_id: PeerId)
fires when new transactions are received from a peer
impl ManageNetwork for EthSync
[src]
fn accept_unreserved_peers(&self)
Set to allow unreserved peers to connect
fn deny_unreserved_peers(&self)
Set to deny unreserved peers to connect
fn remove_reserved_peer(&self, peer: String) -> Result<(), String>
Remove reservation for the peer
fn add_reserved_peer(&self, peer: String) -> Result<(), String>
Add reserved peer
fn start_network(&self)
Start network
fn stop_network(&self)
Stop network
fn network_config(&self) -> NetworkConfiguration
Query the current configuration of the network