Trait holochain::prelude::actor::HolochainP2pHandler
source · pub trait HolochainP2pHandler: GhostHandler<HolochainP2p> {
Show 17 methods
fn handle_join(
&mut self,
dna_hash: HoloHash<Dna>,
agent_pub_key: HoloHash<Agent>,
initial_arc: Option<DhtArc>
) -> Result<MustBoxFuture<'static, Result<(), HolochainP2pError>>, HolochainP2pError>;
fn handle_leave(
&mut self,
dna_hash: HoloHash<Dna>,
agent_pub_key: HoloHash<Agent>
) -> Result<MustBoxFuture<'static, Result<(), HolochainP2pError>>, HolochainP2pError>;
fn handle_call_remote(
&mut self,
dna_hash: HoloHash<Dna>,
from_agent: HoloHash<Agent>,
signature: Signature,
to_agent: HoloHash<Agent>,
zome_name: ZomeName,
fn_name: FunctionName,
cap_secret: Option<CapSecret>,
payload: ExternIO,
nonce: Nonce256Bits,
expires_at: Timestamp
) -> Result<MustBoxFuture<'static, Result<SerializedBytes, HolochainP2pError>>, HolochainP2pError>;
fn handle_remote_signal(
&mut self,
dna_hash: HoloHash<Dna>,
from_agent: HoloHash<Agent>,
to_agent_list: Vec<(Signature, HoloHash<Agent>), Global>,
zome_name: ZomeName,
fn_name: FunctionName,
cap: Option<CapSecret>,
payload: ExternIO,
nonce: Nonce256Bits,
expires_at: Timestamp
) -> Result<MustBoxFuture<'static, Result<(), HolochainP2pError>>, HolochainP2pError>;
fn handle_publish(
&mut self,
dna_hash: HoloHash<Dna>,
request_validation_receipt: bool,
countersigning_session: bool,
basis_hash: HoloHash<AnyLinkable>,
source: HoloHash<Agent>,
op_hash_list: Vec<RoughSized<Arc<KitsuneOpHash>>, Global>,
timeout_ms: Option<u64>,
reflect_ops: Option<Vec<DhtOp, Global>>
) -> Result<MustBoxFuture<'static, Result<(), HolochainP2pError>>, HolochainP2pError>;
fn handle_publish_countersign(
&mut self,
dna_hash: HoloHash<Dna>,
flag: bool,
basis_hash: HoloHash<AnyLinkable>,
op: DhtOp
) -> Result<MustBoxFuture<'static, Result<(), HolochainP2pError>>, HolochainP2pError>;
fn handle_get(
&mut self,
dna_hash: HoloHash<Dna>,
dht_hash: HoloHash<AnyDht>,
options: GetOptions
) -> Result<MustBoxFuture<'static, Result<Vec<WireOps, Global>, HolochainP2pError>>, HolochainP2pError>;
fn handle_get_meta(
&mut self,
dna_hash: HoloHash<Dna>,
dht_hash: HoloHash<AnyDht>,
options: GetMetaOptions
) -> Result<MustBoxFuture<'static, Result<Vec<MetadataSet, Global>, HolochainP2pError>>, HolochainP2pError>;
fn handle_get_links(
&mut self,
dna_hash: HoloHash<Dna>,
link_key: WireLinkKey,
options: GetLinksOptions
) -> Result<MustBoxFuture<'static, Result<Vec<WireLinkOps, Global>, HolochainP2pError>>, HolochainP2pError>;
fn handle_get_agent_activity(
&mut self,
dna_hash: HoloHash<Dna>,
agent: HoloHash<Agent>,
query: ChainQueryFilter,
options: GetActivityOptions
) -> Result<MustBoxFuture<'static, Result<Vec<AgentActivityResponse<HoloHash<Action>>, Global>, HolochainP2pError>>, HolochainP2pError>;
fn handle_must_get_agent_activity(
&mut self,
dna_hash: HoloHash<Dna>,
author: HoloHash<Agent>,
filter: ChainFilter<HoloHash<Action>>
) -> Result<MustBoxFuture<'static, Result<Vec<MustGetAgentActivityResponse, Global>, HolochainP2pError>>, HolochainP2pError>;
fn handle_send_validation_receipt(
&mut self,
dna_hash: HoloHash<Dna>,
to_agent: HoloHash<Agent>,
receipt: SerializedBytes
) -> Result<MustBoxFuture<'static, Result<(), HolochainP2pError>>, HolochainP2pError>;
fn handle_new_integrated_data(
&mut self,
dna_hash: HoloHash<Dna>
) -> Result<MustBoxFuture<'static, Result<(), HolochainP2pError>>, HolochainP2pError>;
fn handle_authority_for_hash(
&mut self,
dna_hash: HoloHash<Dna>,
basis: HoloHash<AnyLinkable>
) -> Result<MustBoxFuture<'static, Result<bool, HolochainP2pError>>, HolochainP2pError>;
fn handle_countersigning_session_negotiation(
&mut self,
dna_hash: HoloHash<Dna>,
agents: Vec<HoloHash<Agent>, Global>,
message: CountersigningSessionNegotiationMessage
) -> Result<MustBoxFuture<'static, Result<(), HolochainP2pError>>, HolochainP2pError>;
fn handle_dump_network_metrics(
&mut self,
dna_hash: Option<HoloHash<Dna>>
) -> Result<MustBoxFuture<'static, Result<String, HolochainP2pError>>, HolochainP2pError>;
fn handle_get_diagnostics(
&mut self,
dna_hash: HoloHash<Dna>
) -> Result<MustBoxFuture<'static, Result<KitsuneDiagnostics, HolochainP2pError>>, HolochainP2pError>;
}
Expand description
The HolochainP2pSender struct allows controlling the HolochainP2p actor instance.
Required Methods§
sourcefn handle_join(
&mut self,
dna_hash: HoloHash<Dna>,
agent_pub_key: HoloHash<Agent>,
initial_arc: Option<DhtArc>
) -> Result<MustBoxFuture<'static, Result<(), HolochainP2pError>>, HolochainP2pError>
fn handle_join(
&mut self,
dna_hash: HoloHash<Dna>,
agent_pub_key: HoloHash<Agent>,
initial_arc: Option<DhtArc>
) -> Result<MustBoxFuture<'static, Result<(), HolochainP2pError>>, HolochainP2pError>
The p2p module must be informed at runtime which dna/agent pairs it should be tracking.
sourcefn handle_leave(
&mut self,
dna_hash: HoloHash<Dna>,
agent_pub_key: HoloHash<Agent>
) -> Result<MustBoxFuture<'static, Result<(), HolochainP2pError>>, HolochainP2pError>
fn handle_leave(
&mut self,
dna_hash: HoloHash<Dna>,
agent_pub_key: HoloHash<Agent>
) -> Result<MustBoxFuture<'static, Result<(), HolochainP2pError>>, HolochainP2pError>
If a cell is disabled, we’ll need to "leave" the network module as well.
sourcefn handle_call_remote(
&mut self,
dna_hash: HoloHash<Dna>,
from_agent: HoloHash<Agent>,
signature: Signature,
to_agent: HoloHash<Agent>,
zome_name: ZomeName,
fn_name: FunctionName,
cap_secret: Option<CapSecret>,
payload: ExternIO,
nonce: Nonce256Bits,
expires_at: Timestamp
) -> Result<MustBoxFuture<'static, Result<SerializedBytes, HolochainP2pError>>, HolochainP2pError>
fn handle_call_remote(
&mut self,
dna_hash: HoloHash<Dna>,
from_agent: HoloHash<Agent>,
signature: Signature,
to_agent: HoloHash<Agent>,
zome_name: ZomeName,
fn_name: FunctionName,
cap_secret: Option<CapSecret>,
payload: ExternIO,
nonce: Nonce256Bits,
expires_at: Timestamp
) -> Result<MustBoxFuture<'static, Result<SerializedBytes, HolochainP2pError>>, HolochainP2pError>
Invoke a zome function on a remote node (if you have been granted the capability).
sourcefn handle_remote_signal(
&mut self,
dna_hash: HoloHash<Dna>,
from_agent: HoloHash<Agent>,
to_agent_list: Vec<(Signature, HoloHash<Agent>), Global>,
zome_name: ZomeName,
fn_name: FunctionName,
cap: Option<CapSecret>,
payload: ExternIO,
nonce: Nonce256Bits,
expires_at: Timestamp
) -> Result<MustBoxFuture<'static, Result<(), HolochainP2pError>>, HolochainP2pError>
fn handle_remote_signal(
&mut self,
dna_hash: HoloHash<Dna>,
from_agent: HoloHash<Agent>,
to_agent_list: Vec<(Signature, HoloHash<Agent>), Global>,
zome_name: ZomeName,
fn_name: FunctionName,
cap: Option<CapSecret>,
payload: ExternIO,
nonce: Nonce256Bits,
expires_at: Timestamp
) -> Result<MustBoxFuture<'static, Result<(), HolochainP2pError>>, HolochainP2pError>
Invoke a zome function on a remote node (if you have been granted the capability). This is a fire-and-forget operation, a best effort will be made to forward the signal, but if the conductor network is overworked it may decide not to deliver some of the signals.
sourcefn handle_publish(
&mut self,
dna_hash: HoloHash<Dna>,
request_validation_receipt: bool,
countersigning_session: bool,
basis_hash: HoloHash<AnyLinkable>,
source: HoloHash<Agent>,
op_hash_list: Vec<RoughSized<Arc<KitsuneOpHash>>, Global>,
timeout_ms: Option<u64>,
reflect_ops: Option<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,
basis_hash: HoloHash<AnyLinkable>,
source: HoloHash<Agent>,
op_hash_list: Vec<RoughSized<Arc<KitsuneOpHash>>, Global>,
timeout_ms: Option<u64>,
reflect_ops: Option<Vec<DhtOp, Global>>
) -> Result<MustBoxFuture<'static, Result<(), HolochainP2pError>>, HolochainP2pError>
Publish data to the correct neighborhood.
sourcefn handle_publish_countersign(
&mut self,
dna_hash: HoloHash<Dna>,
flag: bool,
basis_hash: HoloHash<AnyLinkable>,
op: DhtOp
) -> Result<MustBoxFuture<'static, Result<(), HolochainP2pError>>, HolochainP2pError>
fn handle_publish_countersign(
&mut self,
dna_hash: HoloHash<Dna>,
flag: bool,
basis_hash: HoloHash<AnyLinkable>,
op: DhtOp
) -> Result<MustBoxFuture<'static, Result<(), HolochainP2pError>>, HolochainP2pError>
Publish a countersigning op.
sourcefn handle_get(
&mut self,
dna_hash: HoloHash<Dna>,
dht_hash: HoloHash<AnyDht>,
options: GetOptions
) -> Result<MustBoxFuture<'static, Result<Vec<WireOps, Global>, HolochainP2pError>>, HolochainP2pError>
fn handle_get(
&mut self,
dna_hash: HoloHash<Dna>,
dht_hash: HoloHash<AnyDht>,
options: GetOptions
) -> Result<MustBoxFuture<'static, Result<Vec<WireOps, Global>, HolochainP2pError>>, HolochainP2pError>
Get an entry from the DHT.
sourcefn handle_get_meta(
&mut self,
dna_hash: HoloHash<Dna>,
dht_hash: HoloHash<AnyDht>,
options: GetMetaOptions
) -> Result<MustBoxFuture<'static, Result<Vec<MetadataSet, Global>, HolochainP2pError>>, HolochainP2pError>
fn handle_get_meta(
&mut self,
dna_hash: HoloHash<Dna>,
dht_hash: HoloHash<AnyDht>,
options: GetMetaOptions
) -> Result<MustBoxFuture<'static, Result<Vec<MetadataSet, Global>, HolochainP2pError>>, HolochainP2pError>
Get metadata from the DHT.
sourcefn handle_get_links(
&mut self,
dna_hash: HoloHash<Dna>,
link_key: WireLinkKey,
options: GetLinksOptions
) -> Result<MustBoxFuture<'static, Result<Vec<WireLinkOps, Global>, HolochainP2pError>>, HolochainP2pError>
fn handle_get_links(
&mut self,
dna_hash: HoloHash<Dna>,
link_key: WireLinkKey,
options: GetLinksOptions
) -> Result<MustBoxFuture<'static, Result<Vec<WireLinkOps, Global>, HolochainP2pError>>, HolochainP2pError>
Get links from the DHT.
sourcefn handle_get_agent_activity(
&mut self,
dna_hash: HoloHash<Dna>,
agent: HoloHash<Agent>,
query: ChainQueryFilter,
options: GetActivityOptions
) -> Result<MustBoxFuture<'static, Result<Vec<AgentActivityResponse<HoloHash<Action>>, Global>, HolochainP2pError>>, HolochainP2pError>
fn handle_get_agent_activity(
&mut self,
dna_hash: HoloHash<Dna>,
agent: HoloHash<Agent>,
query: ChainQueryFilter,
options: GetActivityOptions
) -> Result<MustBoxFuture<'static, Result<Vec<AgentActivityResponse<HoloHash<Action>>, Global>, HolochainP2pError>>, HolochainP2pError>
Get agent activity from the DHT.
sourcefn handle_must_get_agent_activity(
&mut self,
dna_hash: HoloHash<Dna>,
author: HoloHash<Agent>,
filter: ChainFilter<HoloHash<Action>>
) -> Result<MustBoxFuture<'static, Result<Vec<MustGetAgentActivityResponse, Global>, HolochainP2pError>>, HolochainP2pError>
fn handle_must_get_agent_activity(
&mut self,
dna_hash: HoloHash<Dna>,
author: HoloHash<Agent>,
filter: ChainFilter<HoloHash<Action>>
) -> Result<MustBoxFuture<'static, Result<Vec<MustGetAgentActivityResponse, Global>, HolochainP2pError>>, HolochainP2pError>
A remote node is requesting agent activity from us.
sourcefn handle_send_validation_receipt(
&mut self,
dna_hash: HoloHash<Dna>,
to_agent: HoloHash<Agent>,
receipt: SerializedBytes
) -> Result<MustBoxFuture<'static, Result<(), HolochainP2pError>>, HolochainP2pError>
fn handle_send_validation_receipt(
&mut self,
dna_hash: HoloHash<Dna>,
to_agent: HoloHash<Agent>,
receipt: SerializedBytes
) -> Result<MustBoxFuture<'static, Result<(), HolochainP2pError>>, HolochainP2pError>
Send a validation receipt to a remote node.
sourcefn handle_new_integrated_data(
&mut self,
dna_hash: HoloHash<Dna>
) -> Result<MustBoxFuture<'static, Result<(), HolochainP2pError>>, HolochainP2pError>
fn handle_new_integrated_data(
&mut self,
dna_hash: HoloHash<Dna>
) -> Result<MustBoxFuture<'static, Result<(), HolochainP2pError>>, HolochainP2pError>
New data has been integrated and is ready for gossiping.
Check if any local agent in this space is an authority for a hash.
sourcefn handle_countersigning_session_negotiation(
&mut self,
dna_hash: HoloHash<Dna>,
agents: Vec<HoloHash<Agent>, Global>,
message: CountersigningSessionNegotiationMessage
) -> Result<MustBoxFuture<'static, Result<(), HolochainP2pError>>, HolochainP2pError>
fn handle_countersigning_session_negotiation(
&mut self,
dna_hash: HoloHash<Dna>,
agents: Vec<HoloHash<Agent>, Global>,
message: CountersigningSessionNegotiationMessage
) -> Result<MustBoxFuture<'static, Result<(), HolochainP2pError>>, HolochainP2pError>
Messages between agents negotiation a countersigning session.
sourcefn handle_dump_network_metrics(
&mut self,
dna_hash: Option<HoloHash<Dna>>
) -> Result<MustBoxFuture<'static, Result<String, HolochainP2pError>>, HolochainP2pError>
fn handle_dump_network_metrics(
&mut self,
dna_hash: Option<HoloHash<Dna>>
) -> Result<MustBoxFuture<'static, Result<String, HolochainP2pError>>, HolochainP2pError>
Dump network metrics.
sourcefn handle_get_diagnostics(
&mut self,
dna_hash: HoloHash<Dna>
) -> Result<MustBoxFuture<'static, Result<KitsuneDiagnostics, HolochainP2pError>>, HolochainP2pError>
fn handle_get_diagnostics(
&mut self,
dna_hash: HoloHash<Dna>
) -> Result<MustBoxFuture<'static, Result<KitsuneDiagnostics, HolochainP2pError>>, HolochainP2pError>
Get struct for diagnostic data