Check if the DHT is bootstrapped.
StaticcreateCreate a new Mainline DHT KV store with default settings.
Port of MainlineDhtKv::new() from mainline/kv.rs lines 68-79.
Set the maximum value size (default: 1000 bytes).
Note: Values larger than ~1KB may not be reliably stored in the DHT.
Port of MainlineDhtKv::with_max_size() from mainline/kv.rs lines 84-87.
Set a salt for namespace separation.
Different salts will create separate namespaces for the same ARID.
Port of MainlineDhtKv::with_salt() from mainline/kv.rs lines 92-95.
Store an envelope at the given ARID.
Port of KvStore::put() implementation from mainline/kv.rs lines 144-220.
Optional_ttlSeconds: numberOptionalverbose: booleanRetrieve an envelope for the given ARID.
Port of KvStore::get() implementation from mainline/kv.rs lines 223-303.
OptionaltimeoutSeconds: numberOptionalverbose: booleanCheck if an envelope exists at the given ARID.
Port of KvStore::exists() implementation from mainline/kv.rs lines 306-314.
Destroy the DHT client and release resources.
Mainline DHT-backed key-value store using ARID-based addressing.
This implementation uses:
Port of
struct MainlineDhtKvfrom mainline/kv.rs lines 60-64.Storage Model
Uses BEP-44 mutable items where:
Requirements
No external daemon required - the DHT client runs embedded.
Size Limits
The Mainline DHT has a practical limit of ~1KB per value. For larger envelopes, use
IpfsKvorHybridKvinstead.Example