Token-D
is a REST-API
based service designed to store metadata of an NFT. Traditionally, NFT metadata is stored off-chain, with the URI of the NFT linked to its contract. Often, this URI is generated using an off-chain storage provider service. With Token-D
, users gain direct access to this service, eliminating the need for third-party storage providers and enabling the use of custom storage servers.
- At First Clone The Repositiory
git clone https://github.com/mdasifahamed/Token-D-A-REST-API-For-Storing-Token-Metadata.git
- Then Install The Dependencies
npm i
- Ensure CouchDB is installed locally and create a database. Set the database name in app.js. Refer to CouchDB installation guide for setup.
const db = nano.use('ADD_YOUR_DB_NAME_HERE')
You Also Need To Configure The DB Connection With Your Creatdential at app.js
const nano = require('nano')(`http://YOUR_DB_USERNAME:YOUR_DB_PASSWORD@localhost:5984`)
- Then Run Server Using The Following Commands
npx nodemon app.js
- Use Any API Testing Clients For Testing The Path.
Key Features
/api/create/
: Create a Token URI to store NFT metadata, including files. Returns the Token URI endpoint./api/doc/single/:id
: Retrieve NFT metadata by a valid ID./api/media/view/:id
: View the default image of the NFT by a valid ID./api/doc/single/update/:id
: Update NFT metadata (useful for upgradable NFTs)./api/media/update/existing/attachment/:id
: Update the image of the NFT, replacing the existing image./api/media/add/attachments/:id
: Add additional images to an NFT./api/doc/list
: List all stored NFT metadata./api/media/all/:id
: List all image URLs associated with an NFT./api/media/view/:id/
:attachment: View a specific image of an NFT.
This service is tailored for private blockchains like Hyperledger-Fabric
. While most NFTs on public blockchains utilize IPFS
for decentralized storage, some artists prefer centralized servers for metadata storage
Javascript
WithNode.js
For Server Side Scripting.Express
For Rest-API.CouchDB
For Storing Data.
Any Kind Contribution And Recomendation That Enriches The Service Are Welcomed.