If you are new in the NFT universe, you should start with these articles:
- People are spending millions on NFTs. What? Why?
- Intro to Ethereum
- Transactions
- How to create an NFT
The steps bellow are part of this tutorial.
In this project we're using Alchemy, a blockchain developer platform and API that allows us to communicate with the Ethereum chain without having to run our own nodes.
If you don’t already have an Alchemy account, you can sign up for free here.
Once you’ve created an Alchemy account, you can generate an API key by creating an app. This will allow us to make requests to the Ropsten test network.
-
Navigate to the “Create App” page in your Alchemy Dashboard by hovering over “Apps” in the nav bar and clicking “Create App”
-
Name your app, offer a short description, select “Staging” for the Environment (used for your app bookkeeping), and choose “Ropsten” for your network.
-
Click “Create app” and that’s it! Your app should appear in the table below.
We need an Ethereum account to send and receive transactions. For this project, we’ll use Metamask, a virtual wallet in the browser used to manage your Ethereum account address.
You can download and create a Metamask account for free here. When you are creating an account, or if you already have an account, make sure to switch over to the “Ropsten Test Network” in the upper right (so that we’re not dealing with real money).
In order to deploy our smart contract to the test network, we’ll need some fake Eth. To get Eth you can go to the Ropsten faucet and enter your Ropsten account address, then click “Send Ropsten Eth.” You should see Eth in your Metamask account soon after!
Create a .env
based on .env.example
and add your Metamask private key and HTTP Alchemy API URL to it.
-
Follow these instructions to export your private key from Metamask
-
See below to get HTTP Alchemy API URL and copy it to your clipboard
You can use your favorite JavaScript package manager, for example:
yarn install
yarn compile-contracts
yarn deploy-contracts
You should then see something like:
Contract deployed to address: 0x81c587EB0fE773404c42c1d2666b5f557C470eED
You can go to the Ropsten etherscan and search for your contract address.
yarn dev
http://localhost:3000/api/mint-nft
Please check this guide.