Skip to content

Error HH108: Cannot connect to the network anvil #74

@gigamesh

Description

@gigamesh

I am importing hardhat-anvil, but the additional params (ex: launch) aren't recognized by typescript. It also is not using the accounts I specify (I've tried accounts: { mnemonic: ... } as well as the array of private keys).

image
image

Stripped-down version of my config:

import '@nomiclabs/hardhat-ethers';
import '@nomiclabs/hardhat-etherscan';
import '@nomiclabs/hardhat-solhint';
import '@nomiclabs/hardhat-waffle';
import '@openzeppelin/hardhat-upgrades';
import '@typechain/hardhat';
import '@foundry-rs/hardhat-anvil';
import 'hardhat-deploy';

import * as dotenv from 'dotenv';
import { HardhatUserConfig } from 'hardhat/config';

const config: HardhatUserConfig = {
  networks: {
    anvil: {
      url: 'http://localhost:8545',
      chainId: 1337,
      accounts: [process.env.ADMIN_PRIVATE_KEY!],
      launch: true,
    },
  },
};

export default config;

I can get it to connect if I start anvil in a separate terminal, but I still need to be able to deploy from the ADMIN_PRIVATE_KEY account. Any ideas?

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions