Skip to main content

Crate vflight

Crate vflight 

Source
Expand description

§vflight

Share files over the Veilid distributed network with content-addressable storage.

§Overview

vflight enables secure, decentralized file sharing using the Veilid p2p network. Files are chunked into 30KB pieces, hashed with BLAKE3, and stored in Veilid’s DHT.

§Quick Example

use vflight::chunker::chunk_file;
use std::path::Path;

let chunks = chunk_file(Path::new("myfile.bin"))?;
for chunk in chunks {
    println!("Chunk {}: {} bytes", chunk.index, chunk.data.len());
}

§Key Modules

  • chunker - File splitting and reassembly with hashing
  • compression - Zstd compression before chunking
  • protocol - Network message definitions
  • node - Veilid node lifecycle management
  • seed - Seed files to the network
  • fetch - Retrieve files from the network
  • metrics - Performance metrics collection
  • encryption - Chunk encryption for secure transfers
  • resume - Resume state management for interrupted downloads
  • throttle - Token-bucket bandwidth throttling for transfers

Re-exports§

pub use chunker::chunk_data;
pub use chunker::chunk_file;
pub use chunker::reassemble_chunks;
pub use chunker::Chunk;
pub use compression::compress;
pub use compression::decompress;
pub use encryption::generate_salt;
pub use encryption::EncryptionContext;
pub use encryption::SALT_LEN;
pub use encryption::SESSION_NONCE_LEN;
pub use node::start_node;
pub use node::stop_node;
pub use node::wait_for_attach;
pub use protocol::FileMetadata;
pub use protocol::Request;
pub use protocol::Response;
pub use protocol::CHUNK_SIZE;
pub use resume::ResumeManager;
pub use resume::ResumeMetadata;
pub use resume::ResumeState;
pub use throttle::Throttler;

Modules§

chunker
File chunking and reassembly with BLAKE3 hashing.
compression
Zstandard compression for file transfers.
encryption
Chunk encryption for secure in-flight transfers.
fetch
metrics
Performance metrics collection for debugging and tuning.
node
protocol
Network protocol definitions for file sharing.
resume
Resume state management for interrupted downloads.
seed
throttle
Token-bucket bandwidth throttling for chunk transfers.