OpenSea NFT space with GlacierDB
The NFT space is growing at a rapid pace today, and Glacier will be one of the most professional and friendly database protocols used to store NFT metadata as the metadata of NFT is also in the NoSQL data structure. NFT will be the most important user scenario and Glacier will expand the adoption in the NFT space first.
In this tutorial, we introduce how to build a serverless NFT dapp on the Glacier.
Concepts
Before we follow the quickstart, you'd have a look at the basic concept. Here we reference some core concepts for you
- Collection:
Collection
is like a table, which is the same concept inMongoDB
. It is used to store entity data records. - Document:
Document
is an entity data in anCollection
- NFT721: https://docs.openzeppelin.com/contracts/5.x/erc721
- NFT1155: https://docs.openzeppelin.com/contracts/5.x/erc1155
- Opensea Metadata standard: https://docs.opensea.io/docs/metadata-standards
Prerequisites
- Glacier GreenField Endpoint: https://greenfield.onebitdev.com/glacier-gateway/
- Glacier SDK NPM: @glacier-network/client
- Deno Fresh: https://fresh.deno.dev/
- Deno Deploy: https://deno.com/deploy
- Demo wallet: create a new one that only for test purpose!
NFT Space Design
We have developed two serverless services for NFT spaces for demo purposes. You can explore the online demo here or deploy the apps yourself:
- NFTGateway: Serves a
Document
as an NFT metadata URI, rendering a binaryDocument.Field
to an NFT Image. - NFTMint: A playground that helps users to Mint an
Collection
NFT1155.
Deploy Apps
- Deploy NFT1155 Contract: codebase
npx hardhat run scripts/deploy.js --network opbnbtestnet
- Deploy NFTGateway: codebase
# dev
deno task start
# Build:
deno task build
# Deploy:
deployctl deploy --project=demo-gw --prod main.ts
- Deploy NFTMint: codebase
# dev
deno task start
# Build:
deno task build
# Deploy:
deployctl deploy --project=demo-mint --prod main.ts
Deploy NFTUI: codebase
src/config.ts
- apiGateway:
your nftmint gateway
- apiGateway:
pnpm install
pnpm dev