How to add a list of CIDs to my IPFS node?

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.

1 Like

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.

1 Like

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.

1 Like