Skip to content

feat(kad): example persistent store over a key/value adapter - #3612

Draft
gmelodie wants to merge 1 commit into
masterfrom
feat/kad-example-custom-store-and-shared-contract-suite
Draft

gmelodie wants to merge 1 commit into
masterfrom
feat/kad-example-custom-store-and-shared-contract-suite

Conversation

@gmelodie

@gmelodie gmelodie commented Dec 4, 2026 •

Copy link
Copy Markdown
Collaborator

KadDHT takes a custom KadStore, but no example keeps records across a restart. examples/kad_custom_store.nim adds KvKadStore, a store over a four-call byte key/value adapter (get, put, del, scan), and SnapshotKv, an in-memory backend that saves to a file. examples/index.md gives the key layout and maps the adapter onto LevelDB, SQLite and nim-datastore.
test_kv_store.nim runs the shared contract suite of #3350 on the store, with the eviction rules of #3361, and checks that the caps hold after a reopen. A two-node test restarts a node on its saved store: live records are found, and expired records are not.

@gmelodie
gmelodie force-pushed the feat/kad-example-custom-store-and-shared-contract-suite branch from 6c8a4ca to 121cbf8 Compare December 4, 2026 17:20

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant