Expand description
P2P networking layer built on libp2p.
This module owns the libp2p [Swarm] and exposes two public entry points:
build_swarm— constructs the swarm with all four behaviours (gossipsub, Kademlia, Identify, mDNS) and the Noise+Yamux transport.run_network_loop— async task that drives the swarm event loop and processesNetworkCommands sent by the daemon over a Tokio channel.
§Sub-modules
behaviour— the combinedBillPouchBehaviour(#[derive(NetworkBehaviour)]).state— in-memoryNetworkStateupdated from incoming gossip messages.
Re-exports§
pub use behaviour::BillPouchBehaviour;pub use behaviour::FragmentRequest;pub use behaviour::FragmentResponse;pub use bootstrap::BootstrapList;pub use fragment_gossip::FragmentIndexAnnouncement;pub use fragment_gossip::FragmentPointer;pub use fragment_gossip::RemoteFragmentIndex;pub use kad_store::KadPeers;pub use qos::PeerQos;pub use qos::QosRegistry;pub use qos::FAULT_BLACKLISTED;pub use qos::FAULT_DEGRADED;pub use qos::FAULT_SUSPECTED;pub use quality_monitor::run_quality_monitor;pub use reputation::ReputationRecord;pub use reputation::ReputationStore;pub use reputation::ReputationTier;pub use state::NetworkState;pub use state::NodeInfo;
Modules§
- behaviour
- Combined libp2p
NetworkBehaviourfor BillPouch. - bootstrap
- Bootstrap node list for initial WAN peer discovery.
- fragment_
gossip - Fragment-index gossip — distributed discovery of which Pouch holds which fragment.
- kad_
store - Persistence for the Kademlia routing table.
- qos
- Per-peer Quality-of-Service (QoS) tracking.
- quality_
monitor - Network quality monitor — Ping and Proof-of-Storage challenge loops.
- reputation
- Peer reputation system — R0..R4 tiers computed from QoS history.
- state
- Distributed network state maintained via gossip.
Structs§
- Outgoing
Fragment - A single fragment that was pushed to a remote Pouch.
Enums§
- Network
Command - Commands the daemon can send to the network task over the [
mpsc] channel.
Functions§
- build_
swarm - Construct a fully configured libp2p [
Swarm] using the Tokio runtime. - run_
network_ loop - Drive the P2P event loop until shutdown.
Type Aliases§
- Outgoing
Assignments - Map of remote Pouch peer IDs → fragments pushed to them.
- Storage
Manager Map - Shared map of active Pouch
StorageManagers, keyed byservice_id.