Trait holochain::prelude::event::HolochainP2pEventHandler
source · pub trait HolochainP2pEventHandler: GhostHandler<HolochainP2pEvent> {
Show 17 methods
fn handle_put_agent_info_signed(
&mut self,
dna_hash: HoloHash<Dna>,
peer_data: Vec<AgentInfoSigned, Global>
) -> Result<MustBoxFuture<'static, Result<(), HolochainP2pError>>, HolochainP2pError>;
fn handle_query_agent_info_signed(
&mut self,
dna_hash: HoloHash<Dna>,
agents: Option<HashSet<Arc<KitsuneAgent>, RandomState>>,
kitsune_space: Arc<KitsuneSpace>
) -> Result<MustBoxFuture<'static, Result<Vec<AgentInfoSigned, Global>, HolochainP2pError>>, HolochainP2pError>;
fn handle_query_gossip_agents(
&mut self,
dna_hash: HoloHash<Dna>,
agents: Option<Vec<HoloHash<Agent>, Global>>,
kitsune_space: Arc<KitsuneSpace>,
since_ms: u64,
until_ms: u64,
arc_set: Arc<DhtArcSet>
) -> Result<MustBoxFuture<'static, Result<Vec<AgentInfoSigned, Global>, HolochainP2pError>>, HolochainP2pError>;
fn handle_query_agent_info_signed_near_basis(
&mut self,
dna_hash: HoloHash<Dna>,
kitsune_space: Arc<KitsuneSpace>,
basis_loc: u32,
limit: u32
) -> Result<MustBoxFuture<'static, Result<Vec<AgentInfoSigned, Global>, HolochainP2pError>>, HolochainP2pError>;
fn handle_query_peer_density(
&mut self,
dna_hash: HoloHash<Dna>,
kitsune_space: Arc<KitsuneSpace>,
dht_arc: DhtArc
) -> Result<MustBoxFuture<'static, Result<PeerView, HolochainP2pError>>, HolochainP2pError>;
fn handle_call_remote(
&mut self,
dna_hash: HoloHash<Dna>,
to_agent: HoloHash<Agent>,
from_agent: HoloHash<Agent>,
zome_name: ZomeName,
fn_name: FunctionName,
cap_secret: Option<CapSecret>,
payload: ExternIO
) -> Result<MustBoxFuture<'static, Result<SerializedBytes, HolochainP2pError>>, HolochainP2pError>;
fn handle_publish(
&mut self,
dna_hash: HoloHash<Dna>,
request_validation_receipt: bool,
countersigning_session: bool,
ops: Vec<DhtOp, Global>
) -> Result<MustBoxFuture<'static, Result<(), HolochainP2pError>>, HolochainP2pError>;
fn handle_get(
&mut self,
dna_hash: HoloHash<Dna>,
to_agent: HoloHash<Agent>,
dht_hash: HoloHash<AnyDht>,
options: GetOptions
) -> Result<MustBoxFuture<'static, Result<WireOps, HolochainP2pError>>, HolochainP2pError>;
fn handle_get_meta(
&mut self,
dna_hash: HoloHash<Dna>,
to_agent: HoloHash<Agent>,
dht_hash: HoloHash<AnyDht>,
options: GetMetaOptions
) -> Result<MustBoxFuture<'static, Result<MetadataSet, HolochainP2pError>>, HolochainP2pError>;
fn handle_get_links(
&mut self,
dna_hash: HoloHash<Dna>,
to_agent: HoloHash<Agent>,
link_key: WireLinkKey,
options: GetLinksOptions
) -> Result<MustBoxFuture<'static, Result<WireLinkOps, HolochainP2pError>>, HolochainP2pError>;
fn handle_get_agent_activity(
&mut self,
dna_hash: HoloHash<Dna>,
to_agent: HoloHash<Agent>,
agent: HoloHash<Agent>,
query: ChainQueryFilter,
options: GetActivityOptions
) -> Result<MustBoxFuture<'static, Result<AgentActivityResponse<HoloHash<Action>>, HolochainP2pError>>, HolochainP2pError>;
fn handle_must_get_agent_activity(
&mut self,
dna_hash: HoloHash<Dna>,
to_agent: HoloHash<Agent>,
author: HoloHash<Agent>,
filter: ChainFilter<HoloHash<Action>>
) -> Result<MustBoxFuture<'static, Result<MustGetAgentActivityResponse, HolochainP2pError>>, HolochainP2pError>;
fn handle_validation_receipt_received(
&mut self,
dna_hash: HoloHash<Dna>,
to_agent: HoloHash<Agent>,
receipt: SerializedBytes
) -> Result<MustBoxFuture<'static, Result<(), HolochainP2pError>>, HolochainP2pError>;
fn handle_query_op_hashes(
&mut self,
dna_hash: HoloHash<Dna>,
arc_set: DhtArcSet,
window: Range<Timestamp>,
max_ops: usize,
include_limbo: bool
) -> Result<MustBoxFuture<'static, Result<Option<(Vec<HoloHash<DhtOp>, Global>, RangeInclusive<Timestamp>)>, HolochainP2pError>>, HolochainP2pError>;
fn handle_fetch_op_data(
&mut self,
dna_hash: HoloHash<Dna>,
query: FetchOpDataQuery
) -> Result<MustBoxFuture<'static, Result<Vec<(HoloHash<DhtOp>, DhtOp), Global>, HolochainP2pError>>, HolochainP2pError>;
fn handle_sign_network_data(
&mut self,
dna_hash: HoloHash<Dna>,
to_agent: HoloHash<Agent>,
data: Vec<u8, Global>
) -> Result<MustBoxFuture<'static, Result<Signature, HolochainP2pError>>, HolochainP2pError>;
fn handle_countersigning_session_negotiation(
&mut self,
dna_hash: HoloHash<Dna>,
to_agent: HoloHash<Agent>,
message: CountersigningSessionNegotiationMessage
) -> Result<MustBoxFuture<'static, Result<(), HolochainP2pError>>, HolochainP2pError>;
}
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: HoloHash<Dna>,
peer_data: Vec<AgentInfoSigned, Global>
) -> Result<MustBoxFuture<'static, Result<(), HolochainP2pError>>, HolochainP2pError>
fn handle_put_agent_info_signed(
&mut self,
dna_hash: HoloHash<Dna>,
peer_data: Vec<AgentInfoSigned, Global>
) -> Result<MustBoxFuture<'static, Result<(), HolochainP2pError>>, HolochainP2pError>
We need to store signed agent info.
sourcefn handle_query_agent_info_signed(
&mut self,
dna_hash: HoloHash<Dna>,
agents: Option<HashSet<Arc<KitsuneAgent>, RandomState>>,
kitsune_space: Arc<KitsuneSpace>
) -> Result<MustBoxFuture<'static, Result<Vec<AgentInfoSigned, Global>, HolochainP2pError>>, HolochainP2pError>
fn handle_query_agent_info_signed(
&mut self,
dna_hash: HoloHash<Dna>,
agents: Option<HashSet<Arc<KitsuneAgent>, RandomState>>,
kitsune_space: Arc<KitsuneSpace>
) -> Result<MustBoxFuture<'static, Result<Vec<AgentInfoSigned, Global>, HolochainP2pError>>, HolochainP2pError>
We need to get previously stored agent info.
sourcefn handle_query_gossip_agents(
&mut self,
dna_hash: HoloHash<Dna>,
agents: Option<Vec<HoloHash<Agent>, Global>>,
kitsune_space: Arc<KitsuneSpace>,
since_ms: u64,
until_ms: u64,
arc_set: Arc<DhtArcSet>
) -> Result<MustBoxFuture<'static, Result<Vec<AgentInfoSigned, Global>, HolochainP2pError>>, HolochainP2pError>
fn handle_query_gossip_agents(
&mut self,
dna_hash: HoloHash<Dna>,
agents: Option<Vec<HoloHash<Agent>, Global>>,
kitsune_space: Arc<KitsuneSpace>,
since_ms: u64,
until_ms: u64,
arc_set: Arc<DhtArcSet>
) -> Result<MustBoxFuture<'static, Result<Vec<AgentInfoSigned, Global>, HolochainP2pError>>, HolochainP2pError>
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: HoloHash<Dna>,
kitsune_space: Arc<KitsuneSpace>,
basis_loc: u32,
limit: u32
) -> Result<MustBoxFuture<'static, Result<Vec<AgentInfoSigned, Global>, HolochainP2pError>>, HolochainP2pError>
fn handle_query_agent_info_signed_near_basis(
&mut self,
dna_hash: HoloHash<Dna>,
kitsune_space: Arc<KitsuneSpace>,
basis_loc: u32,
limit: u32
) -> Result<MustBoxFuture<'static, Result<Vec<AgentInfoSigned, Global>, HolochainP2pError>>, HolochainP2pError>
query agent info in order of closeness to a basis location.
sourcefn handle_query_peer_density(
&mut self,
dna_hash: HoloHash<Dna>,
kitsune_space: Arc<KitsuneSpace>,
dht_arc: DhtArc
) -> Result<MustBoxFuture<'static, Result<PeerView, HolochainP2pError>>, HolochainP2pError>
fn handle_query_peer_density(
&mut self,
dna_hash: HoloHash<Dna>,
kitsune_space: Arc<KitsuneSpace>,
dht_arc: DhtArc
) -> Result<MustBoxFuture<'static, Result<PeerView, HolochainP2pError>>, HolochainP2pError>
Query the peer density of a space for a given [DhtArc
].
sourcefn handle_call_remote(
&mut self,
dna_hash: HoloHash<Dna>,
to_agent: HoloHash<Agent>,
from_agent: HoloHash<Agent>,
zome_name: ZomeName,
fn_name: FunctionName,
cap_secret: Option<CapSecret>,
payload: ExternIO
) -> Result<MustBoxFuture<'static, Result<SerializedBytes, HolochainP2pError>>, HolochainP2pError>
fn handle_call_remote(
&mut self,
dna_hash: HoloHash<Dna>,
to_agent: HoloHash<Agent>,
from_agent: HoloHash<Agent>,
zome_name: ZomeName,
fn_name: FunctionName,
cap_secret: Option<CapSecret>,
payload: ExternIO
) -> Result<MustBoxFuture<'static, Result<SerializedBytes, HolochainP2pError>>, HolochainP2pError>
A remote node is attempting to make a remote call on us.
sourcefn handle_publish(
&mut self,
dna_hash: HoloHash<Dna>,
request_validation_receipt: bool,
countersigning_session: bool,
ops: Vec<DhtOp, Global>
) -> Result<MustBoxFuture<'static, Result<(), HolochainP2pError>>, HolochainP2pError>
fn handle_publish(
&mut self,
dna_hash: HoloHash<Dna>,
request_validation_receipt: bool,
countersigning_session: bool,
ops: Vec<DhtOp, Global>
) -> Result<MustBoxFuture<'static, Result<(), HolochainP2pError>>, HolochainP2pError>
A remote node is publishing data in a range we claim to be holding.
sourcefn handle_get(
&mut self,
dna_hash: HoloHash<Dna>,
to_agent: HoloHash<Agent>,
dht_hash: HoloHash<AnyDht>,
options: GetOptions
) -> Result<MustBoxFuture<'static, Result<WireOps, HolochainP2pError>>, HolochainP2pError>
fn handle_get(
&mut self,
dna_hash: HoloHash<Dna>,
to_agent: HoloHash<Agent>,
dht_hash: HoloHash<AnyDht>,
options: GetOptions
) -> Result<MustBoxFuture<'static, Result<WireOps, HolochainP2pError>>, HolochainP2pError>
A remote node is requesting entry data from us.
sourcefn handle_get_meta(
&mut self,
dna_hash: HoloHash<Dna>,
to_agent: HoloHash<Agent>,
dht_hash: HoloHash<AnyDht>,
options: GetMetaOptions
) -> Result<MustBoxFuture<'static, Result<MetadataSet, HolochainP2pError>>, HolochainP2pError>
fn handle_get_meta(
&mut self,
dna_hash: HoloHash<Dna>,
to_agent: HoloHash<Agent>,
dht_hash: HoloHash<AnyDht>,
options: GetMetaOptions
) -> Result<MustBoxFuture<'static, Result<MetadataSet, HolochainP2pError>>, HolochainP2pError>
A remote node is requesting metadata from us.
sourcefn handle_get_links(
&mut self,
dna_hash: HoloHash<Dna>,
to_agent: HoloHash<Agent>,
link_key: WireLinkKey,
options: GetLinksOptions
) -> Result<MustBoxFuture<'static, Result<WireLinkOps, HolochainP2pError>>, HolochainP2pError>
fn handle_get_links(
&mut self,
dna_hash: HoloHash<Dna>,
to_agent: HoloHash<Agent>,
link_key: WireLinkKey,
options: GetLinksOptions
) -> Result<MustBoxFuture<'static, Result<WireLinkOps, HolochainP2pError>>, HolochainP2pError>
A remote node is requesting link data from us.
sourcefn handle_get_agent_activity(
&mut self,
dna_hash: HoloHash<Dna>,
to_agent: HoloHash<Agent>,
agent: HoloHash<Agent>,
query: ChainQueryFilter,
options: GetActivityOptions
) -> Result<MustBoxFuture<'static, Result<AgentActivityResponse<HoloHash<Action>>, HolochainP2pError>>, HolochainP2pError>
fn handle_get_agent_activity(
&mut self,
dna_hash: HoloHash<Dna>,
to_agent: HoloHash<Agent>,
agent: HoloHash<Agent>,
query: ChainQueryFilter,
options: GetActivityOptions
) -> Result<MustBoxFuture<'static, Result<AgentActivityResponse<HoloHash<Action>>, HolochainP2pError>>, HolochainP2pError>
A remote node is requesting agent activity from us.
sourcefn handle_must_get_agent_activity(
&mut self,
dna_hash: HoloHash<Dna>,
to_agent: HoloHash<Agent>,
author: HoloHash<Agent>,
filter: ChainFilter<HoloHash<Action>>
) -> Result<MustBoxFuture<'static, Result<MustGetAgentActivityResponse, HolochainP2pError>>, HolochainP2pError>
fn handle_must_get_agent_activity(
&mut self,
dna_hash: HoloHash<Dna>,
to_agent: HoloHash<Agent>,
author: HoloHash<Agent>,
filter: ChainFilter<HoloHash<Action>>
) -> Result<MustBoxFuture<'static, Result<MustGetAgentActivityResponse, HolochainP2pError>>, HolochainP2pError>
A remote node is requesting agent activity from us.
sourcefn handle_validation_receipt_received(
&mut self,
dna_hash: HoloHash<Dna>,
to_agent: HoloHash<Agent>,
receipt: SerializedBytes
) -> Result<MustBoxFuture<'static, Result<(), HolochainP2pError>>, HolochainP2pError>
fn handle_validation_receipt_received(
&mut self,
dna_hash: HoloHash<Dna>,
to_agent: HoloHash<Agent>,
receipt: SerializedBytes
) -> Result<MustBoxFuture<'static, Result<(), HolochainP2pError>>, HolochainP2pError>
A remote node has sent us a validation receipt.
sourcefn handle_query_op_hashes(
&mut self,
dna_hash: HoloHash<Dna>,
arc_set: DhtArcSet,
window: Range<Timestamp>,
max_ops: usize,
include_limbo: bool
) -> Result<MustBoxFuture<'static, Result<Option<(Vec<HoloHash<DhtOp>, Global>, RangeInclusive<Timestamp>)>, HolochainP2pError>>, HolochainP2pError>
fn handle_query_op_hashes(
&mut self,
dna_hash: HoloHash<Dna>,
arc_set: DhtArcSet,
window: Range<Timestamp>,
max_ops: usize,
include_limbo: bool
) -> Result<MustBoxFuture<'static, Result<Option<(Vec<HoloHash<DhtOp>, Global>, RangeInclusive<Timestamp>)>, HolochainP2pError>>, HolochainP2pError>
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: HoloHash<Dna>,
query: FetchOpDataQuery
) -> Result<MustBoxFuture<'static, Result<Vec<(HoloHash<DhtOp>, DhtOp), Global>, HolochainP2pError>>, HolochainP2pError>
fn handle_fetch_op_data(
&mut self,
dna_hash: HoloHash<Dna>,
query: FetchOpDataQuery
) -> Result<MustBoxFuture<'static, Result<Vec<(HoloHash<DhtOp>, DhtOp), Global>, HolochainP2pError>>, HolochainP2pError>
The p2p module needs access to the content for a given set of DhtOpHashes.
sourcefn handle_sign_network_data(
&mut self,
dna_hash: HoloHash<Dna>,
to_agent: HoloHash<Agent>,
data: Vec<u8, Global>
) -> Result<MustBoxFuture<'static, Result<Signature, HolochainP2pError>>, HolochainP2pError>
fn handle_sign_network_data(
&mut self,
dna_hash: HoloHash<Dna>,
to_agent: HoloHash<Agent>,
data: Vec<u8, Global>
) -> Result<MustBoxFuture<'static, Result<Signature, HolochainP2pError>>, HolochainP2pError>
P2p operations require cryptographic signatures and validation.
sourcefn handle_countersigning_session_negotiation(
&mut self,
dna_hash: HoloHash<Dna>,
to_agent: HoloHash<Agent>,
message: CountersigningSessionNegotiationMessage
) -> Result<MustBoxFuture<'static, Result<(), HolochainP2pError>>, HolochainP2pError>
fn handle_countersigning_session_negotiation(
&mut self,
dna_hash: HoloHash<Dna>,
to_agent: HoloHash<Agent>,
message: CountersigningSessionNegotiationMessage
) -> Result<MustBoxFuture<'static, Result<(), HolochainP2pError>>, HolochainP2pError>
Messages between agents that drive a countersigning session.