Alchemy: How to Create and Mint an NFT using Filebase
Learn how to create and mint an NFT using Filebase and Alchemy.
1. First, we need an image to use as an NFT. We’ll start by uploading an image to Filebase for us to use.
2. Select ‘Buckets’ from the left side bar menu, or navigate to console.filebase.com/buckets.

3. Enter a bucket name and choose the IPFS storage network to create the bucket.

4. Next, select the bucket from your list of buckets, then select ‘Upload’ in the top right corner to upload an image file.

5. Select an image to be uploaded.

6. You can view the object’s IPFS CID in the CID column, or you can click on your uploaded object to display the metadata for the object, which includes the IPFS CID.

8. From the Alchemy dashboard, we need to create an app.

9. Create a new app. For our example, we called our app NFTs.

10. Next, we need an Ethereum wallet.
11. Once you have a Metamask account, change the network to the ‘Göerli Test Network’ in the top right corner.
12. Next, head over to the Göerli Faucet and send your wallet some fake ETH to use:

13. Next, let’s initialize our project.
14. Now, we’ll use Node.js and npm for our project.
15. Once installed, run the command:

16. Now let’s install Hardhat, a development environment for us to deploy and test our Ethereum app on.
17. Let’s create the Hardhat project now.

18. From this menu prompt, select ‘Create an empty hardhat.config.js’.
19. Next we’ll create two more folders inside our project directory to help keep it organized as we add more content.
20. Now let’s write a piece of code for creating a smart contract.
21. Next, install the OpenZeppelin contracts library into the contracts folder. To do this, run the following command:
22. Now let’s connect Metamask and Alchemy to our NFT project.
23. Then, create a file called .env and add your Alchemy API URL and Metamask private key to this file.
.env and add your Alchemy API URL and Metamask private key to this file.24. Next, install the Ether.js library into your project directory using the following command:
25. We need to update the hardhat.config.js file to reflect the dependencies we’ve installed.
hardhat.config.js file to reflect the dependencies we’ve installed.26. Our contract is ready to be compiled. Compile it with the following command:
27. Now we need a deploy script to deploy the contract.
28. It’s time to deploy our smart contract.
29. Now that we have deployed a contract, let’s move onto minting the actual NFT.
30. Next, create a new file in the scripts directory called mint-nft.js that has the following content:
mint-nft.js that has the following content:31. We need to configure the metadata for our NFT.
32. After you’ve saved the metadata file, upload it to your Filebase IPFS bucket following the same process we used to upload the NFT image file at the beginning of this guide.
33. Head back to Etherscan where we confirmed that our contract was successfully created and copy down the contract’s address.

34. Add the following lines to your mint-nft.js file, replacing the contract address with the address you just copied from Etherscan.
mint-nft.js file, replacing the contract address with the address you just copied from Etherscan.35. Open your .env file and add your public Metamask wallet account address to it with the following line:
.env file and add your public Metamask wallet account address to it with the following line:36. Add the following lines to your mint-nft.js script:
mint-nft.js script:37. Run the mint-nft script to deploy and mint your NFT:
mint-nft script to deploy and mint your NFT:
Last updated