I have a list of CIDs (4,000 of them) that I uploaded to nft.storage and now I wish to import them to my own IPFS node. What is the easiest way to do this in bulk? I checked the ipfs add
command but seems like I can only add one file (not CID) at a time.
Create a script that calls āipfs pin addā for each CID on your list, it will get each ātreeā from the network and pin it locally. Now, if you have a CID that points to all your other CIDs, just pin that one instead.
Thanks so much. You mentioned " a CID that points to all your other CIDs" and I googled it but no joy. How could I achieve that? Any reference is appreciated.
Instead of uploading a bunch of separate files or folders 1 by 1, make 1 big folder containing all of them and upload that. Youāll get just 1 CID that contains it all, even if you later distribute separate CIDs for each discrete file/folder.
Iād process them one at a time using something like this, to read themā¦
Because if you try to run the ENTIRE āimportā (pinning) all one operation that seems sketchy to me. Something might go wrong, or run out of resources. Iād rather be doing them one at a time and also echoing each one on the command line to watch the progress.
Wait a second, how can we know if there exists a CID that points to the other CIDs? Second question, shouldnāt the IPFS Desktop support āmulti-importā instead of attacking things with scripts and workarounds? It seems a typical scenario (multiple CIDs). Have a nice weekend.
If you have the CID of the root, you can follow down all the way to the leaves simply by looking into each block and following the links. However, you cannot discover if another CID points to you.
Thatās a question for the implementers; I can only tell you what exists, not why something doesnāt exist. Sorry.