Skip to content

Commit 24c44c1

Browse files
authored
Merge pull request #10321 from opman129/dev
Updates to the Alchemy tutorials to use Sepolia Testnet in place of Goerli due to Goerli's deprecation soon
2 parents 1a35a38 + d009161 commit 24c44c1

File tree

8 files changed

+24
-24
lines changed

8 files changed

+24
-24
lines changed

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -109,9 +109,9 @@ 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://goerli.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://sepolia.etherscan.io/) by looking up the address you used to deploy the contract.
113113

114-
![View your contract address on Etherscan](./viewContractEtherscan.png)
114+
![View your contract address on Etherscan](./view-contract-etherscan.png)
115115

116116
In the above example, our contract address is 0x5a738a5c5fe46a1fd5ee7dd7e38f722e2aef7778.
117117

@@ -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-goerli.g.alchemy.com/v2/your-api-key"
133+
API_URL = "https://eth-sepolia.g.alchemy.com/v2/your-api-key"
134134
PRIVATE_KEY = "your-private-account-address"
135135
PUBLIC_KEY = "your-public-account-address"
136136
```
@@ -316,9 +316,9 @@ Now, run `node scripts/mint-nft.js` to deploy your NFT. After a couple of second
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 [Goerli Etherscan](https://goerli.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 [Sepolia Etherscan](https://sepolia.etherscan.io/) and search for your transaction hash.
320320

321-
![View your NFT transaction hash on Etherscan](./viewNFTEtherscan.png)_View your NFT transaction hash on Etherscan_
321+
![View your NFT transaction hash on Etherscan](./view-nft-etherscan.png)_View your NFT transaction hash on Etherscan_
322322

323323
And that’s it! You’ve now deployed AND minted with a NFT on the Ethereum blockchain <Emoji text=":money_mouth_face:" size={1} />
324324

Loading
Loading

src/content/developers/tutorials/how-to-view-nft-in-metamask/index.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,15 @@ Congrats! You’ve made it to the shortest and simplest part of our NFT tutorial
1414

1515
As a prerequisite, you should already have MetaMask on mobile installed, and it should include the account to which you minted your NFT — you can get the app for free on [iOS](https://apps.apple.com/us/app/metamask-blockchain-wallet/id1438144202) or [Android](https://play.google.com/store/apps/details?id=io.metamask&hl=en_US&gl=US).
1616

17-
## Step 1: Set your network to Goerli {#set-network-to-goerli}
17+
## Step 1: Set your network to Sepolia {#set-network-to-sepolia}
1818

19-
At the top of the app, press the “Wallet” button, after which you’ll be prompted to select a network. As our NFT was minted on the Goerli network, you’ll want to select Goerli as your network.
19+
At the top of the app, press the “Wallet” button, after which you’ll be prompted to select a network. As our NFT was minted on the Sepolia network, you’ll want to select Sepolia as your network.
2020

21-
![How to set Goerli as your network on MetaMask Mobile](./goerliMetamask.gif)
21+
![How to set Sepolia as your network on MetaMask Mobile](./goerliMetamask.gif)
2222

2323
## Step 2: Add your collectable to MetaMask {#add-nft-to-metamask}
2424

25-
Once you’re on the Goerli network, select the “Collectibles” tab on the right and add the NFT smart contract address and the ERC-721 token ID of your NFT — which you should be able to find on Etherscan based on the transaction hash from your NFT deployed in Part II of our tutorial.
25+
Once you’re on the Sepolia network, select the “Collectibles” tab on the right and add the NFT smart contract address and the ERC-721 token ID of your NFT — which you should be able to find on Etherscan based on the transaction hash from your NFT deployed in Part II of our tutorial.
2626

2727
![How to find your transaction hash and ERC-721 token ID](./findNFTEtherscan.png)
2828

src/content/developers/tutorials/how-to-write-and-deploy-an-nft/index.md

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ With NFTs bringing blockchain into the public eye, now is an excellent opportuni
1212

1313
Alchemy is extremely proud to be powering the biggest names in the NFT space, including Makersplace (recently set a record digital artwork sale at Christie’s for $69 Million), Dapper Labs (creators of NBA Top Shot & Crypto Kitties), OpenSea (the world’s largest NFT marketplace), Zora, Super Rare, NFTfi, Foundation, Enjin, Origin Protocol, Immutable, and more.
1414

15-
In this tutorial, we will walk through creating and deploying an ERC-721 smart contract on the Goerli test network using [MetaMask](https://metamask.io/), [Solidity](https://docs.soliditylang.org/en/v0.8.0/), [Hardhat](https://hardhat.org/), [Pinata](https://pinata.cloud/) and [Alchemy](https://alchemy.com/signup/eth) (don’t fret if you don’t understand what any of this means yet — we will explain it!).
15+
In this tutorial, we will walk through creating and deploying an ERC-721 smart contract on the Sepolia test network using [MetaMask](https://metamask.io/), [Solidity](https://docs.soliditylang.org/en/v0.8.0/), [Hardhat](https://hardhat.org/), [Pinata](https://pinata.cloud/) and [Alchemy](https://alchemy.com/signup/eth) (don’t fret if you don’t understand what any of this means yet — we will explain it!).
1616

1717
In Part 2 of this tutorial we’ll go through how we can use our smart contract to mint an NFT, and in Part 3 we’ll explain how to view your NFT on MetaMask.
1818

@@ -26,29 +26,29 @@ In this tutorial, we’ll also take advantage of Alchemy’s developer tools for
2626

2727
## Step 2: Create your app (and API key) {#make-api-key}
2828

29-
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 Goerli test network. Check out [this guide](https://docs.alchemyapi.io/guides/choosing-a-network) if you’re curious to learn more about test networks.
29+
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 Sepolia test network. Check out [this guide](https://docs.alchemyapi.io/guides/choosing-a-network) if you’re curious to learn more about test networks.
3030

3131
1. Navigate to the “Create App” page in your Alchemy Dashboard by hovering over “Apps” in the nav bar and clicking “Create App”
3232

3333
![Create your app](./create-your-app.png)
3434

35-
2. Name your app (we chose “My First NFT!”), offer a short description, select “Ethereum” for the Chain, and choose “Goerli” for your network. Since the merge the other testnets have been deprecated.
35+
2. Name your app (we chose “My First NFT!”), offer a short description, select “Ethereum” for the Chain, and choose “Sepolia” for your network. Since the merge the other testnets have been deprecated.
3636

37-
![Configure and publish your app](./configure-and-publish-your-app.png)
37+
![Configure and publish your app](./alchemy-explorer-sepolia.png)
3838

3939
3. Click “Create app” and that’s it! Your app should appear in the table below.
4040

4141
## Step 3: Create an Ethereum account (address) {#create-eth-address}
4242

4343
We need an Ethereum account to send and receive transactions. For this tutorial, we’ll use MetaMask, a virtual wallet in the browser used to manage your Ethereum account address. If you want to understand more about how transactions on Ethereum work, check out [this page](/developers/docs/transactions/) from the Ethereum foundation.
4444

45-
You can download and create a MetaMask account for free [here](https://metamask.io/download.html). When you are creating an account, or if you already have an account, make sure to switch over to the “Goerli Test Network” in the upper right (so that we’re not dealing with real money).
45+
You can download and create a MetaMask account for free [here](https://metamask.io/download.html). When you are creating an account, or if you already have an account, make sure to switch over to the “Sepolia Test Network” in the upper right (so that we’re not dealing with real money).
4646

47-
![Set Goerli as your network](./metamask-goerli.png)
47+
![Set Sepolia as your network](./metamask-goerli.png)
4848

4949
## Step 4: Add ether from a Faucet {#step-4-add-ether-from-a-faucet}
5050

51-
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 [Goerli Faucet](https://goerlifaucet.com/) hosted by Alchemy, log in and enter your account address, click “Send Me ETH”. You should see ETH in your MetaMask account soon after!
51+
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 [Sepolia Faucet](https://sepoliafaucet.com/) hosted by Alchemy, log in and enter your account address, click “Send Me ETH”. You should see ETH in your MetaMask account soon after!
5252

5353
## Step 5: Check your Balance {#check-balance}
5454

@@ -230,7 +230,7 @@ Then, create a `.env` file in the root directory of our project, and add your Me
230230

231231
Your `.env` should now look like this:
232232

233-
API_URL="https://eth-goerli.g.alchemy.com/v2/your-api-key"
233+
API_URL="https://eth-sepolia.g.alchemy.com/v2/your-api-key"
234234
PRIVATE_KEY="your-metamask-private-key"
235235

236236
To actually connect these to our code, we’ll reference these variables in our hardhat.config.js file in step 13.
@@ -263,10 +263,10 @@ Update your hardhat.config.js to look like this:
263263
const { API_URL, PRIVATE_KEY } = process.env;
264264
module.exports = {
265265
solidity: "0.8.1",
266-
defaultNetwork: "goerli",
266+
defaultNetwork: "sepolia",
267267
networks: {
268268
hardhat: {},
269-
goerli: {
269+
sepolia: {
270270
url: API_URL,
271271
accounts: [`0x${PRIVATE_KEY}`]
272272
}
@@ -321,26 +321,26 @@ Calling deploy() on a ContractFactory will start the deployment, and return a Pr
321321

322322
We’re finally ready to deploy our smart contract! Navigate back to the root of your project directory, and in the command line run:
323323

324-
npx hardhat --network goerli run scripts/deploy.js
324+
npx hardhat --network sepolia run scripts/deploy.js
325325

326326
You should then see something like:
327327

328328
Contract deployed to address: 0x4C5266cCc4b3F426965d2f51b6D910325a0E7650
329329

330-
If we go to the [Goerli etherscan](https://goerli.etherscan.io/) and search for our contract address we should be able to see that it has been deployed successfully. If you can't see it immediately, please wait a while as it can take some time. The transaction will look something like this:
330+
If we go to the [Sepolia etherscan](https://sepolia.etherscan.io/) and search for our contract address we should be able to see that it has been deployed successfully. If you can't see it immediately, please wait a while as it can take some time. The transaction will look something like this:
331331

332-
![View your transaction address on Etherscan](./etherscan-goerli-contract-creation.png)
332+
![View your transaction address on Etherscan](./etherscan-sepoila-contract-creation.png)
333333

334334
The From address should match your MetaMask account address and the To address will say “Contract Creation.” If we click into the transaction, we’ll see our contract address in the To field:
335335

336-
![View your contract address on Etherscan](./etherscan-goerli-tx-details.png)
336+
![View your contract address on Etherscan](./etherscan-sepolia-tx-details.png)
337337

338338
Yasssss! You just deployed your NFT smart contract to the Ethereum (testnet) chain!
339339

340340
To understand what’s going on under the hood, let’s navigate to the Explorer tab in our [Alchemy dashboard](https://dashboard.alchemyapi.io/explorer). If you have multiple Alchemy apps make sure to filter by app and select “MyNFT”.
341341

342342
![View calls made “under the hood” with Alchemy’s Explorer Dashboard](./alchemy-explorer-goerli.png)
343343

344-
Here you’ll see a handful of JSON-RPC calls that Hardhat/Ethers made under the hood for us when we called the .deploy() function. Two important ones to call out here are [eth_sendRawTransaction](/developers/docs/apis/json-rpc/#eth_sendrawtransaction), which is the request to actually write our smart contract onto the Goerli chain, and [eth_getTransactionByHash](/developers/docs/apis/json-rpc/#eth_gettransactionbyhash) which is a request to read information about our transaction given the hash (a typical pattern when sending transactions). To learn more about sending transactions, check out this tutorial on [sending transactions using Web3](/developers/tutorials/sending-transactions-using-web3-and-alchemy/).
344+
Here you’ll see a handful of JSON-RPC calls that Hardhat/Ethers made under the hood for us when we called the .deploy() function. Two important ones to call out here are [eth_sendRawTransaction](/developers/docs/apis/json-rpc/#eth_sendrawtransaction), which is the request to actually write our smart contract onto the Sepolia chain, and [eth_getTransactionByHash](/developers/docs/apis/json-rpc/#eth_gettransactionbyhash) which is a request to read information about our transaction given the hash (a typical pattern when sending transactions). To learn more about sending transactions, check out this tutorial on [sending transactions using Web3](/developers/tutorials/sending-transactions-using-web3-and-alchemy/).
345345

346346
That’s all for Part 1 of this tutorial. In [Part 2, we’ll actually interact with our smart contract by minting an NFT](/developers/tutorials/how-to-mint-an-nft/), and in [Part 3 we’ll show you how to view your NFT in your Ethereum wallet](/developers/tutorials/how-to-view-nft-in-metamask/)!

0 commit comments

Comments
 (0)