How to add a list of CIDs to an IPFS node

698 views Asked by At

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.

1

There are 1 answers

2
Discordian On

You can add multiple CIDs to your node simply by pinning them to your node. To quote the Kubo docs:

USAGE
  ipfs pin add <ipfs-path>... - Pin objects to local storage.

SYNOPSIS
  ipfs pin add [--recursive=false] [--progress] [--] <ipfs-path>...

ARGUMENTS

  <ipfs-path>... - Path to object(s) to be pinned.

OPTIONS

  -r, --recursive  bool - Recursively pin the object linked to by the specified
                          object(s). Default: true.
  --progress       bool - Show progress.

DESCRIPTION

  Stores an IPFS object(s) from a given path locally to disk.

For example:

ipfs pin add QmNsXkTWPv9uNHJGwc4DHM285cipEbDNwoeHiihYsckanu QmQ2KWk5mY4LToqyMoebwMzKLavCBDAyo9B7aZTkeBMy1w