I installed a node on the pc with the parameters geth --rpc --rpcaddr localhost --rpcport 8545
and I want to check the account balance:
const Web3 = require('web3')
web3 = new Web3(new Web3.providers.HttpProvider("http://localhost:8545"));
const address = '0xbdfd7125408363bfa36b8e83753b53dd695eef24'
web3.eth.getBalance(address, (err, wei) => {
console.log(balance = web3.utils.fromWei(wei, 'ether'))
})
but the balance is always 0, although there are funds there, what’s the problem?