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?
    – Badr Bellaj
    Aug 6 '19 at 18:43
  • tell me about both same machine and different machine with metamask
    – Ranjeet
    Aug 7 '19 at 7:36
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
    – Ranjeet
    Aug 7 '19 at 10:21
  • Maybe another process is using that port try to use lsof -i :8545 to see if which process is listening
    – Badr Bellaj
    Aug 7 '19 at 13:50
  • i have checked no other process is using port 8545
    – Ranjeet
    Aug 7 '19 at 15:05
  • change 0.0.0.0 by its public ip
    – Badr Bellaj
    Aug 7 '19 at 15:15
  • sir still not connected i have written --rpcaddr 0.0.0.0
    – Ranjeet
    Aug 7 '19 at 15:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.