-
-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Extracting IPNS + Namesys from IPFS #6537
Comments
I figured I would post my comment from irc/matrix here with regards to the republisher:
What I currently do in my own IPNS publishing service, is have an in-memory cache that gets set whenever a record is published like so: // Publish enables publishing of an IPNS record with a default lifetime of 24 hours
func (r *RTNS) Publish(ctx context.Context, pk ci.PrivKey, cache bool, keyID, content string) error {
if cache {
r.cache.Set(keyID)
}
return r.ns.Publish(ctx, pk, path.FromString(content))
} Then when the republisher does its periodic run, it attempts to first list the key IDs stored in cache to ensure that time is spent only on republishing actual records, instead of a catch-all "attempt to republish all keys in keystore" func (r *RTNS) republishEntries() error {
keys := r.cache.list()
if len(keys) == 0 {
return errNoRecordsPublisher
}
for _, key := range keys {
priv, err := r.keys.Get(key)
if err != nil {
return errNoEntry
}
if err := r.republishEntry(r.ctx, priv); err != nil {
return err
}
}
return nil
} However, an in-memory cache isn't a super great solution, as you pointed our on irc during node restarts we would lose all data in the cache. I wonder if it might be worth taking a look at go-ipfs-provider and modelling a similar system such that instead of republishing blocks, we're republishing IPNS records. edit: Perhaps it might be worth putting this into |
@postables 👍 to trying to emulate what we do for IPFS pinning. It looks like go-ipfs-provider deals with providing CIDs which isn't quite what we're doing with IPNS (although we could potentially rewrite the code to be a bit more generic). As we discussed the lack of local persistence of pins (metadata like "I care about IPNS Key X, please keep it up to date") is a big deal here, but we should be able to just grab a namespace in the datastore. Using |
Personally speaking, I think having a modified
That is a very good point, |
Let's go with namesys. |
@hsanjuan any thoughts/requests for what you'd want exposed in a separate namesys library? |
|
@hsanjuan what is Otherwise those should all be doable, although it may take some time because namesys has TODOs all over the interfaces that are probably worth tackling now given that we can do a bit of a reset. |
|
I'm not feeling great about
👍 |
sgtm, you asked :) |
Hello, I am working to extract namesys. |
Namesys is a very useful submodule. Given a ValueStore and a Datastore it can resolve and publish /ipns/ paths. This functionality does not need to be sequestered inside go-ipfs as it can and should be used without IPFS, for example, for implementing lightweight IPNS publishing services or for resolving /ipns/ paths. "keystore" extraction was necessary, as there is a dependency to it in namesys. Keystore is also a useful module by itself within the stack. Fixes #6537
Namesys is a very useful submodule. Given a ValueStore and a Datastore it can resolve and publish /ipns/ paths. This functionality does not need to be sequestered inside go-ipfs as it can and should be used without IPFS, for example, for implementing lightweight IPNS publishing services or for resolving /ipns/ paths. "keystore" extraction was necessary, as there is a dependency to it in namesys. Keystore is also a useful module by itself within the stack. Fixes #6537
Namesys is a very useful submodule. Given a ValueStore and a Datastore it can resolve and publish /ipns/ paths. This functionality does not need to be sequestered inside go-ipfs as it can and should be used without IPFS, for example, for implementing lightweight IPNS publishing services or for resolving /ipns/ paths. "keystore" extraction was necessary, as there is a dependency to it in namesys. Keystore is also a useful module by itself within the stack. Fixes #6537
Namesys is a very useful submodule. Given a ValueStore and a Datastore it can resolve and publish /ipns/ paths. This functionality does not need to be sequestered inside go-ipfs as it can and should be used without IPFS, for example, for implementing lightweight IPNS publishing services or for resolving /ipns/ paths. "keystore" extraction was necessary, as there is a dependency to it in namesys. Keystore is also a useful module by itself within the stack. Fixes #6537
There have been some requests (e.g. from @hsanjuan at #4435 (comment)) to be able to utilize IPNS without IPFS.
Given that IPFS solves the problem of resolving
Content
fromHash(Content)
and Namesys solves a different problem of resolving aPath
from anIdentifier
it seems reasonable to be able to ask for these things separately.Any thoughts on how much of Namesys to extract (e.g. DNSLink and other non-IPNS resolvers) and where to extract it to would be appreciated. Do @lidel @Stebalien @lanzafame have any thoughts on this.
My current thought is to take basically all of Namesys (including DNSLink) and put it into a new package. We can then add other naming related functionality to that library that isn't necessarily appropriate for the IPFS CLI.
The text was updated successfully, but these errors were encountered: