Skip to content

Latest commit

 

History

History
70 lines (52 loc) · 2.65 KB

README.md

File metadata and controls

70 lines (52 loc) · 2.65 KB

nft.storage tools

Tools for working with nft.storage.

Usage

  1. Ensure git and Node.js are installed.
  2. Clone this repo:
    git clone https://github.com/nftstorage/nft.storage-tools.git
    cd nft.storage-tools
  3. Install dependencies:
    npm install
  4. Sign up for an account on nft.storage and create an API key.
  5. Create a .env file in the project root and add the following content:
    ENDPOINT="https://api.nft.storage"
    API_KEY="NFT_STORAGE_API_KEY"
  6. Choose a script from the root to run (usage instructions can be found at the top of the file) or instructions for some common tasks can be found below.

Advanced (nft.storage developers only)

To talk directly to the nft.storage IPFS Cluster using the cluster*.js scripts, add the following to the .env file:

CLUSTER_URL="https://CLUSTER_DOMAIN/api/"
CLUSTER_HEADERS='{"Authorization":"Basic CLUSTER_BASIC_AUTH_KEY"}'

Tasks

Import a list of CIDs

You have a list of CIDs for content you have stored in IPFS already and would like to import that content into nft.storage.

  1. Export CIDs to a newline delimited file. For example, you could use the following command:
    ipfs pin ls -q > pinlist.txt
  2. Follow the usage instructions above until the last step.
  3. Run the import script:
    node import.js pinlist.txt
    Note: if you need to stop the script, you can resume from a particular line number by passing --start 1000 (to start from line 1,000).

After nft.storage receives all your CIDs, it'll start to transfer data from peers that already have the content. This may take a long time for long lists of CIDs and may fail if the content cannot be found on the IPFS network. You can check the status of the CIDs you imported.

Check pinning status of CID list

You have previously imported a CID list and want to check to see progress of the pinning operations.

  1. Follow instructions for importing a list of CIDs.
  2. Run the status checker script:
    node status.js pinlist.txt
    Note: failed and unknown CIDs are shown after all CIDs have been queried. These can be re-imported to attempt recovery.

Contributing

Feel free to join in. All welcome. Open an issue!

License

Dual-licensed under MIT + Apache 2.0