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

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

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

1 Answer 1


on the same machine use --rpcaddr 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 "" to allow remote connections.

For both case in metamask indicate the machine ip (for the first case use for the second case use the machine ip instead

  • its not connecting i have given --rpcaddr "" if give the ip it shows error Fatal: Error starting protocol stack: listen tcp ip:8545: bind: cannot assign requested address
    – Ranjeet
    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
    – Badr Bellaj
    Commented Aug 7, 2019 at 13:50
  • i have checked no other process is using port 8545
    – Ranjeet
    Commented Aug 7, 2019 at 15:05
  • change by its public ip
    – Badr Bellaj
    Commented Aug 7, 2019 at 15:15
  • sir still not connected i have written --rpcaddr
    – Ranjeet
    Commented Aug 7, 2019 at 15:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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