Programming about NFT
- Working on storing NFT datas: owner, URI, identifier, etc.
- Working on connecting to metamask and https://nft.storage/
- Development of a user interface to facilitate file uploading
- Enable buying/selling NFT on contract
- User interface for buying/selling NFT
Before starting, please create an account on NFT Storage in order to store all the required metadata files.
Here is the solution diagram:
-
Run
ganache-cli -i 2022
to execute a local blockchain. Don't forget to import some private keys to MetaMask; -
In solidity/ directory, run
truffle migrate
in order to deploy the NFT smart contract in the blockchain; -
Move build/contracts/NFT.json into web/src/contracts/ directory;
-
In web/ directory, run
npm install
thennpm start
to execute the web server;
You are now able to use the web site and upload image. Resulting metadatas will be stored in nft.storage and its URI in the local blockchain.
In order to display all NFTs, web site calls all token ids stored in the blockchain in order to load all metadata and, hence, all image URL.