pipe-protocol
Version:
A protocol for large scale Interplanetary Intertool Agent Context
57 lines • 1.94 kB
TypeScript
/**
* @file IpfsNode Implementation
* @version 1.0.0
* @status STABLE - DO NOT MODIFY WITHOUT TESTS
* @lastModified 2024-02-03
*
* This file implements a unified IPFS node using Helia with configurable storage backends.
*
* IMPORTANT:
* - This is a STABLE implementation - any modifications require full test coverage
* - All changes must maintain backward compatibility
* - Changes affecting storage or networking require extensive testing
* - Run full test suite before and after modifications
* - Document all changes in the version history
*
* Core Functionality:
* - Configurable storage backend (memory or filesystem)
* - Network exposure control (enabled/disabled)
* - Data addition and retrieval with CID management
* - Explicit data export/import for private nodes
* - Node lifecycle management (init/cleanup)
* - Peer-to-peer communication (when networking enabled)
*
* Test Coverage Requirements:
* - Storage operations (add/get/delete)
* - Network isolation verification
* - Error handling and recovery
* - Resource cleanup
* - Cross-node communication
* - Data integrity verification
*/
export interface IpfsNodeOptions {
storage: 'memory' | 'persistent';
storageConfig?: {
directory: string;
};
enableNetworking?: boolean;
}
export declare class IpfsNode {
private options;
private helia;
private blockstore;
private libp2p;
constructor(options: IpfsNodeOptions);
init(): Promise<void>;
add(data: Uint8Array): Promise<string>;
put(data: Uint8Array): Promise<string>;
get(cidStr: string): Promise<Uint8Array | null>;
pin(cidStr: string): Promise<void>;
unpin(cidStr: string): Promise<void>;
getPinnedCids(): Promise<string[]>;
getPeerId(): import("@libp2p/interface").PeerId | null;
getMultiaddrs(): string[];
dial(addr: string): Promise<void>;
stop(): Promise<void>;
}
//# sourceMappingURL=ipfsNode.d.ts.map