Hubert - Distributed Infrastructure for Secure Multiparty Transactions - v1.0.0-alpha.20
    Preparing search index...

    Class IpfsKv

    IPFS-backed key-value store using IPNS for ARID-based addressing.

    This implementation uses:

    • ARID → IPNS key name derivation (deterministic)
    • IPFS content addressing (CID) for immutable storage
    • IPNS for publish-once mutable names
    • Write-once semantics (publish fails if name already exists)

    Port of struct IpfsKv from ipfs/kv.rs lines 54-60.

    Requirements

    Requires a running Kubo daemon (or compatible IPFS node) with RPC API available at the configured endpoint (default: http://127.0.0.1:5001).

    const store = new IpfsKv("http://127.0.0.1:5001");
    const arid = ARID.new();
    const envelope = Envelope.new("Hello, IPFS!");

    // Put envelope (write-once)
    await store.put(arid, envelope);

    // Get envelope with verbose logging
    const retrieved = await store.get(arid, undefined, true);

    Implements

    Index

    Constructors

    • Create a new IPFS KV store with default settings.

      Port of IpfsKv::new() from ipfs/kv.rs lines 73-81.

      Parameters

      Returns IpfsKv

    Methods

    • Set the maximum envelope size (default: 10 MB).

      Port of IpfsKv::with_max_size() from ipfs/kv.rs lines 84-87.

      Parameters

      • size: number

      Returns this

    • Set the IPNS resolve timeout (default: 30 seconds).

      Port of IpfsKv::with_resolve_timeout() from ipfs/kv.rs lines 90-93.

      Parameters

      • timeoutMs: number

        Timeout in milliseconds

      Returns this

    • Set whether to pin content (default: false).

      Port of IpfsKv::with_pin_content() from ipfs/kv.rs lines 96-99.

      Parameters

      • pin: boolean

      Returns this

    • Store an envelope at the given ARID.

      Port of KvStore::put() implementation from ipfs/kv.rs lines 289-367.

      Parameters

      • arid: ARID
      • envelope: Envelope
      • OptionalttlSeconds: number
      • Optionalverbose: boolean

      Returns Promise<string>

    • Retrieve an envelope for the given ARID.

      Port of KvStore::get() implementation from ipfs/kv.rs lines 370-450.

      Parameters

      • arid: ARID
      • OptionaltimeoutSeconds: number
      • Optionalverbose: boolean

      Returns Promise<Envelope | null>

    • Check if an envelope exists at the given ARID.

      Port of KvStore::exists() implementation from ipfs/kv.rs lines 453-481.

      Parameters

      • arid: ARID

      Returns Promise<boolean>