我一直在开发使用Remix和Metamask,但这是一个缓慢的进展,推动测试网络。我已经切换到了Remix中的JS,但我不知道如何将我的前端连接到它。在我使用这段代码的那一刻,我想这就是我需要修改的代码。
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"));
}有人能为我指出正确的方向吗,我只想连接到JS中的合同。谢谢
发布于 2018-01-27 23:40:05
从vm切换到注入的Web3并解锁元请求,下次单击Create时将使用元and将契约部署到当前网络。你只需复制你的地址,并在前端使用它。
https://ethereum.stackexchange.com/questions/37666
复制相似问题