-
Notifications
You must be signed in to change notification settings - Fork 130
feat!: add ipns reproviding/republishing #764
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
* origin/main: chore: use peer id parsing function from libp2p (#762) feat: add republish signed ipns records (#745) fix: use bytestream methods to add byte streams (#758) chore: bump codecov/codecov-action from 5.3.1 to 5.4.0 (#752) feat: allow modifying trustless-gateway fetch (#751) fix: align implicit default ttl with specs (#749) docs: add spell checker to ci (#743) chore: Update FUNDING.json for Optimism RPF (#746)
This comment was marked as outdated.
This comment was marked as outdated.
Following a discussion offline with @achingbrain, we need to move key management internally to implement reproviding. Key management is typically (and store encrypted at rest) handled by the js-libp2p keychain, however we don't have libp2p in |
It'd also be good to see just how lightweight we can make libp2p for this sort of use-case. |
Yeah we could try that first and see how it feels. It may increase the bundle size. I also vaguely remember there being a bug with libp2p whereby instantiating it without the DHT, causes an infinite random walk loop with the defaults, as it's looking for a circuit relay reservation by default. Would this also allow Helia to make use of the libp2p over http stuff you've be working on? |
Looking at the breakdown, the usual suspects are already there -
I'd imagine this configuration wouldn't configure a relay listener so it wouldn't try to find a relay? We need this landing, really - ipfs/specs#476
Yes, though you'd need transports etc in order to use libp2p for the transport layer. |
As discussed in #807, the next steps here:
|
* origin/main: (27 commits) fix: flaky test to publish an IPNS record (#810) docs: fix API docs link (#809) fix: trustless gateway returned blocks can be limited (#791) deps: bump kubo from 0.34.1 to 0.35.0 in the kubo-deps group (#806) chore: fix linting chore: release main (#805) chore: bump execa from 8.0.1 to 9.5.3 (#797) chore: bump @helia/unixfs from 4.0.3 to 5.0.2 in /benchmarks/add-dir (#796) chore: bump codecov/codecov-action from 5.4.0 to 5.4.3 (#802) chore: bump tinybench from 3.1.1 to 4.0.1 (#798) deps: update aegir to 47.x.x (#804) chore: dep groups again chore: restore groups chore: remove groups chore: release main (#793) deps: update all deps (#792) chore: release main (#774) feat: pass initial providers to session (#777) ci: uci/copy-templates (#782) fix: propagate ipns failures (#789) ...
I have an open question: we currently store the marshalled DHT record for IPNS records in the datastore. As part of republishing, we need to also persist some additional local metadata associated with the IPNS record, like the keychain’s keyname (the key name string that the user passes) associated with the record and potentially also the lifetime. Both of these are needed for republishing. The two ways I’ve explored storing this metadata are:
The latter approach seems a bit easier and less likely to have downstream effects or unintended consequences (like polluting Since the datastore expect binary values, what are the conventions around storing such data in binary format? Should I use Protobuf for this or can I use cbor (which we already depend on) For the sake of the example, let's assume I have the following struct that I want to persiste:
|
Most of the datastore values are protobuf encoded - it's nice because it has predictable decoding behaviour and uses schemas which will protect us from ourselves. I think storing extra metadata under a separate key prefix is the way to go, the |
so that both helia and @helia/http can share the same base class with libp2p configured in a different fashion
* skip republishing records for which no key can be found in the keychain * fix tests
What
This PR adds the functionality necessary for a Helia node to reprovide records it created before expiry.
Fixes #367
Related: ipshipyard/roadmaps#1
Why
Currently, the
ipns.republish
method which runs the republishing loop does not actually handle republishing.How
Open question about storing keys
-This begs the question of whether we should store the keys so that we can create new valid records for stored IPNS names.
helia/packages/ipns/src/index.ts
Line 450 in 1e20e38
TODO