5

web3.js连接远程geth报错

 2 years ago
source link: https://learnblockchain.cn/question/2622
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

其它 2 个回答

晗町 2天前

建议你在部署了geth的服务器端写一个简单的web服务器,然后在response中设置一下"Access-Control-Allow-Origin",个人感觉这肯定是有跨域的原因在里面的。

Tiny熊 - 布道者 2天前

  擅长:智能合约,以太坊

设置了 --rpccorsdomain 么?

--rpcaddr "0.0.0.0" --rpccorsdomain="*"

设置了,还是不行,难道需要在前端代码里设置跨域处理吗?我配置了一下用truffle把合约部署到这个链上成功了,就是web3对象获取不到不知道为啥

浏览器的跨域问题, 也可以使用服务器配置请求中转。


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK