hardhat
hardhat copied to clipboard
Add support for `--chainid` argument in `node` command
- [ ] Because this PR includes a new feature, the change was previously discussed on an Issue or with someone from the team. (Issues #2305)
This PR adds support for --chainid
argument in npx hardhat node
command.
⚠️ No Changeset found
Latest commit: cd28c9095dc0b8ec6f764c1307076ab37c92f268
Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.
This PR includes no changesets
When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types
Click here to learn what changesets are, and how to add one.
Click here if you're a maintainer who wants to add a changeset to this PR
Thanks, @webdevabhijit!
@fvictorio will review this after we get our next release out.
@alcuadrado Sure.
This PR was marked as stale because it didn't have any activity in the last 30 days. Please excuse us if we didn't have enough time to review it and get it merged. If you are still interested in getting these changes applied, please leave a comment indicating so. Otherwise, it will be closed in 7 days.
This PR was closed because it has been stalled for 7 days with no activity.
Still relevant.
The latest updates on your projects. Learn more about Vercel for Git ↗︎
Name | Status | Preview | Updated |
---|---|---|---|
hardhat | ❌ Failed (Inspect) | Jul 6, 2022 at 8:57AM (UTC) | |
hardhat-storybook | ❌ Failed (Inspect) | Jul 6, 2022 at 8:57AM (UTC) |
Hey @ethabhijit, thanks for the PR and sorry for taking so long to respond.
I don't think this implementation works, unless I'm missing something. The reason is that it relies on using hardhat_reset
with the new chainId
, but I'm pretty sure that hardhat_reset
doesn't support that. So I would say that this feature is blocked by https://github.com/NomicFoundation/hardhat/issues/1697
In the meantime, for people landing here, a workaround for this missing feature is to use an environment variable. You should set something like this in your hardhat config:
networks: {
hardhat: {
chainId: Number(process.env.HARDHAT_CHAIN_ID) ?? 31337
},
},
And then HARDHAT_CHAIN_ID=123 npx hardhat node
should use 123 as a chain id.