UNPKG

anon-identity

Version:

Decentralized identity framework with DIDs, Verifiable Credentials, and privacy-preserving selective disclosure

104 lines 2.64 kB
import { AgentActivity, ActivityBatch } from './types'; export interface IPFSNode { url: string; name: string; priority: number; active: boolean; } export interface RedundancyConfig { minReplicas: number; nodes: IPFSNode[]; encryptionKey?: Uint8Array; retryAttempts?: number; retryDelay?: number; } export declare class IPFSRedundancyManager { private storageNodes; private config; private healthStatus; constructor(config: RedundancyConfig); private initializeNodes; /** * Store activity across multiple nodes with redundancy */ storeActivityWithRedundancy(activity: AgentActivity): Promise<{ success: boolean; nodes: { name: string; ipfsHash?: string; error?: string; }[]; }>; /** * Store activity batch with redundancy */ storeBatchWithRedundancy(batch: ActivityBatch): Promise<{ success: boolean; nodes: { name: string; ipfsHash?: string; error?: string; }[]; }>; /** * Retrieve activity from any available node */ retrieveActivity(ipfsHash: string): Promise<AgentActivity | null>; /** * Retrieve batch from any available node */ retrieveBatch(ipfsHash: string): Promise<ActivityBatch | null>; /** * Pin content across minimum required nodes */ pinWithRedundancy(ipfsHash: string): Promise<{ success: boolean; nodes: { name: string; pinned: boolean; error?: string; }[]; }>; /** * Check health of all nodes */ checkNodesHealth(): Promise<Map<string, boolean>>; /** * Get active nodes sorted by priority */ private getActiveNodes; /** * Retry operation with exponential backoff */ private retryOperation; /** * Sync content between nodes */ syncContent(ipfsHash: string, fromNode: string, toNodes: string[]): Promise<{ success: boolean; synced: string[]; failed: string[]; }>; /** * Add a new IPFS node */ addNode(node: IPFSNode): void; /** * Remove a node */ removeNode(nodeName: string): void; /** * Get storage statistics across all nodes */ getAggregateStats(): Promise<{ totalNodes: number; activeNodes: number; totalPinned: number; nodeStats: { name: string; pinned: number; healthy: boolean; }[]; }>; } //# sourceMappingURL=ipfs-redundancy-manager.d.ts.map