Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Metamask not showing balance for testrpc account #3245

Closed
souravray opened this issue Feb 14, 2018 · 12 comments
Closed

Metamask not showing balance for testrpc account #3245

souravray opened this issue Feb 14, 2018 · 12 comments
Labels
area-accounts Relating to how sensitive account data is managed and stored. area-customNetworks needs-research

Comments

@souravray
Copy link

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?

@senpo
Copy link

senpo commented Jun 13, 2018

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

@bdresser
Copy link
Contributor

@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.

@ilbhaicnl
Copy link

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?

@heavymossman
Copy link

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

@bdresser
Copy link
Contributor

bdresser commented Jul 2, 2018

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

@EduardoCortesL
Copy link

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.

@EduardoCortesL
Copy link

EduardoCortesL commented Jul 5, 2018

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.

@ghost
Copy link

ghost commented Jul 26, 2018

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/'

@dmajumder4292
Copy link

dmajumder4292 commented Aug 14, 2018

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.

@ajay1993
Copy link

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

@tmashuang
Copy link
Contributor

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

@kohebaki
Copy link

Hi

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-accounts Relating to how sensitive account data is managed and stored. area-customNetworks needs-research
Projects
None yet
Development

No branches or pull requests