本文环境:
操作系统:windows 64;
node版本:v10.14.0;
参考文档:https://github.com/pubkey/eth-crypto;
1. 安装
npm install g -eth-crypto
// es6
import EthCrypto from 'eth-crypto';
// node
const EthCrypto = require('eth-crypto');
2. 创建账号
node环境下运行以下代码,可以离线生成账号,得到私钥、公钥和地址。
const EthCrypto = require('eth-crypto');
const identity = EthCrypto.createIdentity();
//可以直接显示私钥、公钥和地址
console.log('privateKey:'+identity.privateKey);
console.log('publ