Metamask-extension: Metamask not showing balance for testrpc account

Created on 14 Feb 2018  路  11Comments  路  Source: MetaMask/metamask-extension

I am running testrpc like bellow

screen shot 2018-02-14 at 2 25 24 pm

I ran the following code to test the account balce

var Web3 = require('web3');
var web3 = new Web3(new Web3.providers.HttpProvider("http://localhost:8545"));
web3.eth.getAccounts()
.then((addresses) => { 
    addresses.forEach((address) => {
        web3.eth.getBalance(address)
        .then((balance) => {
            console.log(address + ' - ' + balance.toString(10));
        })
    });
 })
.catch((error) => console.log("got an error"))

The output of the above code shows the account balance 100000.

screen shot 2018-02-14 at 4 33 11 pm

I tried to import the account to metamask by connecting on _localhost:8545_ and then importing by the private key

screen shot 2018-02-14 at 6 32 56 pm

screen shot 2018-02-14 at 5 02 50 pm

After this steps metamask successfully adds a/c 0x5A88fbD9e56CCc3Fc26DB507e243eC0d70F274E4 , but the account balance remains 0 Eth

screen shot 2018-02-14 at 5 03 05 pm

Am I missing something?

L02-keyManagement N01-needsResearch P3-soon bounty worthy x02-customNetworks

Most helpful comment

Holy shit. Adding the / to the end of http://127.0.0.1:7545 works like a charm...

So to be clear, use this string 'http://127.0.0.1:7545/'

All 11 comments

Same issue here. Saw the same 0 ETH balance issue when trying to import a ganache test account by its private key into MetaMask. Ganache is showing 100 ETH balance for that account.

Update #1: The issue still remains when switching to MetaMask beta.
screen shot 2018-06-12 at 9 28 35 pm

@senpo @souravray rather than connect to localhost:8575 try clicking "Custom RPC" in the network drop-down, then entering http://127.0.0.1:7545 in the "New RPC URL" - my Ganache account balances show up fine.

I have the same issue, when importing an address from ganache to metamask i see 0 eth when it should have about 100. I am using the custom RPC option with http://127.0.0.1:7545. Any updates on this?

I have the same problem on Windows 10? Please help??!

We had a user report that adding a trailing slash / to the end of the custom RPC URL solved this for them.

Still not sure of the root cause - works fine for me without the slash - but @heavymossman @ilbhaicnl give that a try at let us know

Hey guys, I have the same issue. It was working 2 days ago. I'm entering http://127.0.0.1:7545 on the Coustom RPC option in MetaMask and is still not showing any balances. @bdresser I try adding the trailing slash and it did not work.

I figure out a workaround, you re-install metamask. Click on import DEN and write the 12 words given by Ganache/TestRPC. After you register with a new password, you go to Coustom RPC and write the RPC URL you have from Ganace/TestRPC, after it connects you should be able to see the balance of those accounts.

Holy shit. Adding the / to the end of http://127.0.0.1:7545 works like a charm...

So to be clear, use this string 'http://127.0.0.1:7545/'

Same issue. I am using the command testrpc -m 'metamask seed words', its still not working.
Testrpc is running on port 8545, what should I enter to solve it?
When I am trying to use Custom RPC on Metamask, its keeps on trying to connect, but not getting connected.

I think you have to paste your metamask seed words(key words) in MNEMONIC session in ganache. Then it your metamask will show the current balance in Ganache

Closing due to inactivity. If the issue has persisted open a new issue.

Was this page helpful?
0 / 5 - 0 ratings