Skip to content

API to create an in-process Hardhat network from a standalone program #5128

Discussion options

You must be logged in to vote

There is not an easy way to create an ephemeral network based on a passed in config. You can import hardhat in a standalone script that will run a node:

const hre = require("hardhat");

However this reads the config from a Hardhat config file in the current working directory - not what you are after. It is also limited to one Hardhat network per node process.

See the docs for more details on use a Hardhat node from a script.

This is a limitation we explicitly looking to overcome in Hardhat v3, which we are actively working on.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by kanej
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants