欢迎来到 AI 中文社区(简称 AI 中文社),这里是学习交流 AI 人工智能技术的中文社区。 为了更好的体验,本站推荐使用 Chrome 浏览器。
全部教程·
区块链·
Web3.js
[目录]
·
web3.js underscore 库
web3.js 教程
web3.js 环境搭建
web3.js 访问区块链网络
web3.js 智能合约对象
web3.js 调用函数
web3.js 交易操作
安装 ethereumjs-tx
web3.js 准备账号
web3.js 执行交易
web3.js 交易小结
web3.js 部署智能合约
web3.js 准备智能合约
web3.js 执行部署
web3.js 调用写函数
web3.js 执行写函数调用
web3.js 智能合约事件
web3.js 执行事件查询
web3.js 查询最新区块号
web3.js 查询最新区块
web3.js 查询指定区块
web3.js 查询区块交易
web3.js 查询 gas 价格
web3.js sha3
web3.js underscore 库
web3.js 教程
web3.js 环境搭建
web3.js 访问区块链网络
web3.js 智能合约对象
web3.js 调用函数
web3.js 交易操作
安装 ethereumjs-tx
web3.js 准备账号
web3.js 执行交易
web3.js 交易小结
web3.js 部署智能合约
web3.js 准备智能合约
web3.js 执行部署
web3.js 调用写函数
web3.js 执行写函数调用
web3.js 智能合约事件
web3.js 执行事件查询
web3.js 查询最新区块号
web3.js 查询最新区块
web3.js 查询指定区块
web3.js 查询区块交易
web3.js 查询 gas 价格
web3.js sha3
web3.js underscore 库
web3.js underscore JS库
Web3.js附带了underscoreJS库,可用于操作JavaScript数组或对象。
示例
app.js
const Web3 = require('web3')
const web3 = new Web3('https://mainnet.infura.io/v3/YOUR_INFURA_API_KEY') // YOUR_INFURA_API_KEY替换为你自己的key
// 访问underscore JS库
const _ = web3.utils._
_.each({ key1: 'value1', key2: 'value2' }, (value, key) => {
console.log(key)
})
运行app.js
$ node app
输出
key1 key2
AI 中文社