Skip to content

chore(cbind): nim-ffi migration [6/9] — kademlia + CID + crypto#2777

Draft
gmelodie wants to merge 1 commit into
chore/cbind/ffi/05-pubsubfrom
chore/cbind/ffi/06-kad-crypto
Draft

chore(cbind): nim-ffi migration [6/9] — kademlia + CID + crypto#2777
gmelodie wants to merge 1 commit into
chore/cbind/ffi/05-pubsubfrom
chore/cbind/ffi/06-kad-crypto

Conversation

@gmelodie

@gmelodie gmelodie commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

nim-ffi cbind migration — PR train

  1. chore(cbind): nim-ffi migration [1/9] — deps + pinning scaffold #2772 — deps + pinning
  2. chore(cbind): nim-ffi migration [2/9] — new-library scaffold + CI #2773 — scaffold + CI
  3. chore(cbind): nim-ffi migration [3/9] — connectivity & identity #2774 — connectivity
  4. chore(cbind): nim-ffi migration [4/9] — streams & custom protocols (+ echo example) #2775 — streams (+ echo)
  5. chore(cbind): nim-ffi migration [5/9] — pubsub / gossipsub (+ gossipsub example) #2776 — pubsub (+ gossipsub)
  6. chore(cbind): nim-ffi migration [6/9] — kademlia + CID + crypto #2777 — kad + CID + crypto ← this PR
  7. chore(cbind): nim-ffi migration [7/9] — service discovery + extended peer records #2778 — service discovery
  8. chore(cbind): nim-ffi migration [8/9] — relay, peerstore, metrics (API parity) #2779 — relay / peerstore / metrics
  9. chore(cbind): nim-ffi migration [9/9] — flip to libp2p.nim, delete legacy cbind #2780 — flip + delete legacy

Part 6 of a 9-PR train that replaces the hand-rolled cbind/ C bindings with the generated nim-ffi codegen, landing it domain by domain so each PR stays reviewable and CI-green (build the FFI lib + generate bindings + build/run examples).

Targets chore/cbind/ffi/05-pubsub (stacked).

This PR adds

  • Kademlia: findNode, putValue, getValue, addProvider, getProviders, startProviding, stopProviding, randomRecords.
  • libp2pCreateCid and libp2pNewPrivateKey.
  • Their request/response types plus the extended-peer-record marshalling helpers used by randomRecords.

Review artifact: Header diff shows the kad + CID + crypto entry points.

@codecov-commenter

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 81.14%. Comparing base (19a6408) to head (c7cf009).

Additional details and impacted files

Impacted file tree graph

@@                      Coverage Diff                      @@
##           chore/cbind/ffi/05-pubsub    #2777      +/-   ##
=============================================================
- Coverage                      81.14%   81.14%   -0.01%     
=============================================================
  Files                            170      170              
  Lines                          31027    31027              
  Branches                          12       12              
=============================================================
- Hits                           25178    25177       -1     
- Misses                          5849     5850       +1     

see 3 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@gmelodie gmelodie mentioned this pull request Jul 7, 2026
2 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: new

Development

Successfully merging this pull request may close these issues.

2 participants