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

Currently supports a single data type:

  • Chunk: Immutable content-addressed data (hash(value) == key)

§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 client::hex_node_id_to_encoded_peer_id;
pub use config::BootstrapCacheConfig;
pub use config::NodeConfig;
pub use config::StorageConfig;
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 replication::config::ReplicationConfig;
pub use replication::ReplicationEngine;
pub use storage::AntProtocol;
pub use storage::LmdbStorage;
pub use storage::LmdbStorageConfig;

Modules§

ant_protocol
Wire protocol re-exports from the ant_protocol crate.
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.
replication
Replication subsystem for the Autonomi network.
storage
Storage subsystem for chunk persistence.
upgrade
Auto-upgrade system with ML-DSA signature verification.

Structs§

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.

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.

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).