https://github.com/subvisual/detris-upload-ipfs
Repository with a Node script to upload Detris data to IPFS
https://github.com/subvisual/detris-upload-ipfs
Last synced: 2 months ago
JSON representation
Repository with a Node script to upload Detris data to IPFS
- Host: GitHub
- URL: https://github.com/subvisual/detris-upload-ipfs
- Owner: subvisual
- Created: 2022-05-12T12:54:16.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2022-08-11T09:00:30.000Z (over 3 years ago)
- Last Synced: 2024-12-30T10:44:21.563Z (over 1 year ago)
- Language: JavaScript
- Size: 37.1 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# detris-upload-ipfs
Repository with a Node script to upload Detris data to IPFS using NFT.Storage.
## Setup
Run
```
asdf install
yarn
cp .envrc.sample .envrc
```
And then setup the `.envrc` with the correct variables.
## Run the script
This script takes as input the path for a base folder that contains a structure of types of attributes we want to have, and each folder will have the compiled code for that Detris version and a preview image called `preview.png`.
First you need to create a structure of folders that matches the path under `detrisMetadata`. The script will look inside each of them and upload it's content to IPFS. Example:
```
├── border
│ ├── detris
│ │ ├── ...
│ │ └── preview.png
│ ├── palette76
│ │ ├── ...
│ │ └── preview.png
│ └── palette7998
│ ├── ...
│ └── preview.png
├── border pieces
│ ├── detris
│ │ ├── ...
│ │ └── preview.png
│ ├── palette76
│ │ ├── ...
│ │ └── preview.png
│ └── palette7998
│ ├── ...
│ └── preview.png
├── inverted
│ └── detris
│ ├── ...
│ └── preview.png
├── neon
│ ├── detris
│ │ ├── ...
│ │ └── preview.png
│ ├── palette76
│ │ ├── ...
│ │ └── preview.png
│ └── palette7998
│ ├── ...
│ └── preview.png
├── single
│ └── detris
│ ├── ...
│ └── preview.png
├── solid
│ ├── detris
│ │ ├── ...
│ │ └── preview.png
│ ├── palette76
│ │ ├── ...
│ │ └── preview.png
│ └── palette7998
│ ├── ...
│ └── preview.png
└─
```
Then run `node --trace-warnings uploadToNFTStorage.mjs `
The final output represents the CID for the directory that holds the metadata for your collection. Opening `ipfs.io/ipfs/` should show you the contents of that directory.