因此,我的混合界面安装似乎不可挽回地崩溃了,并且考虑到没有其他集成UI的IDE,我不得不面对在没有web开发背景的情况下编写HTML的不可避免的学习。虽然有很多关于后端DAPP开发的资料,但我发现前端DAPP UI开发几乎为零。我想开始学习如何与薄雾结合。但撇开这个..。
我在Node中有web3.js包,我的UI html中有web3 = new Web3(new Web3.providers.HttpProvider("http://localhost:8545"));。
问:为了本地测试链的目的,我应该把这个页面存储在哪里?
发布于 2016-09-01 11:25:19
因此,对于HTML前端到本地节点的无服务器连接,I:
1)将web3.js放到DAPP的目录中
2)在HTML中包括:
<script type="text/javascript" src="web3.js"></script>
<script type='text/javascript'>
var Web3 = require('web3');
if (typeof web3 !== 'undefined') {
web3 = new Web3(web3.currentProvider);
} else {
// set the provider you want from Web3.providers
web3 = new Web3(new Web3.providers.HttpProvider("http://localhost:8545"));
}3)启动--rpccorsdomain="*"交换机以防止Chrome阻塞呼叫。
https://ethereum.stackexchange.com/questions/8461
复制相似问题