Skip to content

Commit

Permalink
Merge branch 'master' into add-typescript-peer-deps
Browse files Browse the repository at this point in the history
  • Loading branch information
alcuadrado committed Jun 8, 2022
2 parents 49db609 + 18f11e4 commit 6979ee6
Show file tree
Hide file tree
Showing 5 changed files with 42 additions and 32 deletions.
5 changes: 5 additions & 0 deletions .changeset/afraid-eyes-hug.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"hardhat": patch
---

Fix incorrect peerDependency
2 changes: 1 addition & 1 deletion .github/workflows/comment-on-linter-error.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
ref: "refs/pull/${{ github.event.number }}/merge"
- uses: actions/setup-node@v2
with:
node-version: 12
node-version: 14
cache: yarn
- name: Install
run: yarn --frozen-lockfile
Expand Down
11 changes: 11 additions & 0 deletions .github/workflows/pre-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ name: Pre-release tests
on:
push:
branches: [pre-release-testing-branch]
workflow_dispatch:

env:
RUN_ETHERSCAN_TESTS: yes
Expand Down Expand Up @@ -30,7 +31,17 @@ jobs:
run: yarn build
- name: lint
run: yarn lint
- name: Cache artifacts
uses: actions/cache@v2
with:
path: |
packages/hardhat-core/test/internal/hardhat-network/stack-traces/test-files/**/artifacts
key: hardhat-network-stack-traces-tests-${{ hashFiles('yarn.lock') }}-${{ hashFiles('packages/hardhat-core/test/internal/hardhat-network/stack-traces/test-files/**/*.sol') }}-${{ hashFiles('packages/hardhat-core/test/internal/hardhat-network/stack-traces/test-files/**/test.json') }}-${{ hashFiles('packages/hardhat-core/test/internal/hardhat-network/stack-traces/**/*.ts') }}
- name: test
env:
DO_NOT_SET_THIS_ENV_VAR____IS_HARDHAT_CI: true
FORCE_COLOR: 3
NODE_OPTIONS: "--max-old-space-size=4096"
run: yarn test
- name: Check dependency versions
run: node scripts/check-dependencies.js
31 changes: 13 additions & 18 deletions docs/src/content/tutorial/deploying-to-a-live-network.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

Once you're ready to share your dApp with other people what you may want to do is deploy to a live network. This way others can access an instance that's not running locally on your system.

There's the Ethereum network that deals with real money which is called "mainnet", and then there are other live networks that don't deal with real money but do mimic the real world scenario well, and can be used by others as a shared staging environment. These are called "testnets" and Ethereum has multiple ones: _Ropsten_, _Kovan_, _Rinkeby_ and _Goerli_. We recommend you deploy your contracts to the _Ropsten_ testnet.
There's the Ethereum network that deals with real money which is called "mainnet", and then there are other live networks that don't deal with real money but do mimic the real world scenario well, and can be used as a shared staging environment. These are called "testnets" and [Ethereum has several](https://ethereum.org/en/developers/docs/networks/#ethereum-testnets), like _Goerli_ and _Sepolia_. We recommend you deploy your contracts to the _Goerli_ testnet.

At the software level, deploying to a testnet is the same as deploying to mainnet. The only difference is which network you connect to. Let's look into what the code to deploy your contracts using ethers.js would look like.

Expand Down Expand Up @@ -49,7 +49,7 @@ Token address: 0x5FbDB2315678afecb367f032d93F642f64180aa3

## Deploying to remote networks

To deploy to a remote network such as mainnet or any testnet, you need to add a `network` entry to your `hardhat.config.js` file. We’ll use Ropsten for this example, but you can add any network similarly:
To deploy to a remote network such as mainnet or any testnet, you need to add a `network` entry to your `hardhat.config.js` file. We’ll use Goerli for this example, but you can add any network similarly:

```js{5,11,15-20}
require("@nomiclabs/hardhat-waffle");
Expand All @@ -58,47 +58,42 @@ require("@nomiclabs/hardhat-waffle");
// a new App in its dashboard, and replace "KEY" with its key
const ALCHEMY_API_KEY = "KEY";
// Replace this private key with your Ropsten account private key
// Replace this private key with your Goerli account private key
// To export your private key from Metamask, open Metamask and
// go to Account Details > Export Private Key
// Be aware of NEVER putting real Ether into testing accounts
const ROPSTEN_PRIVATE_KEY = "YOUR ROPSTEN PRIVATE KEY";
const GOERLI_PRIVATE_KEY = "YOUR GOERLI PRIVATE KEY";
module.exports = {
solidity: "0.7.3",
networks: {
ropsten: {
url: `https://eth-ropsten.alchemyapi.io/v2/${ALCHEMY_API_KEY}`,
accounts: [`${ROPSTEN_PRIVATE_KEY}`]
goerli: {
url: `https://eth-goerli.alchemyapi.io/v2/${ALCHEMY_API_KEY}`,
accounts: [`${GOERLI_PRIVATE_KEY}`]
}
}
};
```

We're using [Alchemy](https://www.alchemyapi.io), but pointing `url` to any Ethereum node or gateway would work. Go grab your `ALCHEMY_API_KEY` and come back.

To deploy on Ropsten you need to send ropsten-ETH into the address that's going to be making the deployment. You can get some ETH for testnets from a faucet, a service that distributes testing-ETH for free. Here's some for Ropsten:
To deploy on Goerli you need to send goerli-ETH into the address that's going to be making the deployment. You can get some ETH for testnets from a faucet, a service that distributes testing-ETH for free. Here are some for Goerli:

- [Portland State Ropsten Ethereum (rETH) faucet](https://ropsten.oregonctf.org/eth)
- [Ropsten testnet faucet](https://faucet.egorfine.com/)
- [MetaMask Ether Faucet](https://faucet.metamask.io/)
- [Chainlink faucet](https://faucets.chain.link/)
- [Alchemy Goerli Faucet](https://goerlifaucet.com/)

You'll have to change Metamask's network to Ropsten before transacting.
You'll have to change Metamask's network to Goerli before transacting.

:::tip

You can get some ETH for other testnets following these links:

- [Kovan faucet](https://faucet.kovan.network/)
- [Rinkeby faucet](https://faucet.rinkeby.io/)
- [Goerli faucet](https://goerli-faucet.slock.it/)
You can learn more about other testnets and find links to their faucets on the [ethereum.org site](https://ethereum.org/en/developers/docs/networks/#ethereum-testnets).

:::

Finally, run:

```
npx hardhat run scripts/deploy.js --network ropsten
npx hardhat run scripts/deploy.js --network goerli
```

If everything went well, you should see the deployed contract address.
25 changes: 12 additions & 13 deletions packages/hardhat-core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -93,19 +93,6 @@
"ts-node": "^8.1.0",
"typescript": "~4.5.2"
},
"peerDependencies": {
"chai": "^4.2.0",
"ts-node": "*",
"typescript": "*"
},
"peerDependenciesMeta": {
"ts-node": {
"optional": true
},
"typescript": {
"optional": true
}
},
"dependencies": {
"@ethereumjs/block": "^3.6.2",
"@ethereumjs/blockchain": "^5.5.2",
Expand Down Expand Up @@ -156,6 +143,18 @@
"uuid": "^8.3.2",
"ws": "^7.4.6"
},
"peerDependencies": {
"ts-node": "*",
"typescript": "*"
},
"peerDependenciesMeta": {
"ts-node": {
"optional": true
},
"typescript": {
"optional": true
}
},
"nyc": {
"extension": [
".ts"
Expand Down

0 comments on commit 6979ee6

Please sign in to comment.