Skip to content

Commit 34e4df5

Browse files
authored
Set Sepolia as default testnet instead of Goerli (#134)
1 parent 531d0a4 commit 34e4df5

6 files changed

Lines changed: 88 additions & 88 deletions

File tree

.env.example

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
PRIVATE_KEY="..."
2-
RPC_URL="https://goerli.infura.io/v3/..."
2+
RPC_URL="https://sepolia.infura.io/v3/..."
33
ETHERSCAN_API_KEY="....."

README.md

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
- [Deploying Contracts](#deploying-contracts)
1818
- [Run a Local Network](#run-a-local-network)
1919
- [Using a Testnet or Live Network (like Mainnet or Polygon)](#using-a-testnet-or-live-network-like-mainnet-or-polygon)
20-
- [Goerli Ethereum Testnet Setup](#goerli-ethereum-testnet-setup)
20+
- [Sepolia Ethereum Testnet Setup](#sepolia-ethereum-testnet-setup)
2121
- [Test](#test)
2222
- [Interacting with Deployed Contracts](#interacting-with-deployed-contracts)
2323
- [Chainlink Price Feeds](#chainlink-price-feeds)
@@ -125,13 +125,13 @@ truffle migrate --network ganache
125125

126126
To interact with a live or test network, you will need ETH and LINK token by following these steps:
127127

128-
1. Get some Goerli Testnet ETH and LINK
128+
1. Get some Sepolia Testnet ETH and LINK
129129

130130
Head over to the [Chainlink faucets](https://faucets.chain.link/) and get some ETH and LINK. Please follow [the chainlink documentation](https://docs.chain.link/docs/acquire-link/) if unfamiliar.
131131

132132
4. Create VRF V2 subscription
133133

134-
Head over to [VRF Subscription Page](https://vrf.chain.link/goerli) and create the new subscription. Save your subscription ID and place it in your `helper-truffle-config.js` under `subId`.
134+
Head over to [VRF Subscription Page](https://vrf.chain.link/sepolia) and create the new subscription. Save your subscription ID and place it in your `helper-truffle-config.js` under `subId`.
135135

136136
### Truffle Dashboard
137137

@@ -153,15 +153,15 @@ In some cases, you might want your transactions to be automatically signed. In w
153153
2. A private key
154154
3. ETH & LINK token (either testnet or real)
155155

156-
Let's look at an example of setting these up using the Goerli testnet.
156+
Let's look at an example of setting these up using the Sepolia testnet.
157157

158-
### Goerli Ethereum Testnet Setup
158+
### Sepolia Ethereum Testnet Setup
159159

160160
First, we will need to set environment variables. We can do so by setting them in our `.env` file (create it if it's not there). You can also read more about [environment variables](https://www.twilio.com/blog/2017/01/how-to-set-environment-variables.html) from the linked twilio blog. You'll find a sample of what this file will look like in `.env.example`
161161

162162
> IMPORTANT: MAKE SURE YOU'D DONT EXPOSE THE KEYS YOU PUT IN THIS `.env` FILE. By that, I mean don't push them to a public repo, and please try to keep them keys you use in development not associated with any real funds.
163163
164-
1. Set your `GOERLI_RPC_URL` [environment variable.](https://www.twilio.com/blog/2017/01/how-to-set-environment-variables.html)
164+
1. Set your `SEPOLIA_RPC_URL` [environment variable.](https://www.twilio.com/blog/2017/01/how-to-set-environment-variables.html)
165165

166166
You can get one for free from [Infura](https://infura.io/), [Alchemy](https://www.alchemy.com/), or [Moralis](https://moralis.io/speedy-nodes/). This is your connection to the blockchain.
167167

@@ -177,23 +177,23 @@ Don't commit and push any changes to .env files that may contain sensitive infor
177177

178178
`.env` example:
179179
```
180-
GOERLI_RPC_URL='https://goerli.infura.io/v3/asdfasdfasdfasdf'
180+
SEPOLIA_RPC_URL='https://sepolia.infura.io/v3/asdfasdfasdfasdf'
181181
PRIVATE_KEY='abcdef'
182182
```
183183
`bash` example
184184
```
185-
export GOERLI_RPC_URL='https://goerli.infura.io/v3/asdfasdfasdfasdf'
185+
export SEPOLIA_RPC_URL='https://sepolia.infura.io/v3/asdfasdfasdfasdf'
186186
export PRIVATE_KEY='abcdef'
187187
```
188188

189189
For other networks like mainnet and polygon, you can use different environment variables for your RPC URL and your private key. See the `truffle-config.js` to learn more.
190190

191-
Uncomment the `goerli` network in your `truffle-config`. You should now be all setup! You can run any command and just pass the `--network goerli` now!
191+
Uncomment the `sepolia` network in your `truffle-config`. You should now be all setup! You can run any command and just pass the `--network sepolia` now!
192192

193193
To deploy all contracts:
194194

195195
```
196-
truffle migrate --network goerli
196+
truffle migrate --network sepolia
197197
```
198198

199199
# Test
@@ -252,7 +252,7 @@ You can deploy just the VRF Consumer with:
252252
truffle deploy --f 5 --to 5 --network <NETWORK>
253253
```
254254

255-
After deployment, you'll need to add your contract address to your subscription. Head over to [vrf.chain.link](https://vrf.chain.link/goerli/new) and add your consumer.
255+
After deployment, you'll need to add your contract address to your subscription. Head over to [vrf.chain.link](https://vrf.chain.link/sepolia/new) and add your consumer.
256256

257257
Then, run the following:
258258

@@ -268,7 +268,7 @@ The Keepers Consumer contract has one script, to check the upkeep. After deploym
268268
truffle exec scripts/checkUpkeep.js --network <NETWORK>
269269
```
270270

271-
To see everything in action, you'll want to set up a consumer at [keepers.chain.link](https://keepers.chain.link/goerli).
271+
To see everything in action, you'll want to set up a consumer at [keepers.chain.link](https://keepers.chain.link/sepolia).
272272

273273
## Verify on Etherscan
274274

@@ -280,7 +280,7 @@ truffle run verify <CONTRACT> --network <NETWORK>
280280
example:
281281

282282
```
283-
truffle run verify PriceConsumerV3 --network goerli
283+
truffle run verify PriceConsumerV3 --network sepolia
284284
```
285285

286286
# Contributing

helper-truffle-config.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,18 +15,18 @@ const networkConfig = {
1515
keepersUpdateInterval: "30",
1616
ethUsdPriceFeed: "0x5f4eC3Df9cbd43714FE2740f5E3616155c5b8419",
1717
},
18-
goerli: {
19-
chainId: "5",
20-
linkToken: "0x326C977E6efc84E512bB9C30f76E30c160eD06FB",
21-
ethUsdPriceFeed: "0xD4a33860578De61DBAbDc8BFdb98FD742fA7028e",
22-
keyHash: "0x79d3d8832d904592c0bf9818b621522c988bb8b0c05cdc3b15aea1b6e8db0c15",
23-
vrfCoordinator: "0x2Ca8E0C643bDe4C2E08ab1fA0da3401AdAD7734D",
24-
oracle: "0xCC79157eb46F5624204f47AB42b3906cAA40eaB7",
18+
sepolia: {
19+
chainId: "11155111",
20+
linkToken: "0x779877A7B0D9E8603169DdbD7836e478b4624789",
21+
ethUsdPriceFeed: "0x694AA1769357215DE4FAC081bf1f309aDC325306",
22+
keyHash: "0x474e34a077df58807dbe9c96d3c009b23b3c6d0cce433e59bbf5b34f823bc56c",
23+
vrfCoordinator: "0x8103B0A8A00be2DDC778e6e7eaa21791Cd364625",
24+
oracle: "0x6090149792dAAeE9D1D568c9f9a6F6B46AA29eFD",
2525
jobId: "ca98366cc7314957b8c012c72f05aeeb",
2626
fee: "100000000000000000",
2727
fundAmount: "100000000000000000", // 0.1
2828
keepersUpdateInterval: "30",
29-
subId: "52", // add your subscription Id here!
29+
subId: "777", // add your subscription Id here!
3030
},
3131
goerli: {
3232
chainId: "5",

kit.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{
22
"manifestVersion": "0.2.0",
3-
"message": "Run tests: yarn truffle test\nCompile contracts: yarn truffle compile\nMigrate to development network: yarn truffle migrate\nMigrate to goerli network: yarn truffle migrate --network goerli",
3+
"message": "Run tests: yarn truffle test\nCompile contracts: yarn truffle compile\nMigrate to development network: yarn truffle migrate\nMigrate to sepolia network: yarn truffle migrate --network sepolia",
44
"files": ["evm-box", "unbox.sh"],
55
"hooks": {
6-
"post-unpack": "bash unbox.sh && rm unbox.sh && npm install"
6+
"post-unpack": "bash unbox.sh && rm unbox.sh && npm install"
77
}
8-
}
8+
}

truffle-box.json

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,23 @@
11
{
22
"ignore": [
3-
".git",
4-
".gitattributes",
5-
".githooks",
6-
".github",
7-
".gitignore",
8-
".nvmrc",
9-
"kit.json",
10-
"node_modules",
11-
"yarn.lock"
3+
".git",
4+
".gitattributes",
5+
".githooks",
6+
".github",
7+
".gitignore",
8+
".nvmrc",
9+
"kit.json",
10+
"node_modules",
11+
"yarn.lock"
1212
],
1313
"commands": {
14-
"Run tests": "yarn truffle test",
15-
"Compile contracts": "yarn truffle compile",
16-
"Migrate to development network": "yarn truffle migrate",
17-
"Migrate to goerli network": "yarn truffle migrate --network goerli",
18-
"IMPORTANT: Install dependencies": "yarn"
14+
"Run tests": "yarn truffle test",
15+
"Compile contracts": "yarn truffle compile",
16+
"Migrate to development network": "yarn truffle migrate",
17+
"Migrate to sepolia network": "yarn truffle migrate --network sepolia",
18+
"IMPORTANT: Install dependencies": "yarn"
1919
},
2020
"hooks": {
21-
"post-unpack": "bash unbox.sh && rm unbox.sh"
21+
"post-unpack": "bash unbox.sh && rm unbox.sh"
2222
}
23-
}
23+
}

truffle-config.js

Lines changed: 47 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -24,61 +24,61 @@ require("dotenv").config()
2424
const privateKeys = [process.env.PRIVATE_KEY]
2525
// These are the keys auto-generated from running `ganache -d`, which will create a deterministic wallet
2626
const ganachePrivateKeys = ["0x4f3edf983ac636a65a842ce7c78d9aa706d3b113bce9c46f30d7d21715b23b1d"]
27-
const GOERLI_RPC_URL = process.env.GOERLI_RPC_URL
27+
const SEPOLIA_RPC_URL = process.env.SEPOLIA_RPC_URL
2828
const ETHERSCAN_API_KEY = process.env.ETHERSCAN_API_KEY
2929

3030
module.exports = {
31-
/**
32-
* Networks define how you connect to your ethereum client and let you set the
33-
* defaults web3 uses to send transactions. If you don't specify one truffle
34-
* will spin up a development blockchain for you on port 9545 when you
35-
* run `develop` or `test`. You can ask a truffle command to use a specific
36-
* network from the command line, e.g
37-
*
38-
* $ truffle test --network <network-name>
39-
*/
31+
/**
32+
* Networks define how you connect to your ethereum client and let you set the
33+
* defaults web3 uses to send transactions. If you don't specify one truffle
34+
* will spin up a development blockchain for you on port 9545 when you
35+
* run `develop` or `test`. You can ask a truffle command to use a specific
36+
* network from the command line, e.g
37+
*
38+
* $ truffle test --network <network-name>
39+
*/
4040

41-
networks: {
42-
// There is a hidden "test" network that gets called when you run `truffle test`
43-
ganache: {
44-
provider: () => new HDWalletProvider(ganachePrivateKeys, "http://127.0.0.1:8545"),
45-
host: "127.0.0.1", // Localhost (default: none)
46-
port: 8545, // Standard Ethereum port (default: none)
47-
network_id: "*", // Any network (default: none)
48-
confirmations: 0,
49-
},
50-
51-
// Useful for deploying to a public network.
52-
// Note: It's important to wrap the provider as a function to ensure truffle uses a new provider every time.
53-
// goerli: {
54-
// provider: () => new HDWalletProvider(privateKeys, GOERLI_RPC_URL),
55-
// network_id: 5, // Goerli's id
56-
// confirmations: 1, // # of confirmations to wait between deployments. (default: 0)
57-
// timeoutBlocks: 200, // # of blocks before a deployment times out (minimum/default: 50)
58-
// skipDryRun: true, // Skip dry run before migrations? (default: false for public nets )
59-
// },
41+
networks: {
42+
// There is a hidden "test" network that gets called when you run `truffle test`
43+
ganache: {
44+
provider: () => new HDWalletProvider(ganachePrivateKeys, "http://127.0.0.1:8545"),
45+
host: "127.0.0.1", // Localhost (default: none)
46+
port: 8545, // Standard Ethereum port (default: none)
47+
network_id: "*", // Any network (default: none)
48+
confirmations: 0,
6049
},
6150

62-
// Set default mocha options here, use special reporters, etc.
63-
mocha: {
64-
timeout: 100000,
65-
},
51+
// Useful for deploying to a public network.
52+
// Note: It's important to wrap the provider as a function to ensure truffle uses a new provider every time.
53+
// sepolia: {
54+
// provider: () => new HDWalletProvider(privateKeys, SEPOLIA_RPC_URL),
55+
// network_id: 11155111, // Sepolia's id
56+
// confirmations: 1, // # of confirmations to wait between deployments. (default: 0)
57+
// timeoutBlocks: 200, // # of blocks before a deployment times out (minimum/default: 50)
58+
// skipDryRun: true, // Skip dry run before migrations? (default: false for public nets )
59+
// },
60+
},
6661

67-
plugins: ["truffle-plugin-verify"],
68-
api_keys: {
69-
etherscan: ETHERSCAN_API_KEY,
70-
},
62+
// Set default mocha options here, use special reporters, etc.
63+
mocha: {
64+
timeout: 100000,
65+
},
66+
67+
plugins: ["truffle-plugin-verify"],
68+
api_keys: {
69+
etherscan: ETHERSCAN_API_KEY,
70+
},
7171

72-
// Configure your compilers
73-
compilers: {
74-
solc: {
75-
version: "pragma", // Fetch exact version from solc-bin (default: truffle's version)
76-
settings: {
77-
optimizer: {
78-
enabled: false,
79-
runs: 200,
80-
},
81-
},
72+
// Configure your compilers
73+
compilers: {
74+
solc: {
75+
version: "pragma", // Fetch exact version from solc-bin (default: truffle's version)
76+
settings: {
77+
optimizer: {
78+
enabled: false,
79+
runs: 200,
8280
},
81+
},
8382
},
83+
},
8484
}

0 commit comments

Comments
 (0)