Struct ethcore_sync::EthSync
source · [−]pub struct EthSync { /* private fields */ }
Expand description
Ethereum network protocol handler
Implementations
sourceimpl EthSync
impl EthSync
sourcepub fn new(
params: Params,
connection_filter: Option<Arc<dyn ConnectionFilter>>
) -> Result<Arc<EthSync>, Error>
pub fn new(
params: Params,
connection_filter: Option<Arc<dyn ConnectionFilter>>
) -> Result<Arc<EthSync>, Error>
Creates and register protocol with the network service
sourcepub fn priority_tasks(&self) -> Sender<PriorityTask>
pub fn priority_tasks(&self) -> Sender<PriorityTask>
Priority tasks producer
sourcepub fn new_transaction_hashes(&self) -> Sender<H256>
pub fn new_transaction_hashes(&self) -> Sender<H256>
New transactions hashes producer
Trait Implementations
sourceimpl ChainNotify for EthSync
impl ChainNotify for EthSync
sourcefn block_pre_import(&self, bytes: &Bytes, hash: &H256, difficulty: &U256)
fn block_pre_import(&self, bytes: &Bytes, hash: &H256, difficulty: &U256)
fires when new block is about to be imported implementations should be light Read more
sourcefn new_blocks(&self, new_blocks: NewBlocks)
fn new_blocks(&self, new_blocks: NewBlocks)
fires when chain has new blocks.
sourcefn broadcast(&self, message_type: ChainMessageType)
fn broadcast(&self, message_type: ChainMessageType)
fires when chain broadcasts a message
sourcefn transactions_received(&self, txs: &[UnverifiedTransaction], peer_id: PeerId)
fn transactions_received(&self, txs: &[UnverifiedTransaction], peer_id: PeerId)
fires when new transactions are received from a peer
sourceimpl ManageNetwork for EthSync
impl ManageNetwork for EthSync
sourcefn accept_unreserved_peers(&self)
fn accept_unreserved_peers(&self)
Set to allow unreserved peers to connect
sourcefn deny_unreserved_peers(&self)
fn deny_unreserved_peers(&self)
Set to deny unreserved peers to connect
sourcefn remove_reserved_peer(&self, peer: String) -> Result<(), String>
fn remove_reserved_peer(&self, peer: String) -> Result<(), String>
Remove reservation for the peer
sourcefn start_network(&self)
fn start_network(&self)
Start network
sourcefn stop_network(&self)
fn stop_network(&self)
Stop network
sourcefn num_peers_range(&self) -> RangeInclusive<u32>
fn num_peers_range(&self) -> RangeInclusive<u32>
Returns the minimum and maximum peers.
sourcefn with_proto_context(
&self,
proto: ProtocolId,
f: &mut dyn FnMut(&dyn NetworkContext)
)
fn with_proto_context(
&self,
proto: ProtocolId,
f: &mut dyn FnMut(&dyn NetworkContext)
)
Get network context for protocol.
sourceimpl PrometheusMetrics for EthSync
impl PrometheusMetrics for EthSync
fn prometheus_metrics(&self, r: &mut PrometheusRegistry)
sourceimpl SyncProvider for EthSync
impl SyncProvider for EthSync
sourcefn status(&self) -> EthSyncStatus
fn status(&self) -> EthSyncStatus
Get sync status
sourcefn peers(&self) -> Vec<PeerInfo>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
fn peers(&self) -> Vec<PeerInfo>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
A: Allocator,
Get sync peers
sourcefn pending_transactions_stats(&self) -> BTreeMap<H256, TransactionStats>
fn pending_transactions_stats(&self) -> BTreeMap<H256, TransactionStats>
Returns propagation count for pending transactions.
sourcefn new_transactions_stats(&self) -> BTreeMap<H256, TransactionStats>
fn new_transactions_stats(&self) -> BTreeMap<H256, TransactionStats>
Returns propagation count for new transactions.
Auto Trait Implementations
impl !RefUnwindSafe for EthSync
impl Send for EthSync
impl Sync for EthSync
impl Unpin for EthSync
impl !UnwindSafe for EthSync
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more