hashgraph / hedera-hardhat-hethers

DEPRECATED Hardhat plugin for integration with hethers.js.
Apache License 2.0
6 stars 0 forks source link

The `--network` argument is being ignored #7

Closed Daniel-K-Ivanov closed 2 years ago

Daniel-K-Ivanov commented 2 years ago
  1. Create a sample hardhat project
  2. Add the network config and include a set of networks (previewnet, testnet, local f.e). Example config:
previewnet: {
        accounts: [ ACCS_HERE ]
    },
    testnet: {
        accounts: [ACCS_HERE  ]
    },
    local: {
        name: 'local',
        consensusNodes: [
            {
                url: '127.0.0.1:50211',
                nodeId: '0.0.3'
            }
        ],
        mirrorNodeUrl: '127.0.0.1:5551',
        chainId: 0,
        accounts: [
            {
                account: '0.0.1001',
                privateKey: "0x7f109a9e3b0d8ecfba9cc23a3614433ce0fa7ddcc80f2a8f10b222179a5a80d6",
            },
            {
                account: '0.0.1002',
                privateKey: "0x6ec1f2e7d126a74a1d2ff9e1c5d90b92378c725e506651ff8bb8616a5c724628",
            },
            {
                account: '0.0.1003',
                privateKey: "0xb4d7f7e82f61d81c95985771b8abf518f9328d019c36849d4214b5f995d13814",
            }
        ]
    }
  1. Create a script that deploys a sample contract to the network
  2. When executing the script, the --network tag is ignored and the network being used is always the one defined as defaultNetwork in the hardhat.config file.

If defaultNetwork: 'previewnet', is set in the hardhat.config file, the scripts are always using the previewnet network.

Excpectation When running the script:

npx hardhat deploy --network local

I would expect that the used network is local and not previewnet

Daniel-K-Ivanov commented 2 years ago

Closing this as it is not reproducible anymore