Crate holochain::prelude::kitsune_p2p
source · Expand description
P2p / dht communication framework.
TLS session key logging
To use a tool like wireshark to debug kitsune QUIC communications, enable keylogging via tuning_param:
tuning_params.danger_tls_keylog = "env_keylog".to_string();
The tuning param by itself will do nothing, you also must specify
the file target via the environment variable SSLKEYLOGFILE
, e.g.:
SSLKEYLOGFILE="$(pwd)/keylog" my-kitsune-executable
As QUIC support within wireshark is in-progress, you’ll need a newer
version. This documentation was tested with version 3.6.2
.
Tell wireshark about your keylog file at:
[Edit] -> [Preferences...] -> [Protocols] -> [TLS] -> [(Pre)-Master-Secret log filename]
Your capture should now include QUIC
protocol packets, where the
Protected Payload
variants will be able to display internals,
such as STREAM([id])
decrypted content.
Also see https://github.com/quiclog/pcap2qlog
Modules
Definitions related to the KitsuneP2p peer-to-peer / dht communications actor.
Data structures to be stored in the agent/peer database.
re-exported dependencies
Definitions for events emited from the KitsuneP2p actor.
Fixturator definitions for kitsune_p2p.
Various gossip strategies for Kitsune.
metrics tracked by kitsune_p2p spaces
Utilities to make kitsune testing a little more sane.
KitsuneP2p Wire Protocol Encoding Decoding
Macros
Boilerplate shortcut for implementing TestVal on an item
Structs
A simple wrapper around the
AdaptorFactory
to allow implementing Debug and PartialEq.Dummy host impl for plumbing
Distinguish multiple agents within the same network module.
The basis hash/coordinate when identifying a neighborhood.
Data and handlers for diagnostic info, to be used by the host.
The op data with its location
Top-level “KitsuneDataHash” items are buckets of related meta-data.
These metadata “Operations” each also have unique OpHashes.
Configure the kitsune actor.
A cryptographic signature.
Distinguish multiple categories of communication within the same network module.
Enums
The type of gossip module running this gossip.
KitsuneP2p Error Type.
Method for connecting to other peers and broadcasting our AgentInfo
Whether we are willing to proxy on behalf of others
Proxy configuration options
Configure the network bindings for underlying kitsune transports.
Constants
The default production bootstrap service url.
The default development bootstrap service url.
Statics
10MB of entropy free for the taking.
Useful for initializing arbitrary::Unstructured data
Traits
Kitsune hashes are expected to be 36 bytes.
The first 32 bytes are the proper hash.
The final 4 bytes are a hash-of-the-hash that can be treated like a u32 “location”.
The interface to be implemented by the host, which handles various requests
for data
A supertrait of KitsuneHost convenient for defining test handlers.
Allows only specifying the methods you care about, and letting all the rest
throw errors if called
Functions
Helpful pattern for debug formatting many bytes.
If the size is > 32 bytes, only the first 8 and last 8 bytes will be displayed.
Spawn a new KitsuneP2p actor.
Spawn a new KitsuneP2p actor, using a closure to generate the HostApi.
Used for some test cases where the HostApi requires some of the intermediate
values created by this function.
Type Definitions
Signature for check_op_data_impl
Trait object for the host interface
Convenience type
A boxed future result with dynamic error type
Result Type