Hm, how can I get this balance shown in MetaMask? In Metamask I am using localhost 8545. I have tried to use localhost 8545 at step 5, but it doesn’t work - doesn’t help me to get non-zero MetaMask balance on my private node.
Jul 5, 2020, 1:18 PM
How can I get non zero ETH balance on Localhost 8545?
Ok, got it for localhost 8080. Can I change localhost for geth?
Jul 5, 2020, 3:00 PM
--rpcport value
Jul 5, 2020, 3:02 PM
I’ve tried it as you can see in the medium article above: «geth --identity “LocalTestNode” --rpc --rpcport 8080 --rpccorsdomain “*” --datadir ~/mychain/data/ --port 30303 --nodiscover --rpcapi db,eth,net,web3,personal --networkid 1999 --maxpeers 0 --verbosity 6 init ~/mychain/CustomGenesis.json 2>> ~/mychain/logs/00.log», but I still see 0 ETH balance in Metamask. Shouldn’t it use CustomGenesis.json for getting ETH balance in 8545 localhost? I see only non-zero ETH balance in localhost 8080 in Metamask, how to get non-zero balance in Metamask for 8545 also?
This is from console: MacBook-Pro-user:mychain user$ geth --identity “LocalTestNode” --rpc --rpcport 8545 --rpccorsdomain “*” --datadir ~/mychain/data/ --port 30303 --nodiscover --rpcapi db,eth,net,web3,personal --networkid 1999 --maxpeers 0 console
INFO [07-06|21:43:59.894] Maximum peer count ETH=0 LES=0 total=0
WARN [07-06|21:43:59.895] The flag --rpc is deprecated and will be removed in the future, please use --http
WARN [07-06|21:43:59.895] The flag --rpcport is deprecated and will be removed in the future, please use --http.port
WARN [07-06|21:43:59.895] The flag --rpccorsdomain is deprecated and will be removed in the future, please use --http.corsdomain
WARN [07-06|21:43:59.895] The flag --rpcapi is deprecated and will be removed in the future, please use --http.api
INFO [07-06|21:43:59.925] Starting peer-to-peer node instance="Geth/“LocalTestNode”/v1.9.15-stable/darwin-amd64/go1.14.3"
INFO [07-06|21:43:59.926] Allocated trie memory caches clean=256.00MiB dirty=256.00MiB
INFO [07-06|21:43:59.927] Allocated cache and file handles database=/Users/user/mychain/data/geth/chaindata cache=512.00MiB handles=5120
INFO [07-06|21:44:00.117] Opened ancient database database=/Users/user/mychain/data/geth/chaindata/ancient
INFO [07-06|21:44:00.122] Initialised chain configuration config="{ChainID: 10 Homestead: 0 DAO: DAOSupport: false EIP150: 0 EIP155: 0 EIP158: 0 Byzantium: 0 Constantinople: 0 Petersburg: 0 Istanbul: 0, Muir Glacier: , YOLO v1: , Engine: ethash}"
INFO [07-06|21:44:00.122] Disk storage enabled for ethash caches dir=/Users/user/mychain/data/geth/ethash count=3
INFO [07-06|21:44:00.122] Disk storage enabled for ethash DAGs dir=/Users/user/Library/Ethash count=2
INFO [07-06|21:44:00.122] Initialising Ethereum protocol versions="[65 64 63]" network=1999 dbversion=
WARN [07-06|21:44:00.122] Upgrade blockchain database version from= to=7
INFO [07-06|21:44:00.125] Loaded most recent local header number=0 hash="9aa4c1…f63dd4" td=524288 age=4mo2w6d
INFO [07-06|21:44:00.125] Loaded most recent local full block number=0 hash="9aa4c1…f63dd4" td=524288 age=4mo2w6d
INFO [07-06|21:44:00.125] Loaded most recent local fast block number=0 hash="9aa4c1…f63dd4" td=524288 age=4mo2w6d
INFO [07-06|21:44:00.127] Loaded local transaction journal transactions=0 dropped=0
INFO [07-06|21:44:00.128] Regenerated local transaction journal transactions=0 accounts=0
INFO [07-06|21:44:00.140] Allocated fast sync bloom size=512.00MiB
INFO [07-06|21:44:00.141] Initialized fast sync bloom items=3 errorrate=0.000 elapsed="419.17µs"
INFO [07-06|21:44:00.217] New local node record seq=7 id=a4c395070889000d ip=127.0.0.1 udp=0 tcp=30303
INFO [07-06|21:44:00.217] Started P2P networking self="enode://83952072816cedc64c6a63b7b6057698c6257f54971f2515a6df59c3bcb68e98c7e31b61257beb278ab36ac83ca92647fa2e55383914c9cc978a7a9ed759ba64@127.0.0.1:30303?discport=0"
INFO [07-06|21:44:00.219] IPC endpoint opened url=/Users/user/mychain/data/geth.ipc
ERROR[07-06|21:44:00.219] Unavailable modules in HTTP API list unavailable=[db] available="[admin debug web3 eth txpool personal ethash miner net]"
INFO [07-06|21:44:00.221] HTTP endpoint opened url=http://127.0.0.1:8545/ cors="“*”" vhosts=localhost
This is from console: MacBook-Pro-user:mychain user$ geth --identity “LocalTestNode” --rpc --rpcport 8545 --rpccorsdomain “*” --datadir ~/mychain/data/ --port 30303 --nodiscover --rpcapi db,eth,net,web3,personal --networkid 1999 --maxpeers 0 console
INFO [07-06|21:43:59.894] Maximum peer count ETH=0 LES=0 total=0
WARN [07-06|21:43:59.895] The flag --rpc is deprecated and will be removed in the future, please use --http
WARN [07-06|21:43:59.895] The flag --rpcport is deprecated and will be removed in the future, please use --http.port
WARN [07-06|21:43:59.895] The flag --rpccorsdomain is deprecated and will be removed in the future, please use --http.corsdomain
WARN [07-06|21:43:59.895] The flag --rpcapi is deprecated and will be removed in the future, please use --http.api
INFO [07-06|21:43:59.925] Starting peer-to-peer node instance="Geth/“LocalTestNode”/v1.9.15-stable/darwin-amd64/go1.14.3"
INFO [07-06|21:43:59.926] Allocated trie memory caches clean=256.00MiB dirty=256.00MiB
INFO [07-06|21:43:59.927] Allocated cache and file handles database=/Users/user/mychain/data/geth/chaindata cache=512.00MiB handles=5120
INFO [07-06|21:44:00.117] Opened ancient database database=/Users/user/mychain/data/geth/chaindata/ancient
INFO [07-06|21:44:00.122] Initialised chain configuration config="{ChainID: 10 Homestead: 0 DAO:
INFO [07-06|21:44:00.122] Disk storage enabled for ethash caches dir=/Users/user/mychain/data/geth/ethash count=3
INFO [07-06|21:44:00.122] Disk storage enabled for ethash DAGs dir=/Users/user/Library/Ethash count=2
INFO [07-06|21:44:00.122] Initialising Ethereum protocol versions="[65 64 63]" network=1999 dbversion=
WARN [07-06|21:44:00.122] Upgrade blockchain database version from=
INFO [07-06|21:44:00.125] Loaded most recent local header number=0 hash="9aa4c1…f63dd4" td=524288 age=4mo2w6d
INFO [07-06|21:44:00.125] Loaded most recent local full block number=0 hash="9aa4c1…f63dd4" td=524288 age=4mo2w6d
INFO [07-06|21:44:00.125] Loaded most recent local fast block number=0 hash="9aa4c1…f63dd4" td=524288 age=4mo2w6d
INFO [07-06|21:44:00.127] Loaded local transaction journal transactions=0 dropped=0
INFO [07-06|21:44:00.128] Regenerated local transaction journal transactions=0 accounts=0
INFO [07-06|21:44:00.140] Allocated fast sync bloom size=512.00MiB
INFO [07-06|21:44:00.141] Initialized fast sync bloom items=3 errorrate=0.000 elapsed="419.17µs"
INFO [07-06|21:44:00.217] New local node record seq=7 id=a4c395070889000d ip=127.0.0.1 udp=0 tcp=30303
INFO [07-06|21:44:00.217] Started P2P networking self="enode://83952072816cedc64c6a63b7b6057698c6257f54971f2515a6df59c3bcb68e98c7e31b61257beb278ab36ac83ca92647fa2e55383914c9cc978a7a9ed759ba64@127.0.0.1:30303?discport=0"
INFO [07-06|21:44:00.219] IPC endpoint opened url=/Users/user/mychain/data/geth.ipc
ERROR[07-06|21:44:00.219] Unavailable modules in HTTP API list unavailable=[db] available="[admin debug web3 eth txpool personal ethash miner net]"
INFO [07-06|21:44:00.221] HTTP endpoint opened url=http://127.0.0.1:8545/ cors="“*”" vhosts=localhost
INFO [07-06|21:44:00.305] Etherbase automatically configured address=0x3a5221A09F6A0e04077c32aDB122c6be59464CDC
Welcome to the Geth JavaScript console!
instance: Geth/“LocalTestNode”/v1.9.15-stable/darwin-amd64/go1.14.3
coinbase: 0x3a5221a09f6a0e04077c32adb122c6be59464cdc
at block: 0 (Mon Feb 17 2020 11:49:54 GMT+0300 (MSK))
datadir: /Users/user/mychain/data
modules: admin:1.0 debug:1.0 eth:1.0 ethash:1.0 miner:1.0 net:1.0 personal:1.0 rpc:1.0 txpool:1.0 web3:1.0
> eth.getBalance(eth.accounts[0]);
2.3229320729235784806170624e+25
> eth.getBalance(eth.accounts[1]);
4.257213384306985160146944e+25
>
but MetaMask balance for 8545 is still zero, why? I used 8545 localhost in geth initialization wth genesis block with non-zero accounts
Welcome to the Geth JavaScript console!
instance: Geth/“LocalTestNode”/v1.9.15-stable/darwin-amd64/go1.14.3
coinbase: 0x3a5221a09f6a0e04077c32adb122c6be59464cdc
at block: 0 (Mon Feb 17 2020 11:49:54 GMT+0300 (MSK))
datadir: /Users/user/mychain/data
modules: admin:1.0 debug:1.0 eth:1.0 ethash:1.0 miner:1.0 net:1.0 personal:1.0 rpc:1.0 txpool:1.0 web3:1.0
> eth.getBalance(eth.accounts[0]);
2.3229320729235784806170624e+25
> eth.getBalance(eth.accounts[1]);
4.257213384306985160146944e+25
>
but MetaMask balance for 8545 is still zero, why? I used 8545 localhost in geth initialization wth genesis block with non-zero accounts
Jul 6, 2020, 6:46 PM
Did you imported the account to metamask?
Jul 6, 2020, 6:49 PM
Yes, using same private key as the account in the CustomGenesis.json, or should I import it after the geth initialization again?
In Java console I see non-zero balances for these accounts: > eth.getBalance(eth.accounts[0]);
2.3229320729235784806170624e+25
> eth.getBalance(eth.accounts[1]);
4.257213384306985160146944e+25
>
2.3229320729235784806170624e+25
> eth.getBalance(eth.accounts[1]);
4.257213384306985160146944e+25
>
Jul 6, 2020, 6:52 PM
can you show metamask config with url to the node?
probably you need to set this param --rpccorsdomain="chrome-extension://nkbihfbeogaeaoehlefnkodbefgpgknn”
Jul 6, 2020, 6:56 PM
Where should I get Metamask config? Should I download grid as it is shown here? https://medium.com/ethereum-grid/metamask-ethereum-grid-run-your-own-node-without-the-command-line-b36f11460093
Jul 6, 2020, 7:31 PM
There are bunch of “clients” that emulate ethereum network and you can use any of them but it depends on your main purpose. If you want just to test your smart-contracts you can use ganache for example
Jul 6, 2020, 7:36 PM
I just want to run aragon dao locally and test it with local ethereum chain, yes
Jul 6, 2020, 7:36 PM
https://www.trufflesuite.com/ganache
Jul 6, 2020, 7:36 PM
ok, will try
Jul 6, 2020, 8:04 PM