Events¶
ETH Protocol Events¶
Events used for the ETH peer protocols. These events derive from BaseEvent
and
can thus be consumed through the event bus.
-
class
trinity.protocol.eth.events.
GetBlockHeadersEvent
(session: p2p.abc.SessionAPI, command: p2p.abc.CommandAPI[typing.Any][Any])¶ Event to carry a
GetBlockHeaders
command from the peer pool to any process that subscribes the event through the event bus.
-
class
trinity.protocol.eth.events.
GetBlockBodiesEvent
(session: p2p.abc.SessionAPI, command: p2p.abc.CommandAPI[typing.Any][Any])¶ Event to carry a
GetBlockBodies
command from the peer pool to any process that subscribes the event through the event bus.
-
class
trinity.protocol.eth.events.
GetReceiptsEvent
(session: p2p.abc.SessionAPI, command: p2p.abc.CommandAPI[typing.Any][Any])¶ Event to carry a
GetReceipts
command from the peer pool to any process that subscribes the event through the event bus.
-
class
trinity.protocol.eth.events.
GetNodeDataEvent
(session: p2p.abc.SessionAPI, command: p2p.abc.CommandAPI[typing.Any][Any])¶ Event to carry a
GetNodeData
command from the peer pool to any process that subscribes the event through the event bus.
-
class
trinity.protocol.eth.events.
TransactionsEvent
(session: p2p.abc.SessionAPI, command: p2p.abc.CommandAPI[typing.Any][Any])¶ Event to carry a
Transactions
command from the peer pool to any process that subscribes the event through the event bus.
-
class
trinity.protocol.eth.events.
NewBlockHashesEvent
(session: p2p.abc.SessionAPI, command: p2p.abc.CommandAPI[typing.Any][Any])¶ Event to carry a
NewBlockHashes
command from the peer pool to any process that subscribes the event through the event bus.
-
class
trinity.protocol.eth.events.
SendBlockHeadersEvent
(session: p2p.abc.SessionAPI, command: trinity.protocol.eth.commands.BlockHeadersV65)¶ Event to proxy a
ETHPeer.sub_proto.send_block_headers
call from a proxy peer to the actual peer that sits in the peer pool.
-
class
trinity.protocol.eth.events.
SendBlockBodiesEvent
(session: p2p.abc.SessionAPI, command: trinity.protocol.eth.commands.BlockBodiesV65)¶ Event to proxy a
ETHPeer.sub_proto.send_block_bodies
call from a proxy peer to the actual peer that sits in the peer pool.
-
class
trinity.protocol.eth.events.
SendNodeDataEvent
(session: p2p.abc.SessionAPI, command: trinity.protocol.eth.commands.NodeDataV65)¶ Event to proxy a
ETHPeer.sub_proto.send_node_data
call from a proxy peer to the actual peer that sits in the peer pool.
-
class
trinity.protocol.eth.events.
SendReceiptsEvent
(session: p2p.abc.SessionAPI, command: trinity.protocol.eth.commands.ReceiptsV65)¶ Event to proxy a
ETHPeer.sub_proto.send_receipts
call from a proxy peer to the actual peer that sits in the peer pool.
-
class
trinity.protocol.eth.events.
SendTransactionsEvent
(session: p2p.abc.SessionAPI, command: trinity.protocol.eth.commands.Transactions)¶ Event to proxy a
ETHPeer.sub_proto.send_transactions
call from a proxy peer to the actual peer that sits in the peer pool.
-
class
trinity.protocol.eth.events.
GetBlockHeadersRequest
(session: p2p.abc.SessionAPI, block_number_or_hash: Union[NewType.<locals>.new_type, NewType.<locals>.new_type], max_headers: int, skip: int, reverse: bool, timeout: float)¶ A request class to delegate a
trinity.protocol.proxy.eth.events.GetBlockHeaders
command from any process to another process that can perform the actualtrinity.protocol.proxy.eth.events.GetBlockHeaders
command, wrap the result and send it back to the origin process via atrinity.protocol.proxy.eth.events.GetBlockHeadersResponse
.This is a low-level event class used by
trinity.protocol.proxy.ProxyETHAPI
to allow any Trinity process to interact with peers through the event bus.-
static
expected_response_type
() → Type[trinity.protocol.eth.events.GetBlockHeadersResponse]¶ Return the type that is expected to be send back for this request. This ensures that at runtime, only expected responses can be send back to callsites that issued a BaseRequestResponseEvent
-
static
-
class
trinity.protocol.eth.events.
GetBlockHeadersResponse
(headers: Sequence[eth.abc.BlockHeaderAPI], error: Exception = None)¶ The response class to answer a
GetBlockHeadersRequest
.
-
class
trinity.protocol.eth.events.
GetBlockBodiesRequest
(session: p2p.abc.SessionAPI, headers: Sequence[eth.abc.BlockHeaderAPI], timeout: float)¶ A request class to delegate a
trinity.protocol.proxy.eth.events.GetBlockBodies
command from any process to another process that can perform the actualtrinity.protocol.proxy.eth.events.GetBlockBodies
command, wrap the result and send it back to the origin process via atrinity.protocol.proxy.eth.events.GetBlockBodiesResponse
.This is a low-level event class used by
trinity.protocol.proxy.ProxyETHAPI
to allow any Trinity process to interact with peers through the event bus.-
static
expected_response_type
() → Type[trinity.protocol.eth.events.GetBlockBodiesResponse]¶ Return the type that is expected to be send back for this request. This ensures that at runtime, only expected responses can be send back to callsites that issued a BaseRequestResponseEvent
-
static
-
class
trinity.protocol.eth.events.
GetBlockBodiesResponse
(bundles: Tuple[Tuple[eth.abc.BlockAPI, Tuple[NewType.<locals>.new_type, Dict[NewType.<locals>.new_type, bytes]], NewType.<locals>.new_type], ...], error: Exception = None)¶ The response class to answer a
trinity.protocol.proxy.eth.events.GetBlockBodiesRequest
-
class
trinity.protocol.eth.events.
GetNodeDataRequest
(session: p2p.abc.SessionAPI, node_hashes: Sequence[NewType.<locals>.new_type], timeout: float)¶ A request class to delegate a
trinity.protocol.proxy.eth.events.GetNodeData
command from any process to another process that can perform the actualtrinity.protocol.proxy.eth.events.GetNodeData
command, wrap the result and send it back to the origin process via atrinity.protocol.proxy.eth.events.GetNodeDataResponse
.This is a low-level event class used by
trinity.protocol.proxy.ProxyETHAPI
to allow any Trinity process to interact with peers through the event bus.-
static
expected_response_type
() → Type[trinity.protocol.eth.events.GetNodeDataResponse]¶ Return the type that is expected to be send back for this request. This ensures that at runtime, only expected responses can be send back to callsites that issued a BaseRequestResponseEvent
-
static
-
class
trinity.protocol.eth.events.
GetNodeDataResponse
(bundles: Tuple[Tuple[NewType.<locals>.new_type, bytes], ...], error: Exception = None)¶ The response class to answer a
trinity.protocol.proxy.eth.events.GetNodeDataRequest
.
-
class
trinity.protocol.eth.events.
GetReceiptsRequest
(session: p2p.abc.SessionAPI, headers: Sequence[eth.abc.BlockHeaderAPI], timeout: float)¶ A request class to delegate a
trinity.protocol.proxy.eth.events.GetReceipts
command from any process to another process that can perform the actualtrinity.protocol.proxy.eth.events.GetReceipts
command, wrap the result and send it back to the origin process via atrinity.protocol.proxy.eth.events.GetNodeDataResponse
.This is a low-level event class used by
trinity.protocol.proxy.ProxyETHAPI
to allow any Trinity process to interact with peers through the event bus.-
static
expected_response_type
() → Type[trinity.protocol.eth.events.GetReceiptsResponse]¶ Return the type that is expected to be send back for this request. This ensures that at runtime, only expected responses can be send back to callsites that issued a BaseRequestResponseEvent
-
static
-
class
trinity.protocol.eth.events.
GetReceiptsResponse
(bundles: Tuple[Tuple[Tuple[Union[bytes, List[bytes]], ...], Tuple[NewType.<locals>.new_type, Dict[NewType.<locals>.new_type, bytes]]], ...], error: Exception = None)¶ The response class to answer a
trinity.protocol.proxy.eth.events.GetReceiptsRequest
.