ipfrs
Main library crate for IPFRS (Inter-Planet File RUST System).
Overview
ipfrs is the unified entry point for the IPFRS ecosystem, providing:
- Complete Node: Full IPFRS node implementation
- Embedded Usage: Library for embedding in applications
- Plugin Architecture: Extensible component system
- High-Level API: Simplified interface to all features
Key Features
Unified Node
Single crate that brings together all IPFRS components:
- Storage (ipfrs-storage)
- Networking (ipfrs-network)
- Transport (ipfrs-transport)
- Semantic routing (ipfrs-semantic)
- TensorLogic integration (ipfrs-tensorlogic)
- API interfaces (ipfrs-interface)
High-Level API
Simple, ergonomic interface:
use Node;
// Start a node
let node = new.await?;
// Add content
let cid = node.add_file.await?;
// Retrieve content
let data = node.get.await?;
// Semantic search
let results = node.search_similar.await?;
// TensorLogic inference
let solutions = node.infer.await?;
Embedded Mode
Use IPFRS as a library in your application:
- No separate daemon process
- Direct API access
- Custom configuration
- Resource control
Plugin System
Extensible architecture:
- Custom storage backends
- Additional protocols
- Custom content types
- Hook system for events
Architecture
ipfrs (Main Library)
├── Node # Unified node orchestrator
├── Builder # Configuration builder
├── Events # Event system
└── Plugins # Plugin registry
↓
All ipfrs-* crates
Design Principles
- Batteries Included: Everything needed for full functionality
- Modular: Use only what you need
- Zero-Config: Sensible defaults, easy to customize
- Production Ready: Robust error handling, observability
Usage Example
Basic Usage
use ;
async
Advanced Configuration
use ;
let config = builder
.storage
.network_mode
.cache_size_mb
.max_connections
.enable_tensorlogic
.enable_semantic_search
.build?;
let node = new.await?;
Event Handling
use ;
let mut node = new.await?;
// Subscribe to events
let mut events = node.subscribe;
spawn;
Custom Plugins
use ;
;
let node = builder
.add_plugin
.build
.await?;
Feature Flags
Control which components to include:
[]
= { = "0.3.0", = ["full"] }
# Or selectively enable features:
= {
version = "0.3.0",
= ["storage", "network", "tensorlogic"]
}
Available features:
full- All features enabledstorage- Storage layernetwork- P2P networkingtransport- Data exchange protocolssemantic- Vector searchtensorlogic- TensorLogic integrationinterface- HTTP/gRPC APIscli- Command-line interface
Performance Characteristics
| Metric | Kubo (Go) | IPFRS (Rust) |
|---|---|---|
| Memory (Idle) | 200 MB | 20 MB |
| Memory (Active) | 800 MB | 150 MB |
| Startup Time | 5s | 0.5s |
| Block Add (1MB) | 50ms | 5ms |
| Block Get (1MB) | 30ms | 3ms |
Dependencies
ipfrs-core- Core primitivesipfrs-storage- Storage layeripfrs-network- Networkingipfrs-transport- Data exchangeipfrs-semantic- Vector searchipfrs-tensorlogic- TensorLogicipfrs-interface- APIstokio- Async runtime
References
- IPFRS v0.1.0 Whitepaper (Performance Focus)
- IPFRS v0.2.0 Whitepaper (TensorLogic Integration)
- IPFRS v0.3.0 Whitepaper (Unified Architecture)