Accounts on local opbnb dev node

Hi there,

I setup local opbnb dev node, as described here:

hardhat config:

    bsc_l1: {
      loggingEnabled: true,
      url: "http://127.0.0.1:8545",
      chainId: 900,
      accounts: [
        "59ba8068eb256d520179e903f43dacf6d8d57d72bd306e1bd603fdb8c8da10e8", //0x04d63aBCd2b9b1baa327f2Dda0f873F197ccd186
      ],
    },

I can connect, but balance is 0:

Owner Address: 0x04d63aBCd2b9b1baa327f2Dda0f873F197ccd186
Balance: 0.0 ETH

How can I setup few accounts with not empty balance?

Thanx.

1 Like

Hi there, Could you provide the steps for the code you’re trying to run and code snippet? If so, share your code via pastebin too.
Also, you can probably try to impersonate the account once. You can probably refer this: ethers.js - hardhat mainnet forking and impersonating an account isnt working, help! - Ethereum Stack Exchange

In addition to this, you can try to add accountsBalance field under accounts and set its value. For this, you can this docs: Reference | Ethereum development environment for professionals by Nomic Foundation

Thank you for response!

Here is my code: import { HardhatUserConfig } from "hardhat/config";import "@nomicfoundation/ha - Pastebin.com

I don’t think hardhat_impersonateAccount will help here, because it’s for internal hardhat network. In my case there is external (local) bnb node.

Same thing for config format:

accounts: [
{
privateKey: '', balance: ''
}
]

will not work in this case, because itsn’t hardhat network, and setting some balance in hardhat config will not affect address balance in blockchain.

I need to understand, why predefined account is not prefilled with some balance. Or may be I need a way to set some accounts/balances in some config file before starting node.

Heh, I understood now. There is explanation and pull-request.