0

I'm trying to connect to rpc in Metamask. Metamask keeps idling in the trying to connect unknown private network. Geth is running in a Linux Azure network. Its public IP is AzureIP
Im sshing into the server, then I run the following command:

geth --identity “TestNode” --rpc --rpcport "8080" --rpccorsdomain "*" --datadir testprivareDir --port "30303" --nodiscover --rpcapi "db,eth,net,web3" --networkid 1999 console

I get the following output among other things:

HTTP endpoint opened: http://127.0.0.1:8080

I then run miner.start()

I try to connect to this private network in Metamask by going to custom RPC and putting the address http://AzureIP:8080

And it just idles there. In azure I have the following network inbound port rules enter image description here

From my own laptop (not sshed into the server) I then run the command:

ping http://*AzureIP*:8080  

And I get Request timeout for icmp_seq ...

How can I fix this or any advice to connect to the private network?

Shui shengbao
  • 18,746
  • 3
  • 27
  • 45
39fredy
  • 1,923
  • 2
  • 21
  • 40

2 Answers2

2

127.0.0.1 is a loop address, the service only works inside VM.

On your scenario, you need listen the service on 0.0.0.0 on VM's private IP. You could add --rpcaddr "10.0.0.4".

geth --identity “TestNode” --rpc --rpcport "8080" --rpcaddr "10.0.0.4" --rpccorsdomain "*" --datadir testprivareDir --port "30303" --nodiscover --rpcapi "db,eth,net,web3" --networkid 1999 console
Shui shengbao
  • 18,746
  • 3
  • 27
  • 45
  • Hi, in fact, you question like this [issue](https://github.com/ethereum/go-ethereum/issues/2982) on Github. You could check it. – Shui shengbao Feb 12 '18 at 06:53
0

I have successfully connected to the server private chain in a format like this: geth --identity "xxx" --rpc --rpcaddr "0.0.0.0" --rpccorsdomain "*" --datadir /home/xxx --port "30303" --rpcapi "db,eth,personal,net,web3" --networkid xxx --targetgaslimit xxx,you can try it

heaven
  • 1
  • 1
    Welcome to [so].Use formatting tools to make your post more readable. Use `code blocking` for code and log and error texts and **bold** and *italics* to highlight things And also illustrate your answer – Morse Jul 10 '18 at 02:08