-
-
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
IPNS pinning: ipfs name follow #4435
Comments
Is this only active when the command is active? I see two different commands here: Pinning
This command will create a new (permanent) pin that will "follow" this IPNS address while the daemon is active. Note: Use-cases: Mirroring, backup, offline-replication. Follow
Unlike the previous command, this "follow" would only remain active while the command is active. By default, unless Use-cases: Authenticated data streams, website "feeds". |
@Stebalien yeah your proposal sounds good too! |
I am not sure we need a behaviour that is only available while the command is active - do we really care all that much about seeing background resolutions displayed in the terminal? edit: of course it's not just human eyeballs consuming the output |
There is also the implicit relationship to ipns pubsub. |
Exactly. That's more for e.g., webapps.
I'd do both. Always use pubsub and occasionally check the DHT for updates (more frequently if we see updates through the DHT that we don't see through pubsub). |
An alternative could be allowing "pinning" of IPNS names, so that they are both automatically updated, the records republished by that node and the current IPFS object which is pointed to being automatically pinned as well. This would mean that there is no requirement to keep a command running. |
so the the |
I think I prefer the |
That's the first command I proposed.
No. Actually, it wouldn't even pin. That command would just print out the hash and then start fetching in the background. If you wanted a pin, you'd use
For the latest hash, you'd just resolve the IPNS name (which should use the cache). "Fully pinned" is a bit trickier. The second we get a new hash, we'd unpin the previous version and start pinning a new one. We could have a
Good point. I agree. |
I think this is duplicate of #1467? |
What a wonderful name! This upcoming feature looks very interesting. And do I understand correctly that "following" nodes will republish the last seen value of given name, even if the creator of that name (with its private key) disappears once? Will the new nodes be able to resolve a value of that name, if the "following" ones will be present in network? |
that's an interesting idea. |
This part feels like the sort of thing that might be best handled with IPRS involved somehow. |
Could we have most of this as a library independent from go-ipfs? A library that, given a libp2p host and an IPNS key(s) and some config, puts new value on a channel for consumption. It would be useful for cluster, and I think for other people. |
This would require extracting namesys, but can be done. |
Hi! Is there any news related to this issue? Termux has started to publish their packages via IPFS under Unfortunately, right now, it requires a fair share of scripting skills to get done. I do have something in Bash...#!/bin/bash
function update() {
local name="$1"
local ipns="$2"
printf "Updating \e[33m$name\e[0m...\n"
local oldIpfs="$(ipfs files stat --hash $name)"
local newIpfs="$(ipfs name resolve $ipns)"
ipfs pin update "$oldIpfs" "$newIpfs"
ipfs files rm -r $name
ipfs files cp "$newIpfs" $name
ipfs files stat $name
printf "\n"
}
update '/termux-stable' 'k51qzi5uqu5dg9vawh923wejqffxiu9bhqlze5f508msk0h7ylpac27fdgaskx' &
update '/termux-unstable' 'k51qzi5uqu5dj05z8mr958kwvrg7a0wqouj5nnoo5uqu1btnsljvpznfaav9nk' &
wait
echo 'Done.' But that's considerably harder to do in PowerShell Core...#Requires -PSEdition Core
$functions = {
function update($name, $ipns) {
Write-Host 'Updating ' -NoNewline
Write-Host "$name" -ForegroundColor Yellow -NoNewline
Write-Host '...'
$oldIpfs = $(ipfs files stat --hash $name)
$newIpfs = $(ipfs name resolve $ipns)
ipfs pin update $oldIpfs $newIpfs
ipfs files rm -r $name
ipfs files cp $newIpfs $name
ipfs files stat $name
Write-Host
}
}
Start-ThreadJob -InitializationScript $functions -ScriptBlock { update '/termux-stable' 'k51qzi5uqu5dg9vawh923wejqffxiu9bhqlze5f508msk0h7ylpac27fdgaskx' }
Start-ThreadJob -InitializationScript $functions -ScriptBlock { update '/termux-unstable' 'k51qzi5uqu5dj05z8mr958kwvrg7a0wqouj5nnoo5uqu1btnsljvpznfaav9nk' }
Get-Job | Wait-Job | Receive-Job
Write-Output 'Done.' Another problem is that it has to be executed periodically and that also requires a fair share of skills in More precisely, the workflow I'm looking for is something that can
|
This would be very nice to have. I'm working on an IPFS devgrant to create a protocol test suite for browsers and I need to have some test files as well as the entire suite pinned and available over IPNS. It's possible to do some hacky stuff to make it work, but first class support for I also saw @lidel mention that IPNS is a lot speedier now when pubsub is enabled, which would also make it easier for gateways to be reactive to updates instead of periodically polling. |
Hi! I'd also like to mention the importance of being able to pin a /ipns/some.domain.tld/ and have it automatically download new and updated files. My use case is being file mirror for a software project and without this functionality it is very difficult to keep the local mirror updated. |
You can use ipfs-cluster to follow one or several pins. I.e run a ipfs-cluster-service on one side and ipfs-cluster-follow on the "clients". https://cluster.ipfs.io/documentation/collaborative/ |
@hsanjuan You still need some scripting, but replace If the maintainer uses IPNS instead of IPFS Cluster, then there's no good reason to use IPFS Cluster yourself, unless you have like 4+ machines. |
Except it offers the feature that is being requested, which is to follow a pin or pinset. Please note that you don't need to run an actual cluster of Sharding is implemented in cluster but is patiently waiting on a feature in the IPFS pinning system to have it enabled #5133. |
This is quite similar to #1467 My use-case is the following: I have a document (website) that is updated through a CI system, running on the "cloud". TBH, I'm not sure if that would be the best way to go about it (I need to ensure the content is fully mirrored before shutting down the CI job, so I may need some communication with the IPFS servers anyway), but that seems one of the simplest. |
Perhaps you could poll findprovs to test that other nodes are mirroring? |
True. I actually wanted to edit this comment, as I think the real benefit here is that you don't have to share the private key with many servers, only with the initial publisher, which can be ephemeral. This could have security benefits. |
cc @vyzo
The text was updated successfully, but these errors were encountered: