Trait holochain_p2p::event::HolochainP2pEventHandler
source · [−]pub trait HolochainP2pEventHandler: GhostHandler<HolochainP2pEvent> {
Show 17 methods
fn handle_put_agent_info_signed(
&mut self,
dna_hash: DnaHash,
peer_data: Vec<AgentInfoSigned>
) -> HolochainP2pEventHandlerResult<()>;
fn handle_query_agent_info_signed(
&mut self,
dna_hash: DnaHash,
agents: Option<HashSet<Arc<KitsuneAgent>>>,
kitsune_space: Arc<KitsuneSpace>
) -> HolochainP2pEventHandlerResult<Vec<AgentInfoSigned>>;
fn handle_query_gossip_agents(
&mut self,
dna_hash: DnaHash,
agents: Option<Vec<AgentPubKey>>,
kitsune_space: Arc<KitsuneSpace>,
since_ms: u64,
until_ms: u64,
arc_set: Arc<DhtArcSet>
) -> HolochainP2pEventHandlerResult<Vec<AgentInfoSigned>>;
fn handle_query_agent_info_signed_near_basis(
&mut self,
dna_hash: DnaHash,
kitsune_space: Arc<KitsuneSpace>,
basis_loc: u32,
limit: u32
) -> HolochainP2pEventHandlerResult<Vec<AgentInfoSigned>>;
fn handle_query_peer_density(
&mut self,
dna_hash: DnaHash,
kitsune_space: Arc<KitsuneSpace>,
dht_arc: DhtArc
) -> HolochainP2pEventHandlerResult<PeerView>;
fn handle_call_remote(
&mut self,
dna_hash: DnaHash,
to_agent: AgentPubKey,
from_agent: AgentPubKey,
zome_name: ZomeName,
fn_name: FunctionName,
cap_secret: Option<CapSecret>,
payload: ExternIO
) -> HolochainP2pEventHandlerResult<SerializedBytes>;
fn handle_publish(
&mut self,
dna_hash: DnaHash,
request_validation_receipt: bool,
countersigning_session: bool,
ops: Vec<DhtOp>
) -> HolochainP2pEventHandlerResult<()>;
fn handle_get(
&mut self,
dna_hash: DnaHash,
to_agent: AgentPubKey,
dht_hash: AnyDhtHash,
options: GetOptions
) -> HolochainP2pEventHandlerResult<WireOps>;
fn handle_get_meta(
&mut self,
dna_hash: DnaHash,
to_agent: AgentPubKey,
dht_hash: AnyDhtHash,
options: GetMetaOptions
) -> HolochainP2pEventHandlerResult<MetadataSet>;
fn handle_get_links(
&mut self,
dna_hash: DnaHash,
to_agent: AgentPubKey,
link_key: WireLinkKey,
options: GetLinksOptions
) -> HolochainP2pEventHandlerResult<WireLinkOps>;
fn handle_get_agent_activity(
&mut self,
dna_hash: DnaHash,
to_agent: AgentPubKey,
agent: AgentPubKey,
query: ChainQueryFilter,
options: GetActivityOptions
) -> HolochainP2pEventHandlerResult<AgentActivityResponse<ActionHash>>;
fn handle_must_get_agent_activity(
&mut self,
dna_hash: DnaHash,
to_agent: AgentPubKey,
author: AgentPubKey,
filter: ChainFilter
) -> HolochainP2pEventHandlerResult<MustGetAgentActivityResponse>;
fn handle_validation_receipt_received(
&mut self,
dna_hash: DnaHash,
to_agent: AgentPubKey,
receipt: SerializedBytes
) -> HolochainP2pEventHandlerResult<()>;
fn handle_query_op_hashes(
&mut self,
dna_hash: DnaHash,
arc_set: DhtArcSet,
window: TimeWindow,
max_ops: usize,
include_limbo: bool
) -> HolochainP2pEventHandlerResult<Option<(Vec<DhtOpHash>, TimeWindowInclusive)>>;
fn handle_fetch_op_data(
&mut self,
dna_hash: DnaHash,
query: FetchOpDataQuery
) -> HolochainP2pEventHandlerResult<Vec<(DhtOpHash, DhtOp)>>;
fn handle_sign_network_data(
&mut self,
dna_hash: DnaHash,
to_agent: AgentPubKey,
data: Vec<u8>
) -> HolochainP2pEventHandlerResult<Signature>;
fn handle_countersigning_session_negotiation(
&mut self,
dna_hash: DnaHash,
to_agent: AgentPubKey,
message: CountersigningSessionNegotiationMessage
) -> HolochainP2pEventHandlerResult<()>;
}
Expand description
The HolochainP2pEvent stream allows handling events generated from the HolochainP2p actor.
Required Methods
sourcefn handle_put_agent_info_signed(
&mut self,
dna_hash: DnaHash,
peer_data: Vec<AgentInfoSigned>
) -> HolochainP2pEventHandlerResult<()>
fn handle_put_agent_info_signed(
&mut self,
dna_hash: DnaHash,
peer_data: Vec<AgentInfoSigned>
) -> HolochainP2pEventHandlerResult<()>
We need to store signed agent info.
sourcefn handle_query_agent_info_signed(
&mut self,
dna_hash: DnaHash,
agents: Option<HashSet<Arc<KitsuneAgent>>>,
kitsune_space: Arc<KitsuneSpace>
) -> HolochainP2pEventHandlerResult<Vec<AgentInfoSigned>>
fn handle_query_agent_info_signed(
&mut self,
dna_hash: DnaHash,
agents: Option<HashSet<Arc<KitsuneAgent>>>,
kitsune_space: Arc<KitsuneSpace>
) -> HolochainP2pEventHandlerResult<Vec<AgentInfoSigned>>
We need to get previously stored agent info.
sourcefn handle_query_gossip_agents(
&mut self,
dna_hash: DnaHash,
agents: Option<Vec<AgentPubKey>>,
kitsune_space: Arc<KitsuneSpace>,
since_ms: u64,
until_ms: u64,
arc_set: Arc<DhtArcSet>
) -> HolochainP2pEventHandlerResult<Vec<AgentInfoSigned>>
fn handle_query_gossip_agents(
&mut self,
dna_hash: DnaHash,
agents: Option<Vec<AgentPubKey>>,
kitsune_space: Arc<KitsuneSpace>,
since_ms: u64,
until_ms: u64,
arc_set: Arc<DhtArcSet>
) -> HolochainP2pEventHandlerResult<Vec<AgentInfoSigned>>
We need to get agents that fit into an arc set for gossip.
sourcefn handle_query_agent_info_signed_near_basis(
&mut self,
dna_hash: DnaHash,
kitsune_space: Arc<KitsuneSpace>,
basis_loc: u32,
limit: u32
) -> HolochainP2pEventHandlerResult<Vec<AgentInfoSigned>>
fn handle_query_agent_info_signed_near_basis(
&mut self,
dna_hash: DnaHash,
kitsune_space: Arc<KitsuneSpace>,
basis_loc: u32,
limit: u32
) -> HolochainP2pEventHandlerResult<Vec<AgentInfoSigned>>
query agent info in order of closeness to a basis location.
sourcefn handle_query_peer_density(
&mut self,
dna_hash: DnaHash,
kitsune_space: Arc<KitsuneSpace>,
dht_arc: DhtArc
) -> HolochainP2pEventHandlerResult<PeerView>
fn handle_query_peer_density(
&mut self,
dna_hash: DnaHash,
kitsune_space: Arc<KitsuneSpace>,
dht_arc: DhtArc
) -> HolochainP2pEventHandlerResult<PeerView>
Query the peer density of a space for a given [DhtArc
].
sourcefn handle_call_remote(
&mut self,
dna_hash: DnaHash,
to_agent: AgentPubKey,
from_agent: AgentPubKey,
zome_name: ZomeName,
fn_name: FunctionName,
cap_secret: Option<CapSecret>,
payload: ExternIO
) -> HolochainP2pEventHandlerResult<SerializedBytes>
fn handle_call_remote(
&mut self,
dna_hash: DnaHash,
to_agent: AgentPubKey,
from_agent: AgentPubKey,
zome_name: ZomeName,
fn_name: FunctionName,
cap_secret: Option<CapSecret>,
payload: ExternIO
) -> HolochainP2pEventHandlerResult<SerializedBytes>
A remote node is attempting to make a remote call on us.
sourcefn handle_publish(
&mut self,
dna_hash: DnaHash,
request_validation_receipt: bool,
countersigning_session: bool,
ops: Vec<DhtOp>
) -> HolochainP2pEventHandlerResult<()>
fn handle_publish(
&mut self,
dna_hash: DnaHash,
request_validation_receipt: bool,
countersigning_session: bool,
ops: Vec<DhtOp>
) -> HolochainP2pEventHandlerResult<()>
A remote node is publishing data in a range we claim to be holding.
sourcefn handle_get(
&mut self,
dna_hash: DnaHash,
to_agent: AgentPubKey,
dht_hash: AnyDhtHash,
options: GetOptions
) -> HolochainP2pEventHandlerResult<WireOps>
fn handle_get(
&mut self,
dna_hash: DnaHash,
to_agent: AgentPubKey,
dht_hash: AnyDhtHash,
options: GetOptions
) -> HolochainP2pEventHandlerResult<WireOps>
A remote node is requesting entry data from us.
sourcefn handle_get_meta(
&mut self,
dna_hash: DnaHash,
to_agent: AgentPubKey,
dht_hash: AnyDhtHash,
options: GetMetaOptions
) -> HolochainP2pEventHandlerResult<MetadataSet>
fn handle_get_meta(
&mut self,
dna_hash: DnaHash,
to_agent: AgentPubKey,
dht_hash: AnyDhtHash,
options: GetMetaOptions
) -> HolochainP2pEventHandlerResult<MetadataSet>
A remote node is requesting metadata from us.
sourcefn handle_get_links(
&mut self,
dna_hash: DnaHash,
to_agent: AgentPubKey,
link_key: WireLinkKey,
options: GetLinksOptions
) -> HolochainP2pEventHandlerResult<WireLinkOps>
fn handle_get_links(
&mut self,
dna_hash: DnaHash,
to_agent: AgentPubKey,
link_key: WireLinkKey,
options: GetLinksOptions
) -> HolochainP2pEventHandlerResult<WireLinkOps>
A remote node is requesting link data from us.
sourcefn handle_get_agent_activity(
&mut self,
dna_hash: DnaHash,
to_agent: AgentPubKey,
agent: AgentPubKey,
query: ChainQueryFilter,
options: GetActivityOptions
) -> HolochainP2pEventHandlerResult<AgentActivityResponse<ActionHash>>
fn handle_get_agent_activity(
&mut self,
dna_hash: DnaHash,
to_agent: AgentPubKey,
agent: AgentPubKey,
query: ChainQueryFilter,
options: GetActivityOptions
) -> HolochainP2pEventHandlerResult<AgentActivityResponse<ActionHash>>
A remote node is requesting agent activity from us.
sourcefn handle_must_get_agent_activity(
&mut self,
dna_hash: DnaHash,
to_agent: AgentPubKey,
author: AgentPubKey,
filter: ChainFilter
) -> HolochainP2pEventHandlerResult<MustGetAgentActivityResponse>
fn handle_must_get_agent_activity(
&mut self,
dna_hash: DnaHash,
to_agent: AgentPubKey,
author: AgentPubKey,
filter: ChainFilter
) -> HolochainP2pEventHandlerResult<MustGetAgentActivityResponse>
A remote node is requesting agent activity from us.
sourcefn handle_validation_receipt_received(
&mut self,
dna_hash: DnaHash,
to_agent: AgentPubKey,
receipt: SerializedBytes
) -> HolochainP2pEventHandlerResult<()>
fn handle_validation_receipt_received(
&mut self,
dna_hash: DnaHash,
to_agent: AgentPubKey,
receipt: SerializedBytes
) -> HolochainP2pEventHandlerResult<()>
A remote node has sent us a validation receipt.
sourcefn handle_query_op_hashes(
&mut self,
dna_hash: DnaHash,
arc_set: DhtArcSet,
window: TimeWindow,
max_ops: usize,
include_limbo: bool
) -> HolochainP2pEventHandlerResult<Option<(Vec<DhtOpHash>, TimeWindowInclusive)>>
fn handle_query_op_hashes(
&mut self,
dna_hash: DnaHash,
arc_set: DhtArcSet,
window: TimeWindow,
max_ops: usize,
include_limbo: bool
) -> HolochainP2pEventHandlerResult<Option<(Vec<DhtOpHash>, TimeWindowInclusive)>>
The p2p module wishes to query our DhtOpHash store. Gets all ops from a set of agents within a time window and max number of ops. Returns the actual time window of returned ops as well.
sourcefn handle_fetch_op_data(
&mut self,
dna_hash: DnaHash,
query: FetchOpDataQuery
) -> HolochainP2pEventHandlerResult<Vec<(DhtOpHash, DhtOp)>>
fn handle_fetch_op_data(
&mut self,
dna_hash: DnaHash,
query: FetchOpDataQuery
) -> HolochainP2pEventHandlerResult<Vec<(DhtOpHash, DhtOp)>>
The p2p module needs access to the content for a given set of DhtOpHashes.
sourcefn handle_sign_network_data(
&mut self,
dna_hash: DnaHash,
to_agent: AgentPubKey,
data: Vec<u8>
) -> HolochainP2pEventHandlerResult<Signature>
fn handle_sign_network_data(
&mut self,
dna_hash: DnaHash,
to_agent: AgentPubKey,
data: Vec<u8>
) -> HolochainP2pEventHandlerResult<Signature>
P2p operations require cryptographic signatures and validation.
sourcefn handle_countersigning_session_negotiation(
&mut self,
dna_hash: DnaHash,
to_agent: AgentPubKey,
message: CountersigningSessionNegotiationMessage
) -> HolochainP2pEventHandlerResult<()>
fn handle_countersigning_session_negotiation(
&mut self,
dna_hash: DnaHash,
to_agent: AgentPubKey,
message: CountersigningSessionNegotiationMessage
) -> HolochainP2pEventHandlerResult<()>
Messages between agents that drive a countersigning session.