nucypher-experimental-taco-storage
Version:
TypeScript SDK for encrypted data storage with TACo (Threshold Access Control), supporting multiple storage providers including IPFS and SQLite
75 lines • 2.34 kB
TypeScript
/**
* Kubo IPFS storage adapter implementation using kubo-rpc-client
*/
import { BaseIPFSAdapter } from './base';
import { AdapterConfig, StorageMetadata, StorageResult } from '../../types';
/**
* Configuration interface for Kubo IPFS adapter
*/
export interface KuboAdapterConfig extends AdapterConfig {
/** IPFS node URL (defaults to localhost:5001) */
url?: string;
/** Optional timeout for IPFS operations in milliseconds */
timeout?: number;
/** Whether to pin content to prevent garbage collection */
pin?: boolean;
}
/**
* Kubo IPFS storage adapter for connecting to external Kubo IPFS nodes via RPC
*/
export declare class KuboAdapter extends BaseIPFSAdapter {
private client;
private readonly shouldPin;
private readonly timeout;
private readonly url;
constructor(config?: KuboAdapterConfig);
/**
* Initialize the Kubo adapter by testing connectivity and validating configuration
*/
initialize(): Promise<void>;
protected generateReference(id: string): string;
/**
* Ensure client is initialized before use
*/
private ensureClient;
protected addContent(data: Uint8Array): Promise<string>;
protected getContent(hash: string): Promise<Uint8Array>;
protected pinContent(hash: string): Promise<void>;
protected unpinContent(hash: string): Promise<void>;
protected contentExists(hash: string): Promise<boolean>;
protected getIPFSHealth(): Promise<{
connected: boolean;
nodeId?: string;
}>;
/**
* Store encrypted data and metadata on IPFS
*/
store(encryptedData: Uint8Array, metadata: StorageMetadata): Promise<StorageResult>;
/**
* Retrieve encrypted data and metadata from IPFS
*/
retrieve(id: string): Promise<{
encryptedData: Uint8Array;
metadata: StorageMetadata;
}>;
/**
* Delete data from IPFS (unpin if pinned)
*/
delete(id: string): Promise<boolean>;
/**
* Check if data exists on IPFS
*/
exists(id: string): Promise<boolean>;
/**
* Get IPFS node health status
*/
getHealth(): Promise<{
healthy: boolean;
details?: Record<string, unknown>;
}>;
/**
* Clean up IPFS client resources
*/
cleanup(): Promise<void>;
}
//# sourceMappingURL=kubo.d.ts.map