Skip to content

chore(cbind): nim-ffi migration [8/9] — relay, peerstore, metrics (API parity)#2779

Draft
gmelodie wants to merge 1 commit into
chore/cbind/ffi/07-service-discofrom
chore/cbind/ffi/08-relay-peerstore-metrics
Draft

chore(cbind): nim-ffi migration [8/9] — relay, peerstore, metrics (API parity)#2779
gmelodie wants to merge 1 commit into
chore/cbind/ffi/07-service-discofrom
chore/cbind/ffi/08-relay-peerstore-metrics

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
  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 ← this PR
  9. chore(cbind): nim-ffi migration [9/9] — flip to libp2p.nim, delete legacy cbind #2780 — flip + delete legacy

Part 8 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/07-service-disco (stacked).

This PR adds

  • libp2pCircuitRelayReserve.
  • Peerstore: addPeer, deletePeer, getPeerInfo, getPeers, setPeerAddresses, setPeerProtocols.
  • libp2pCollectMetrics (OpenMetrics -> JSON).
  • After this PR the new library is at full parity with the legacy cbind API surface.

Review artifact: Header diff shows the relay/peerstore/metrics entry points — the last additions before the flip.

@codecov-commenter

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 81.15%. Comparing base (c848748) to head (e09e4dd).

Additional details and impacted files

Impacted file tree graph

@@                         Coverage Diff                          @@
##           chore/cbind/ffi/07-service-disco    #2779      +/-   ##
====================================================================
- Coverage                             81.15%   81.15%   -0.01%     
====================================================================
  Files                                   170      170              
  Lines                                 31027    31027              
  Branches                                 12       13       +1     
====================================================================
- Hits                                  25181    25180       -1     
- Misses                                 5846     5847       +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