将Metamask连接到Azure中的私有区块链

时间:2018-02-11 20:59:51

标签: azure azure-virtual-machine ethereum geth metamask

我正在尝试连接到Metamask中的rpc。 Metamask在尝试连接未知的专用网络时保持空闲。 Geth正在Linux Azure网络中运行。 它的公共IP是 AzureIP
我正在进入服务器,然后运行以下命令:

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

我得到以下输出:

HTTP endpoint opened: http://127.0.0.1:8080

然后我运行miner.start()

我尝试通过转到自定义RPC并将地址http:// AzureIP :8080连接到Metamask中的此专用网络

它就在那里闲逛。在azure中,我有以下网络入站端口规则 enter image description here

从我自己的笔记本电脑(没有插入服务器)然后我运行命令:

ping http://*AzureIP*:8080  

我得到了icmp_seq的请求超时...

如何解决此问题或任何建议以连接到专用网络?

2 个答案:

答案 0 :(得分:2)

127.0.0.1是一个循环地址,该服务仅在VM中运行。

在您的方案中,您需要在VM的私有IP上监听0.0.0.0上的服务。您可以添加--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

答案 1 :(得分:0)

我已成功以以下格式连接到服务器专用链: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,您可以尝试