本文环境:
区块链:以太坊POA联盟链;
出块节点数:3;
操作系统:windows 64;
节点版本:Geth1.9.14;
node版本:v10.14.0
参考文档:https://web3js.readthedocs.io/en/v1.2.8/
目录
web3.eth.accounts包含生成以太坊账户和签署交易和数据的功能。
备注:此包尚未审核,可能不安全。在使用之前,请注意正确清除内存,安全存储私钥,并正确测试事务接收和发送功能!
要单独使用此包,请执行以下操作:
var Accounts = require('web3-eth-accounts');
// Passing in the eth or web3 package is necessary to allow retrieving chainId, gasPrice and nonce automatically
// for accounts.signTransaction().
var accounts = new Accounts('ws://localhost:8546');
1. create
web3.eth.accounts.create([entropy]);
生成具有私钥和公钥的帐户对象。
Parameters
entropy-String(optional):增加熵的随机字符串。至少应为32个字符。如果没有,则使用randomhex生成随机字符串
Returns
Object&
订阅专栏 解锁全文
5062

被折叠的 条评论
为什么被折叠?



