Connect provider to hardhat built-in network #3076
Answered
by
fvictorio
ghost
asked this question in
Troubleshooting
I know I can use localhost with If I do this: const provider = new ethers.providers.JsonRpcProvider();
const deployer = new ethers.Wallet(
process.env.ADMIN_PRIVATE_KEY!,
provider
);
console.log(provider.connection);
console.log(await deployer.getBalance()); |
Answered by
fvictorio
Aug 25, 2022
Replies: 1 comment 3 replies
|
This is not possible because the in-process network doesn't open an HTTP connection. So your options are:
|
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment

This is not possible because the in-process network doesn't open an HTTP connection. So your options are:
ethers.providerfrom thehardhat-etherspluginnetwork.providerwithethers.Web3Provider.network.provideris an EIP-1193 provider so you can pass it to that ethers's provider.