使用VS代码使UI与智能合约进行交互

时间:2018-08-07 15:51:36

标签: ethereum

我正在关注https://coursetro.com/courses/20/Developing-Ethereum-Smart-Contracts-for-Beginners上的本教程。  testrpc正在运行,我现在不知道该怎么办。下面是错误。

web3.min.js:1 Failed to load http://localhost:8545/: Response to preflight 
request doesn't pass access control check: The value of the 'Access-Control- 
Allow-Origin' header in the response must not be the wildcard '*' when the 
request's credentials mode is 'include'. Origin 'null' is therefore not 
allowed access. The credentials mode of requests initiated by the 
XMLHttpRequest is controlled by the withCredentials attribute.
t.send @ web3.min.js:1
web3.min.js:1 Uncaught Error: CONNECTION ERROR: Couldn't connect to node 
http://localhost:8545.
at Object.InvalidConnection (web3.min.js:1)
at t.send (web3.min.js:1)
at n.send (web3.min.js:1)
at l.accounts (web3.min.js:1)
at index.html:40

1 个答案:

答案 0 :(得分:0)

我能够通过将web3的版本降级为0.20.6而不是0.20.7来解决此错误。其他人有此问题,请尝试此解决方案。