2

I am running an IPFS cluster in the cloud and I would like to pin about 100k hashes of objects from the network.

I'm currently iterating through the list using the ipfs pin add <hash>, but it's taking forever (as some hashes can't be found immediately or take long time to be found)

Is there a way to request a IPFS node/cluster to pin add hashes in batches? A best effort approach would suffice as I know some hashes may have disappeared or not be reacheable anymore.

Is there a way to achieve this quickly?

smitop
  • 4,770
  • 2
  • 20
  • 53
Giovanni G
  • 73
  • 1
  • 8
  • https://docs.ipfs.io/reference/cli/#ipfs-pin-add - writes "Path to object(s) to be pinned.", can't you put several hashes as parameters, or is that still too slow? – Caramiriel Dec 17 '21 at 13:47

1 Answers1

2

You can stream a list of files to ipfs pin add on STDIN. Here, /path/to/hashes is a file with one IPFS hash on each line:

ipfs pin add < /path/to/hashes

You can also pass the --progress flag to see the current pinning progress.

smitop
  • 4,770
  • 2
  • 20
  • 53
  • Thanks, this is really an elegant and neat way, do you know if there is a timeout of some sorts? Say one of the hashes can't be found, will it get stuck there forever? – Giovanni G Dec 29 '21 at 09:40