-
-
Save SleepTheGod/1976fe6d0c7d54dbbcef11d2a043865b to your computer and use it in GitHub Desktop.
IPFS w/ NFT.STORAGE
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
```bash | |
#!/bin/bash | |
# Script to install and initialize IPFS on WSL, and example usage of NFT.Storage API | |
set -e | |
echo "Step 1: Downloading IPFS v0.12.2..." | |
wget https://dist.ipfs.io/go-ipfs/v0.12.2/go-ipfs_v0.12.2_linux-amd64.tar.gz | |
echo "Step 2: Extracting IPFS archive..." | |
tar -xvzf go-ipfs_v0.12.2_linux-amd64.tar.gz | |
echo "Step 3: Installing IPFS..." | |
cd go-ipfs | |
sudo bash install.sh | |
cd .. | |
echo "Step 4: Initializing IPFS..." | |
ipfs init | |
echo "Step 5: Starting IPFS daemon in the background..." | |
ipfs daemon & | |
echo "To upload your NFT asset using NFT.Storage, run the following command:" | |
echo "" | |
echo "curl -X POST --data-binary @\"/path/to/your/nft-asset\" \\" | |
echo " -H \"Authorization: Bearer your-nft-storage-api-token\" \\" | |
echo " -H \"Content-Type: application/octet-stream\" \\" | |
echo " https://api.nft.storage/upload" | |
echo "" | |
echo "Replace '/path/to/your/nft-asset' and 'your-nft-storage-api-token' with your actual file path and API token." | |
``` |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment