HardhatConfig.networks.testnet - Expected a value of type HttpNetworkConfig

Invalid value {“url”:“https://data-seed-prebsc-1-s1.binance.org:8545/",“chainId”:97,“gasPrice”:20000000000,"accounts”:{}} for HardhatConfig.networks.testnet - Expected a value of type HttpNetworkConfig.

above is the error I’m facing while trying to deploy through hardhat … could you kindly answer me what’s error there to be fixed

Hi @Sid-1661,

Welcome to the community :wave:

You could try asking in the Hardhat Discord: https://hardhat.org/discord

Also have a look at the following config:

did you figure out a solution im having the same problem

@ross_elpharin & @Sid-1661
try replacing the accounts value like this:
testnet: {

  url: "https://data-seed-prebsc-1-s1.binance.org:8545",

  chainId: 97,

  gasPrice: 20000000000,

  accounts: [process.env.PRIVATE_KEY ]

},

obviously with your own private key between the brackets

2 Likes

Ensure the mnemonic/private key is set.

{
   ...
   accounts: { mnemonic: <your mnemonic> }  // produces the error if mnemonic is undefined.
   ...
}

How to use mnemonic from truffle-dashboard?

It happened with me also and i resolved it by removing chainID
But for a note i was setting up Ganache local network

If anyone else having the same problem, it is at some cases because you have put chainId into .env file and it reads it as string, you need to type say: process.env.CHAIN_ID * 1 in order to parse it into int.