Skip to content

Node.js API for NFT collections supporting diverse features

Notifications You must be signed in to change notification settings

FilosofiaCodigo/nft-collection-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Sep 29, 2022
6250f58 Β· Sep 29, 2022

History

45 Commits
Sep 5, 2021
Sep 29, 2022
Mar 16, 2022
Sep 6, 2021
Nov 7, 2021
Nov 7, 2021
Nov 7, 2021
Mar 16, 2022
Nov 7, 2021
Nov 7, 2021

Repository files navigation

NFT Collection API πŸ–ΌοΈ

JSON API that servers ERC-721 compatible metadata for an NFT collection on the blockchain.

Features πŸ‘€

Feature Supported
MIT License βœ”
Hide non minted NFTs βœ”
Shuffle βœ”
Reveal βœ”
Handle none traits βœ”
IPFS βœ”
Google Cloud Storage βœ”

Dependencies βš’

npm install

Run πŸš€

Development mode

npm start

Production mode commands

npm i -g pm2
pm2 start scripts/start.js
pm2 kill
pm2 list
pm2 restart
pm2 stop [ID]

Auxiliary Scripts πŸ‘©β€βš•οΈ

  • npm run shuffle: randomizes the metadata to make the minting process exciting
  • npm run upload_images_update: uploads images to IPFS
  • npm run upload_images_ipfs: uploads images to IPFS
  • npm run upload_images_gcs: uploads images to Google Cloud Storage. Just make sure you have your gcs.json keyfile on the project directory
  • npm run remove_none_traits: removes all traits marked as "none" to make the metadata rarity.tools friendly

Checklist πŸ“

Make sure you follow all these steps when launching this API:

  1. Upload this project to a linux virtual machine on the cloud (digital ocean, amazon web services etc..)
  2. Replace your contract ABI ./Contract.json
  3. Replace your un revealed image on ./unrevealed/image.png
  4. Set the variables on the top of scripts/start.js, keep the IS_REVEALED variable set to false to start the server with unrevealed mode
  5. Start the server with npm start
  6. Put all your images and metadata on ./images/ and ./metadata/ respectively
  • Consider using FTP or scp, for example: scp -r [email protected]:/path/to/remote/source /path/to/local/destination
  1. run npm run shuffle
  2. run npm run remove_none_traits if needed
  3. Upload your images, choose between CGS or IPFS
  • IPFS
    • Run npm run upload_images_ipfs
  • Google Cloud Services
    • Put your gcs.json keyfile on this project directory
    • Run npm run upload_images_gcs
    • Install the google cloud console and run this to open the files in the browser instead of downloading them by downloading the Google Cloud SDK and running this: gsutil -m setmeta -h "Content-Type: image/png" -h "Content-Disposition: inline;" gs://YOURBUCKETNAME/*. Remember to set YOURBUCKETNAME.
  1. Once you want to reveal the Images and Metadata set the IS_REVEALED to true on scripts/start.js, stop and restart the server

Releases

No releases published

Packages

No packages published