REMIX |无法连接到Web3提供程序

问题描述 投票:2回答:5

我在web3提供程序上运行时出错(localhost:8545)

Not possible to connect to the Web3 provider. Make sure the provider is running and a connection is open (via IPC or RPC).

所以我想出来如下。

我正在我的本地运行geth,我给了一些选项来连接remix和testnet。

$ geth —testnet —rpc —rpcapi “db, net, web3, personal” —rpccorsdomain “https://remix.ethereum.org” console

我给了-rpccorsdomain,因为混音是在https上。

无论如何,请在remix IDE的“运行”选项卡上查看“web3 prover”。

然后,修改地址像'http://127.0.0.1:8545'而不是'http://localhost:8545'。

我不知道原因,但是当我这样修理时它仍然有效。我做了我的帐户并做了一些事。

但是,由于某种原因,我不得不再次重新下载geth。 (我改变了我的电脑)。我正在同步这些街区。我认为同步尚未完成,因为blockNumber为0。

> eth.blockNumber
0

所以...我现在在等,但我想知道当eth.syncing没有完全完成时可能会发生错误。

ethereum provider go-ethereum geth remix
5个回答
4
投票

HTTPS不允许您连接到在HTTP上运行的TestRPC。因此,您需要使用HTTP运行IDE。

http://remix.ethereum.org/

2
投票

只需从地址栏中删除HTTPS并只使用HTTP,它就可以工作:-)

参考:https://ethereum.stackexchange.com/users/32516/cryptoparticle


1
投票

正如上面提到的每个人,从地址栏中删除HTTPS并使用HTTP。另外,我在http://localhost:8545上运行它

geth --datadir . --port <your_port_no> --networkid 1234 --rpc --rpcport "8545" --rpccorsdomain "*" console 2>console.log

我用它,它总是适合我。

注意:如果您只使用一个节点,网络ID是无用的,无论如何只要将它留在那里就没有害处。如果您进一步面对任何其他问题,请告诉我。


0
投票

根据this link,有时问题是输入参数的顺序。 localhost:8545可以在geth启动时启动,如:

> geth --datadir ~/ethereum-private-network/chaindata --nodiscover --rpc
 --rpccorsdomain "*" --unlock 0 --mine 1

0
投票
geth --nodiscover --networkid 2212 --unlock 0x9789c48ccf003c3a4687121087cbf83bedc5c604 --mine --rpc --rpcapi eth,net,web3,personal --rpcaddr "localhost" --rpcport 7545 --rpccorsdomain="*"

这个对我有用

© www.soinside.com 2019 - 2024. All rights reserved.