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
GetBlockHeaderscommand 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
GetBlockBodiescommand 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
GetReceiptscommand 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
GetNodeDatacommand 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
Transactionscommand 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
NewBlockHashescommand 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_headerscall 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_bodiescall 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_datacall 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_receiptscall 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_transactionscall 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.GetBlockHeaderscommand from any process to another process that can perform the actualtrinity.protocol.proxy.eth.events.GetBlockHeaderscommand, 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.ProxyETHAPIto 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.GetBlockBodiescommand from any process to another process that can perform the actualtrinity.protocol.proxy.eth.events.GetBlockBodiescommand, 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.ProxyETHAPIto 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.GetNodeDatacommand from any process to another process that can perform the actualtrinity.protocol.proxy.eth.events.GetNodeDatacommand, 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.ProxyETHAPIto 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.GetReceiptscommand from any process to another process that can perform the actualtrinity.protocol.proxy.eth.events.GetReceiptscommand, 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.ProxyETHAPIto 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.