【发布时间】:2021-09-15 19:48:58
【问题描述】:
您好,我正在尝试将 Web3 链接到我的 html。我正在使用这个https://github.com/ChainSafe/web3.js?source=post_page-----e3fbe89111c3---------------------- 链接。
这是我在 html 文件中的代码
<script src="https://cdn.jsdelivr.net/npm/web3@latest/dist/web3.min.js"></script>
<script src="app.js"></script>
这是我在 app.js 中的代码
// In Node.js
const Web3 = require('web3');
let web3 = new Web3('ws://localhost:8546');
console.log(web3);
我一直在尝试用谷歌搜索答案,但似乎找不到我的问题的答案。
【问题讨论】:
标签: javascript node.js web3js