Skip to main content

Crate ant_node

Crate ant_node 

Source
Expand description

§ant-node

A pure quantum-proof network node for the Autonomi decentralized network.

This crate provides a thin wrapper around saorsa-core that adds:

  • Auto-upgrade system with ML-DSA signature verification
  • CLI interface and configuration
  • Content-addressed chunk storage with EVM payment

§Architecture

ant-node delegates all core functionality to saorsa-core:

  • Networking via P2PNode
  • DHT via AdaptiveDHT
  • Trust via TrustEngine
  • Security via IPDiversityConfig

§Data Types

Two data types:

  • Chunk: Immutable content-addressed data (hash(value) == key)
  • Pointer: A paid mutable reference signed by an immutable owner, stored at an address derived from the owner key (see pointer and ADR-0016)

§Example

use ant_node::{NodeBuilder, NodeConfig};

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    let config = NodeConfig::default();
    let mut node = NodeBuilder::new(config).build().await?;
    node.run().await?;
    Ok(())
}

Re-exports§

pub use browser::BrowserBootstrapNode;
pub use browser::BrowserChunkInfo;
pub use browser::BrowserDevnetManifest;
pub use browser::BrowserPublicFile;
pub use browser::BROWSER_MANIFEST_VERSION;
pub use client::hex_node_id_to_encoded_peer_id;
pub use config::NodeConfig;
pub use config::StorageConfig;
pub use config::WebRtcDirectConfig;
pub use devnet::Devnet;
pub use devnet::DevnetConfig;
pub use error::Error;
pub use error::Result;
pub use event::NodeEvent;
pub use event::NodeEventsChannel;
pub use node::NodeBuilder;
pub use node::RunningNode;
pub use payment::PaymentStatus;
pub use payment::PaymentVerifier;
pub use payment::PaymentVerifierConfig;
pub use pointer::PointerStore;
pub use pointer::PutOutcome;
pub use replication::config::ReplicationConfig;
pub use replication::ReplicationEngine;
pub use storage::AntProtocol;
pub use storage::ChunkStore;
pub use storage::ChunkStoreConfig;

Modules§

ant_protocol
Wire protocol re-exports from the ant_protocol crate.
browser
Shared browser-client discovery types.
client
Protocol helpers for ant-node client operations.
config
Configuration for ant-node.
core
Re-exports from saorsa-core so downstream crates (e.g. ant-client) can depend on ant-node alone without a direct saorsa-core dependency.
devnet
Local devnet infrastructure for spawning and managing multiple nodes.
error
Error types for ant-node.
event
Node event system.
logging
Logging facade that compiles to no-ops when the logging feature is disabled.
node
Node implementation - thin wrapper around saorsa-core’s P2PNode.
payment
Payment verification system for ant-node.
pointer
Pointers — paid mutable references with an immutable owner.
replication
Replication subsystem for the Autonomi network.
storage
Storage subsystem for chunk persistence.
upgrade
Auto-upgrade system with ML-DSA signature verification.

Structs§

BrowserEndpoint
Manifest- and wire-compatible wrapper around a WebRTC Direct multiaddress.
BrowserPaymentNetwork
Public EVM identity transmitted by manifests and HELLO responses. RPC endpoints belong to the node operator or client application and never form part of this wire record.
ChunkGetRequest
Request to retrieve a chunk.
ChunkMessage
Wire-format wrapper that pairs a sender-assigned request_id with a ChunkMessageBody.
ChunkPutRequest
Request to store a chunk.
ChunkQuoteRequest
Request a storage quote for a chunk.
DataChunk
A chunk of data with its content-addressed identifier.
DevnetEvmInfo
EVM configuration info included in the devnet manifest.
DevnetManifest
Devnet manifest for client discovery.
Pointer
A paid, mutable, owner-signed reference.
PointerState
The parts of a record that determine its authenticated state.
PointerTarget
A kind tag plus the address it refers to.
WebRtcDirectEndpoint
Parsed, certificate-pinned direct endpoint.

Enums§

ChunkGetResponse
Response to a GET request.
ChunkMessageBody
Enum of all chunk protocol message types.
ChunkPutResponse
Response to a PUT request.
ChunkQuoteResponse
Response with a storage quote.
PointerTargetKind
What a pointer points at, as clients interpret it.

Constants§

CHUNK_PROTOCOL_ID
Protocol identifier for chunk operations.
CLOSE_GROUP_MAJORITY
Minimum number of close group members that must agree for a decision to be valid.
CLOSE_GROUP_SIZE
Number of nodes in a Kademlia close group.
MAX_CHUNK_SIZE
Maximum chunk size in bytes (4MB).

Functions§

compute_address
Compute the content address (BLAKE3 hash) for the given data.
peer_id_to_xor_name
Convert a hex-encoded peer ID string to an XorName.
xor_distance
Compute the XOR distance between two 32-byte addresses.

Type Aliases§

XorName
Content-addressed identifier (32 bytes).