1

i am trying to connect metamask with private node but its fails to connect

geth --rpc --rpcaddr 127.0.0.1 --rpcport 8545 --rpccorsdomain "*" --rpcapi admin,db,eth,debug,miner,net,ssh,tapool,personal,web3 --datadir NODEDATA --networkid 123456 console

2
  • How do you connect it? Are they on the same machine? Commented Aug 6, 2019 at 18:43
  • tell me about both same machine and different machine with metamask Commented Aug 7, 2019 at 7:36

1 Answer 1

0

on the same machine use --rpcaddr 127.0.0.1 to start the JSON RCP on the localhost network and only connections from your local machine reach the geth server

on a remote machine use --rpcaddr "0.0.0.0" to allow remote connections.

For both case in metamask indicate the machine ip (for the first case use http://127.0.0.1:8545 for the second case use the machine ip instead 127.0.0.1)

8
  • its not connecting i have given --rpcaddr "0.0.0.0" if give the ip it shows error Fatal: Error starting protocol stack: listen tcp ip:8545: bind: cannot assign requested address Commented Aug 7, 2019 at 10:21
  • Maybe another process is using that port try to use lsof -i :8545 to see if which process is listening Commented Aug 7, 2019 at 13:50
  • i have checked no other process is using port 8545 Commented Aug 7, 2019 at 15:05
  • change 0.0.0.0 by its public ip Commented Aug 7, 2019 at 15:15
  • sir still not connected i have written --rpcaddr 0.0.0.0 Commented Aug 7, 2019 at 15:29

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.