Expand description
Mesh transport primitives for HashTree.
This crate provides the reusable router, signaling, peer-link, and store layers for hashtree mesh networking. Production transports live outside this crate; the core abstractions here are intentionally transport-neutral so the same logic can be driven by FIPS, local mocks, Nostr relay fixtures, or other byte-link implementations.
§Overview
- Storage Backend: Any
hashtree_core::Storeimplementation - Peer Discovery: Any
SignalingTransportimplementation - Data Exchange: Any
PeerLink/PeerLinkFactoryimplementation - Protocol: Request/response with hash-based addressing
- Adaptive Selection: Intelligent peer selection based on performance
Re-exports§
pub use cashu::cashu_mint_metadata_path;pub use cashu::CashuMintMetadataRecord;pub use cashu::CashuMintMetadataStore;pub use cashu::CashuQuoteState;pub use cashu::CashuRoutingConfig;pub use cashu::ExpectedSettlement;pub use cashu::NegotiatedQuote;pub use cashu::CASHU_MINT_METADATA_VERSION;pub use channel::ChannelError;pub use channel::LatencyChannel;pub use channel::MockChannel;pub use channel::PeerChannel;pub use local_bus::LocalNostrBus;pub use mesh_session::forward_mesh_frame_to_sessions;pub use mesh_session::resolve_root_from_local_buses_with_source;pub use mesh_session::resolve_root_from_peer_sessions;pub use mesh_session::MeshSession;pub use mesh_store_core::build_hedged_wave_plan;pub use mesh_store_core::normalize_dispatch_config;pub use mesh_store_core::run_hedged_waves;pub use mesh_store_core::sync_selector_peers;pub use mesh_store_core::DataPumpStats;pub use mesh_store_core::HedgedWaveAction;pub use mesh_store_core::MeshReadSource;pub use mesh_store_core::MeshRoutingConfig;pub use mesh_store_core::MeshStoreCore;pub use mesh_store_core::PubsubDeliveryMode;pub use mesh_store_core::PubsubEvent;pub use mesh_store_core::PubsubPublishStats;pub use mesh_store_core::RequestDispatchConfig;pub use mesh_store_core::ResponseBehaviorConfig;pub use mesh_store_core::SimMeshStore;pub use mock::clear_channel_registry;pub use mock::MockConnectionFactory;pub use mock::MockDataChannel;pub use mock::MockLatencyMode;pub use mock::MockRelay;pub use mock::MockRelayTransport;pub use multicast::MulticastConfig;pub use multicast::MulticastNostrBus;pub use nostr::decode_signaling_event;pub use nostr::encode_signaling_event;pub use nostr::NostrRelayTransport;pub use peer_selector::peer_principal;pub use peer_selector::PeerMetadataSnapshot;pub use peer_selector::PeerSelector;pub use peer_selector::PeerStats;pub use peer_selector::PersistedPeerMetadata;pub use peer_selector::SelectionStrategy;pub use peer_selector::SelectorSummary;pub use peer_selector::PEER_METADATA_SNAPSHOT_VERSION;pub use protocol::bytes_to_hash;pub use protocol::create_fragment_response;pub use protocol::create_pubsub_frame;pub use protocol::create_pubsub_interest;pub use protocol::create_pubsub_inventory;pub use protocol::create_pubsub_want;pub use protocol::create_quote_request;pub use protocol::create_quote_response_available;pub use protocol::create_request;pub use protocol::create_request_with_quote;pub use protocol::create_response;pub use protocol::encode_chunk;pub use protocol::encode_payment;pub use protocol::encode_payment_ack;pub use protocol::encode_peer_hints;pub use protocol::encode_pubsub_frame;pub use protocol::encode_pubsub_interest;pub use protocol::encode_pubsub_inventory;pub use protocol::encode_pubsub_want;pub use protocol::encode_quote_request;pub use protocol::encode_quote_response;pub use protocol::encode_request;pub use protocol::encode_response;pub use protocol::hash_to_bytes;pub use protocol::hash_to_key;pub use protocol::is_fragmented;pub use protocol::parse_message;pub use protocol::DataChunk;pub use protocol::DataMessage;pub use protocol::DataPayment;pub use protocol::DataPaymentAck;pub use protocol::DataQuoteRequest;pub use protocol::DataQuoteResponse;pub use protocol::DataRequest;pub use protocol::DataResponse;pub use protocol::PeerHints;pub use protocol::PubsubFrame;pub use protocol::PubsubInterest;pub use protocol::PubsubInventory;pub use protocol::PubsubWant;pub use protocol::FRAGMENT_SIZE;pub use protocol::MSG_TYPE_CHUNK;pub use protocol::MSG_TYPE_PAYMENT;pub use protocol::MSG_TYPE_PAYMENT_ACK;pub use protocol::MSG_TYPE_PEER_HINTS;pub use protocol::MSG_TYPE_PUBSUB_FRAME;pub use protocol::MSG_TYPE_PUBSUB_INTEREST;pub use protocol::MSG_TYPE_PUBSUB_INVENTORY;pub use protocol::MSG_TYPE_PUBSUB_WANT;pub use protocol::MSG_TYPE_QUOTE_REQUEST;pub use protocol::MSG_TYPE_QUOTE_RESPONSE;pub use protocol::MSG_TYPE_REQUEST;pub use protocol::MSG_TYPE_RESPONSE;pub use pubsub_strategy::reciprocal_upload_weight;pub use pubsub_strategy::reciprocal_virtual_finish;pub use pubsub_strategy::select_reciprocal_outbound_job;pub use pubsub_strategy::stable_pubsub_score;pub use pubsub_strategy::OutboundJobCandidate;pub use pubsub_strategy::OutboundJobSelection;pub use pubsub_strategy::PeerTrafficSnapshot;pub use pubsub_strategy::PubsubCandidate;pub use pubsub_strategy::PubsubSchedulerConfig;pub use pubsub_strategy::PubsubSchedulingPolicy;pub use pubsub_strategy::PubsubSelection;pub use relay_bridge::MeshEventStore;pub use relay_bridge::MeshRelayClient;pub use root_events::build_root_filter;pub use root_events::hashtree_event_identifier;pub use root_events::is_hashtree_labeled_event;pub use root_events::pick_latest_event;pub use root_events::root_event_from_peer;pub use root_events::PeerRootEvent;pub use root_events::HASHTREE_KIND;pub use root_events::HASHTREE_LABEL;pub use runtime_control::can_track_source_peer;pub use runtime_control::cleanup_stale_peers;pub use runtime_control::create_signaling_event;pub use runtime_control::dispatch_signaling_message;pub use runtime_control::forward_mesh_frame_from_runtime;pub use runtime_control::handle_peer_state_event;pub use runtime_control::handle_signaling_event;pub use runtime_control::handle_signaling_message;pub use runtime_control::PeerStateEvent;pub use runtime_peer::can_track_signal_path_peer;pub use runtime_peer::remember_peer_signal_path;pub use runtime_peer::ConnectionState;pub use runtime_peer::MeshPeerEntry;pub use runtime_peer::PeerDirection;pub use runtime_peer::PeerSignalPath;pub use runtime_peer::PeerTransport;pub use runtime_peer::TransportPeerRegistrar;pub use runtime_state::MeshRuntimeState;pub use signaling::MeshRouter;pub use signaling::PeerEntry;pub use transport::PeerLink;pub use transport::PeerLinkFactory;pub use transport::SignalingTransport;pub use transport::TransportError;pub use types::classifier_channel;pub use types::decrement_htl_with_policy;pub use types::is_polite_peer;pub use types::should_forward;pub use types::should_forward_htl;pub use types::validate_mesh_frame;pub use types::ClassifierRx;pub use types::ClassifierTx;pub use types::ClassifyRequest;pub use types::HtlMode;pub use types::HtlPolicy;pub use types::IceCandidate;pub use types::KnownPeerRecord;pub use types::KnownPeerSnapshot;pub use types::MeshNostrFrame;pub use types::MeshNostrPayload;pub use types::MeshStats;pub use types::MeshStoreConfig;pub use types::PeerHTLConfig;pub use types::PeerId;pub use types::PeerPool;pub use types::PeerState;pub use types::PoolConfig;pub use types::PoolSettings;pub use types::SignalingMessage;pub use types::TimedSeenSet;pub use types::BLOB_REQUEST_POLICY;pub use types::DECREMENT_AT_MAX_PROB;pub use types::DECREMENT_AT_MIN_PROB;pub use types::MAX_HTL;pub use types::MESH_DEFAULT_HTL;pub use types::MESH_EVENT_POLICY;pub use types::MESH_MAX_HTL;pub use types::MESH_PROTOCOL;pub use types::MESH_PROTOCOL_VERSION;pub use types::MESH_SIGNALING_EVENT_KIND;pub use types::NOSTR_KIND_HASHTREE;
Modules§
- cashu
- channel
- Peer communication channel abstraction
- local_
bus - mesh_
session - mesh_
store_ core - Shared routed mesh store core.
- mock
- Mock implementations for testing and simulation
- multicast
- nostr
- Nostr websocket signaling transport implementation
- peer_
selector - Adaptive peer selection based on Freenet patterns
- protocol
- Wire protocol for hashtree mesh data exchange.
- pubsub_
strategy - Pure peer traffic and pubsub fanout scheduling strategies.
- relay_
bridge - root_
events - runtime_
control - runtime_
peer - runtime_
state - signaling
- Shared signaling logic for peer discovery and connection management.
- transport
- Signaling and peer-link transport abstractions
- types
- Mesh transport types for peer-to-peer data exchange.