Skip to content
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

Ability to pin ipns names #1467

Open
reit-c opened this issue Jul 11, 2015 · 13 comments
Open

Ability to pin ipns names #1467

reit-c opened this issue Jul 11, 2015 · 13 comments
Labels
kind/enhancement A net-new feature or improvement to an existing feature

Comments

@reit-c
Copy link

reit-c commented Jul 11, 2015

It would be very nice to be able pin IPNS names, such that the daemon periodically polls the DHT to find if there are any new hashes published to the requested names, and then automatically pins them if so.

Depending on the structure of the code (I'm not familiar with Go), this may be a simple matter of creating a new thread to sit in a loop that does

while(running){
  for each (name in pinned_names){
    new_hash = resolve(name)
    if(new_hash != last_good_known[name]){
      pin(new_hash)
      unpin(last_good_known[name])
      last_good_known[name] = new_hash
    }
  }
  sleep(something_sensible)
}

This would make it very easy to use IPFS as a backup solution, either to create a mirror of your website on another of your servers, or to make general backups to a remote machine (e.g. passworded duplicity backups would work quite well here).

Note that there should be some way within the command line syntax to allow the user to include a '-r' recursive pin/unpin option, for distinguishing if the user wants to pin a single node or the entire tree. Possible syntax could be something like ipfs pin name add -r .

@whyrusleeping
Copy link
Member

I've been thinking a little bit about this recently, and what my current train of thought is, is that once we implement pub-sub, updating an ipns entry will be a 'publish' that people can subscribe to, so they can be notified of every time it gets updated and then update the pin.

@fazo96
Copy link

fazo96 commented Nov 27, 2015

@whyrusleeping is it planned for the pin command to take an IPNS name and automatically pin the address pointed by the name and automatically unpin the old adress and pin the new one when the record is updated?

I think this has many usecases and should be taken into consideration, not sure about how hard it would be to implement but it doesn't look like it would need much except pub/sub.

@whyrusleeping
Copy link
Member

@fazo96 yeah, something along those lines is planned. The issue is when to check for updates, its either polling or pubsub, and I really am not a fan of polling.

@lidel
Copy link
Member

lidel commented Jan 6, 2016

Right now when I try to pin IPNS path it just.. hangs and needs to be interrupted via Ctrl+C:

$ ipfs-node ipfs pin add /ipfs/QmTkzDwWqPbnAh5YiV5VwcTLnGdwSNsNTn2aDxdXBFca7D/example
pinned QmeKozNssnkJ4NcyRidYgDY2jfRZqVEoRGfipkgath71bX recursively

$ ipfs-node ipfs pin add /ipns/ipfs.git.sexy
^C

At this point it is not possible to pin anything else and I need to restart go-ipfs daemon to fix pinning functionality.

I think pinning a valid IPNS address should immediately return an error (Error: pin: IPNS not implemented yet), just like it does for invalid ones:

$ ipfs pin add /ipns/invalid.one
Error: pin: could not resolve name.

@palkeo
Copy link
Contributor

palkeo commented Feb 20, 2016

Hey. I'm also interested by that.

But do you think that pub-sub would be able to solve all the problem by itself ? If I pin an IPNS name, turn my node off and go back 10 days later, my node should do polling to poll for the last version of the content too as it may have missed pub/sub updates.
Maybe something hybrid, where I could do either polling, pubsub, or both ?

@whyrusleeping whyrusleeping added the kind/enhancement A net-new feature or improvement to an existing feature label Aug 24, 2016
@mildred
Copy link
Contributor

mildred commented Jan 3, 2018

Probably related issue: #4435

@NiKiZe
Copy link

NiKiZe commented Jul 23, 2018

Is it true that trying to pin ipns path currently hangs, and also causes the daemon to not accept more pins, if so could we get a fix in that returns an error instead, or at least a warning? (that would avoid noobs like me spending lots of time wondering why/how pinning works and why it seems to hang) Thanks!

@whyrusleeping
Copy link
Member

@NiKiZe pinning is a blocking operation, it fetches the data while holding the pin lock to ensure a garbage collection doesnt come along and wipe out the transfer progress. Because of this, while one thing is being pinned, another can't be pinned in the meantime.

We have plans on improving this moving forward

@Stebalien
Copy link
Member

The pin lock is a read-write lock. This shouldn't be an issue (and I can't reproduce). The bug in question was reported before the pin lock was even introduced.

@Stebalien
Copy link
Member

@whyrusleeping pointed out that there is a different lock.

@NiKiZe
Copy link

NiKiZe commented Jul 23, 2018

My bad, pinning with /ipns/ seems to work, just (as explained why above) seemingly unresponsive, Thanks and sorry for the noise. (Looking forward to the ability to pin ipns and have it auto update)

@bbigras
Copy link

bbigras commented Jul 20, 2021

Any progress on this?

@tennox
Copy link

tennox commented Jan 10, 2024

shy bump would very much appreciate this 😅
Or is it also a use-case that is rather a "create your own service via boxo"?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/enhancement A net-new feature or improvement to an existing feature
Projects
None yet
Development

No branches or pull requests

10 participants