Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a simple integration guide for @foundry-rs/hardhat #5

Open
onbjerg opened this issue May 10, 2022 · 1 comment
Open

Add a simple integration guide for @foundry-rs/hardhat #5

onbjerg opened this issue May 10, 2022 · 1 comment
Labels
documentation Improvements or additions to documentation

Comments

@onbjerg
Copy link
Member

onbjerg commented May 10, 2022

No description provided.

@onbjerg onbjerg added the documentation Improvements or additions to documentation label May 10, 2022
@shawnharmsen
Copy link
Contributor

shawnharmsen commented May 13, 2022

  1. nothing on npm yet so trying locally
  2. Documenting how to get it working locally for reference below

Steps to use locally

  1. clone https://github.com/foundry-rs/hardhat
  2. npm i && npm run build
  3. add local @foundry-rs/hardhat-anvil to package.json
{
  "name": "hardhat-project",
  "devDependencies": {
    "@nomiclabs/hardhat-ethers": "^2.0.6",
    "@nomiclabs/hardhat-waffle": "^2.0.3",
    "chai": "^4.3.6",
    "ethereum-waffle": "^3.4.4",
    "ethers": "^5.6.5",
    "hardhat": "^2.9.5",
    "@foundry-rs/hardhat-anvil": "file:/path/to/hardhat/packages/hardhat-anvil"
  }
}
  1. hardhat.config.js
module.exports = {
  defaultNetwork: "anvil",
  anvil: {
    url: "http://127.0.0.1:8545/",
    launch: true, // if set to true, it will spawn a new instance if the plugin is initialized
  },

Troubleshooting

package.json main entry

Error: Cannot find module '...node_modules/@foundry-rs/hardhat-anvil/dist/src/index.js'. Please verify that the package.json has a valid "main" entry
  • npm run build at local hardhat-anvil
  • check that index.js is in hardhat-anvil/dist/index.js

npx hardhat node - anvil network value.url is missing

Error in plugin @nomiclabs/hardhat-anvil: Anvil network config is invalid: value.url is missing
  • TBD

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

2 participants