Trait holochain_p2p::actor::HolochainP2pHandler
source · [−]pub trait HolochainP2pHandler: GhostHandler<HolochainP2p> {
Show 15 methods
fn handle_join(
&mut self,
dna_hash: DnaHash,
agent_pub_key: AgentPubKey,
initial_arc: Option<DhtArc>
) -> HolochainP2pHandlerResult<()>;
fn handle_leave(
&mut self,
dna_hash: DnaHash,
agent_pub_key: AgentPubKey
) -> HolochainP2pHandlerResult<()>;
fn handle_call_remote(
&mut self,
dna_hash: DnaHash,
from_agent: AgentPubKey,
to_agent: AgentPubKey,
zome_name: ZomeName,
fn_name: FunctionName,
cap_secret: Option<CapSecret>,
payload: ExternIO
) -> HolochainP2pHandlerResult<SerializedBytes>;
fn handle_remote_signal(
&mut self,
dna_hash: DnaHash,
from_agent: AgentPubKey,
to_agent_list: Vec<AgentPubKey>,
zome_name: ZomeName,
fn_name: FunctionName,
cap: Option<CapSecret>,
payload: ExternIO
) -> HolochainP2pHandlerResult<()>;
fn handle_publish(
&mut self,
dna_hash: DnaHash,
request_validation_receipt: bool,
countersigning_session: bool,
dht_hash: AnyDhtHash,
ops: Vec<DhtOp>,
timeout_ms: Option<u64>
) -> HolochainP2pHandlerResult<usize>;
fn handle_get_validation_package(
&mut self,
input: GetValidationPackage
) -> HolochainP2pHandlerResult<ValidationPackageResponse>;
fn handle_get(
&mut self,
dna_hash: DnaHash,
dht_hash: AnyDhtHash,
options: GetOptions
) -> HolochainP2pHandlerResult<Vec<WireOps>>;
fn handle_get_meta(
&mut self,
dna_hash: DnaHash,
dht_hash: AnyDhtHash,
options: GetMetaOptions
) -> HolochainP2pHandlerResult<Vec<MetadataSet>>;
fn handle_get_links(
&mut self,
dna_hash: DnaHash,
link_key: WireLinkKey,
options: GetLinksOptions
) -> HolochainP2pHandlerResult<Vec<WireLinkOps>>;
fn handle_get_agent_activity(
&mut self,
dna_hash: DnaHash,
agent: AgentPubKey,
query: ChainQueryFilter,
options: GetActivityOptions
) -> HolochainP2pHandlerResult<Vec<AgentActivityResponse<ActionHash>>>;
fn handle_send_validation_receipt(
&mut self,
dna_hash: DnaHash,
to_agent: AgentPubKey,
receipt: SerializedBytes
) -> HolochainP2pHandlerResult<()>;
fn handle_new_integrated_data(
&mut self,
dna_hash: DnaHash
) -> HolochainP2pHandlerResult<()>;
fn handle_authority_for_hash(
&mut self,
dna_hash: DnaHash,
dht_hash: AnyDhtHash
) -> HolochainP2pHandlerResult<bool>;
fn handle_countersigning_session_negotiation(
&mut self,
dna_hash: DnaHash,
agents: Vec<AgentPubKey>,
message: CountersigningSessionNegotiationMessage
) -> HolochainP2pHandlerResult<()>;
fn handle_dump_network_metrics(
&mut self,
dna_hash: Option<DnaHash>
) -> HolochainP2pHandlerResult<String>;
}
Expand description
The HolochainP2pSender struct allows controlling the HolochainP2p actor instance.
Required Methods
fn handle_join(
&mut self,
dna_hash: DnaHash,
agent_pub_key: AgentPubKey,
initial_arc: Option<DhtArc>
) -> HolochainP2pHandlerResult<()>
fn handle_join(
&mut self,
dna_hash: DnaHash,
agent_pub_key: AgentPubKey,
initial_arc: Option<DhtArc>
) -> HolochainP2pHandlerResult<()>
The p2p module must be informed at runtime which dna/agent pairs it should be tracking.
fn handle_leave(
&mut self,
dna_hash: DnaHash,
agent_pub_key: AgentPubKey
) -> HolochainP2pHandlerResult<()>
fn handle_leave(
&mut self,
dna_hash: DnaHash,
agent_pub_key: AgentPubKey
) -> HolochainP2pHandlerResult<()>
If a cell is disabled, we’ll need to "leave" the network module as well.
fn handle_call_remote(
&mut self,
dna_hash: DnaHash,
from_agent: AgentPubKey,
to_agent: AgentPubKey,
zome_name: ZomeName,
fn_name: FunctionName,
cap_secret: Option<CapSecret>,
payload: ExternIO
) -> HolochainP2pHandlerResult<SerializedBytes>
fn handle_call_remote(
&mut self,
dna_hash: DnaHash,
from_agent: AgentPubKey,
to_agent: AgentPubKey,
zome_name: ZomeName,
fn_name: FunctionName,
cap_secret: Option<CapSecret>,
payload: ExternIO
) -> HolochainP2pHandlerResult<SerializedBytes>
Invoke a zome function on a remote node (if you have been granted the capability).
fn handle_remote_signal(
&mut self,
dna_hash: DnaHash,
from_agent: AgentPubKey,
to_agent_list: Vec<AgentPubKey>,
zome_name: ZomeName,
fn_name: FunctionName,
cap: Option<CapSecret>,
payload: ExternIO
) -> HolochainP2pHandlerResult<()>
fn handle_remote_signal(
&mut self,
dna_hash: DnaHash,
from_agent: AgentPubKey,
to_agent_list: Vec<AgentPubKey>,
zome_name: ZomeName,
fn_name: FunctionName,
cap: Option<CapSecret>,
payload: ExternIO
) -> HolochainP2pHandlerResult<()>
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.
fn handle_publish(
&mut self,
dna_hash: DnaHash,
request_validation_receipt: bool,
countersigning_session: bool,
dht_hash: AnyDhtHash,
ops: Vec<DhtOp>,
timeout_ms: Option<u64>
) -> HolochainP2pHandlerResult<usize>
fn handle_publish(
&mut self,
dna_hash: DnaHash,
request_validation_receipt: bool,
countersigning_session: bool,
dht_hash: AnyDhtHash,
ops: Vec<DhtOp>,
timeout_ms: Option<u64>
) -> HolochainP2pHandlerResult<usize>
Publish data to the correct neighborhood.
fn handle_get_validation_package(
&mut self,
input: GetValidationPackage
) -> HolochainP2pHandlerResult<ValidationPackageResponse>
fn handle_get_validation_package(
&mut self,
input: GetValidationPackage
) -> HolochainP2pHandlerResult<ValidationPackageResponse>
Request a validation package.
fn handle_get(
&mut self,
dna_hash: DnaHash,
dht_hash: AnyDhtHash,
options: GetOptions
) -> HolochainP2pHandlerResult<Vec<WireOps>>
fn handle_get(
&mut self,
dna_hash: DnaHash,
dht_hash: AnyDhtHash,
options: GetOptions
) -> HolochainP2pHandlerResult<Vec<WireOps>>
Get an entry from the DHT.
fn handle_get_meta(
&mut self,
dna_hash: DnaHash,
dht_hash: AnyDhtHash,
options: GetMetaOptions
) -> HolochainP2pHandlerResult<Vec<MetadataSet>>
fn handle_get_meta(
&mut self,
dna_hash: DnaHash,
dht_hash: AnyDhtHash,
options: GetMetaOptions
) -> HolochainP2pHandlerResult<Vec<MetadataSet>>
Get metadata from the DHT.
fn handle_get_links(
&mut self,
dna_hash: DnaHash,
link_key: WireLinkKey,
options: GetLinksOptions
) -> HolochainP2pHandlerResult<Vec<WireLinkOps>>
fn handle_get_links(
&mut self,
dna_hash: DnaHash,
link_key: WireLinkKey,
options: GetLinksOptions
) -> HolochainP2pHandlerResult<Vec<WireLinkOps>>
Get links from the DHT.
fn handle_get_agent_activity(
&mut self,
dna_hash: DnaHash,
agent: AgentPubKey,
query: ChainQueryFilter,
options: GetActivityOptions
) -> HolochainP2pHandlerResult<Vec<AgentActivityResponse<ActionHash>>>
fn handle_get_agent_activity(
&mut self,
dna_hash: DnaHash,
agent: AgentPubKey,
query: ChainQueryFilter,
options: GetActivityOptions
) -> HolochainP2pHandlerResult<Vec<AgentActivityResponse<ActionHash>>>
Get agent activity from the DHT.
fn handle_send_validation_receipt(
&mut self,
dna_hash: DnaHash,
to_agent: AgentPubKey,
receipt: SerializedBytes
) -> HolochainP2pHandlerResult<()>
fn handle_send_validation_receipt(
&mut self,
dna_hash: DnaHash,
to_agent: AgentPubKey,
receipt: SerializedBytes
) -> HolochainP2pHandlerResult<()>
Send a validation receipt to a remote node.
fn handle_new_integrated_data(
&mut self,
dna_hash: DnaHash
) -> HolochainP2pHandlerResult<()>
fn handle_new_integrated_data(
&mut self,
dna_hash: DnaHash
) -> HolochainP2pHandlerResult<()>
New data has been integrated and is ready for gossiping.
Check if any local agent in this space is an authority for a hash.
fn handle_countersigning_session_negotiation(
&mut self,
dna_hash: DnaHash,
agents: Vec<AgentPubKey>,
message: CountersigningSessionNegotiationMessage
) -> HolochainP2pHandlerResult<()>
fn handle_countersigning_session_negotiation(
&mut self,
dna_hash: DnaHash,
agents: Vec<AgentPubKey>,
message: CountersigningSessionNegotiationMessage
) -> HolochainP2pHandlerResult<()>
Messages between agents negotiation a countersigning session.
fn handle_dump_network_metrics(
&mut self,
dna_hash: Option<DnaHash>
) -> HolochainP2pHandlerResult<String>
fn handle_dump_network_metrics(
&mut self,
dna_hash: Option<DnaHash>
) -> HolochainP2pHandlerResult<String>
Dump network metrics.