Skip to content

Commit 3b2aa55

Browse files
authored
Merge pull request #8212 from lancelot-c/patch-1
Update Parts 2 & 3 of NFT Tutorial Series: use Goerli
2 parents 4a9529a + d4d5fc1 commit 3b2aa55

File tree

12 files changed

+15
-15
lines changed

12 files changed

+15
-15
lines changed

src/content/developers/tutorials/how-to-mint-an-nft/index.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -73,11 +73,11 @@ Once you’ve created an account:
7373

7474
- Upload an image to Pinata — this will be the image asset for your NFT. Feel free to name the asset whatever you wish
7575

76-
- After you upload, you'll see the file info in the table on the "Files" page. You'll also see a CID column. You can copy the CID by clicking the copy button next to it. You can view your upload at: `https://gateway.pinata.cloud/ipfs/<CID>`. You can find the image we used on IPFS [here](https://gateway.pinata.cloud/ipfs/QmarPqdEuzh5RsWpyH2hZ3qSXBCzC5RyK3ZHnFkAsk7u2f), for example.
76+
- After you upload, you'll see the file info in the table on the "Files" page. You'll also see a CID column. You can copy the CID by clicking the copy button next to it. You can view your upload at: `https://gateway.pinata.cloud/ipfs/<CID>`. You can find the image we used on IPFS [here](https://gateway.pinata.cloud/ipfs/QmZdd5KYdCFApWn7eTZJ1qgJu18urJrP9Yh1TZcZrZxxB5), for example.
7777

7878
For the more visual learners, the steps above are summarized here:
7979

80-
![How to upload your image to Pinata](https://gateway.pinata.cloud/ipfs/Qmcdt5VezYzAJDBc4qN5JbANy5paFg9iKDjq8YksRvZhtL)
80+
![How to upload your image to Pinata](./instructionsPinata.gif)
8181

8282
Now, we’re going to want to upload one more document to Pinata. But before we do that, we need to create it!
8383

@@ -109,16 +109,16 @@ Once you’re done editing the JSON file, save it and upload it to Pinata, follo
109109

110110
## Step 5: Create an instance of your contract {#instance-contract}
111111

112-
Now, to interact with our contract, we need to create an instance of it in our code. To do so we’ll need our contract address which we can get from the deployment or [Etherscan](https://ropsten.etherscan.io/) by looking up the address you used to deploy the contract.
112+
Now, to interact with our contract, we need to create an instance of it in our code. To do so we’ll need our contract address which we can get from the deployment or [Etherscan](https://goerli.etherscan.io/) by looking up the address you used to deploy the contract.
113113

114114
![View your contract address on Etherscan](./viewContractEtherscan.png)
115115

116-
In the above example, our contract address is 0x81c587EB0fE773404c42c1d2666b5f557C470eED.
116+
In the above example, our contract address is 0x5a738a5c5fe46a1fd5ee7dd7e38f722e2aef7778.
117117

118118
Next we will use the Web3 [contract method](https://web3js.readthedocs.io/en/v1.2.0/web3-eth-contract.html?highlight=constructor#web3-eth-contract) to create our contract using the ABI and address. In your `mint-nft.js` file, add the following:
119119

120120
```js
121-
const contractAddress = "0x81c587EB0fE773404c42c1d2666b5f557C470eED"
121+
const contractAddress = "0x5a738a5c5fe46a1fd5ee7dd7e38f722e2aef7778"
122122

123123
const nftContract = new web3.eth.Contract(contract.abi, contractAddress)
124124
```
@@ -130,7 +130,7 @@ Now, in order to create and send transactions to the Ethereum chain, we’ll use
130130
Add your public key to your `.env` file — if you completed part 1 of the tutorial, our `.env` file should now look like this:
131131

132132
```js
133-
API_URL = "https://eth-ropsten.alchemyapi.io/v2/your-api-key"
133+
API_URL = "https://eth-goerli.g.alchemy.com/v2/your-api-key"
134134
PRIVATE_KEY = "your-private-account-address"
135135
PUBLIC_KEY = "your-public-account-address"
136136
```
@@ -167,7 +167,7 @@ Your `mint-nft.js` file should look like this now:
167167
const web3 = createAlchemyWeb3(API_URL);
168168

169169
const contract = require("../artifacts/contracts/MyNFT.sol/MyNFT.json");
170-
const contractAddress = "0x81c587EB0fE773404c42c1d2666b5f557C470eED";
170+
const contractAddress = "0x5a738a5c5fe46a1fd5ee7dd7e38f722e2aef7778";
171171
const nftContract = new web3.eth.Contract(contract.abi, contractAddress);
172172

173173
async function mintNFT(tokenURI) {
@@ -200,7 +200,7 @@ const { createAlchemyWeb3 } = require("@alch/alchemy-web3")
200200
const web3 = createAlchemyWeb3(API_URL)
201201

202202
const contract = require("../artifacts/contracts/MyNFT.sol/MyNFT.json")
203-
const contractAddress = "0x81c587EB0fE773404c42c1d2666b5f557C470eED"
203+
const contractAddress = "0x5a738a5c5fe46a1fd5ee7dd7e38f722e2aef7778"
204204
const nftContract = new web3.eth.Contract(contract.abi, contractAddress)
205205

206206
async function mintNFT(tokenURI) {
@@ -266,7 +266,7 @@ const { createAlchemyWeb3 } = require("@alch/alchemy-web3")
266266
const web3 = createAlchemyWeb3(API_URL)
267267

268268
const contract = require("../artifacts/contracts/MyNFT.sol/MyNFT.json")
269-
const contractAddress = "0x81c587EB0fE773404c42c1d2666b5f557C470eED"
269+
const contractAddress = "0x5a738a5c5fe46a1fd5ee7dd7e38f722e2aef7778"
270270
const nftContract = new web3.eth.Contract(contract.abi, contractAddress)
271271

272272
async function mintNFT(tokenURI) {
@@ -312,11 +312,11 @@ mintNFT("ipfs://QmYueiuRNmL4MiA2GwtVMm6ZagknXnSpQnB3z2gWbz36hP")
312312

313313
Now, run `node scripts/mint-nft.js` to deploy your NFT. After a couple of seconds, you should see a response like this in your terminal:
314314

315-
The hash of your transaction is: 0x10e5062309de0cd0be7edc92e8dbab191aa2791111c44274483fa766039e0e00
315+
The hash of your transaction is: 0x301791fdf492001fcd9d5e5b12f3aa1bbbea9a88ed24993a8ab2cdae2d06e1e8
316316

317317
Check Alchemy's Mempool to view the status of your transaction!
318318

319-
Next, visit your [Alchemy mempool](https://dashboard.alchemyapi.io/mempool) to see the status of your transaction (whether it’s pending, mined, or got dropped by the network). If your transaction got dropped, it’s also helpful to check [Ropsten Etherscan](https://ropsten.etherscan.io/) and search for your transaction hash.
319+
Next, visit your [Alchemy mempool](https://dashboard.alchemyapi.io/mempool) to see the status of your transaction (whether it’s pending, mined, or got dropped by the network). If your transaction got dropped, it’s also helpful to check [Goerli Etherscan](https://goerli.etherscan.io/) and search for your transaction hash.
320320

321321
![View your NFT transaction hash on Etherscan](./viewNFTEtherscan.png)_View your NFT transaction hash on Etherscan_
322322

Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading

0 commit comments

Comments
 (0)