安装
npm install keythereum
【ethereum|查看geth keystore私钥】然后运行
var keythereum = require("keythereum");
var datadir = "C:\\Users\\sam\\AppData\\Roaming\\Ethereum";
var address= "0xc8096d713000002c77e4eb62f0000ead5f105a7e";
//要小写
const password = "mypass";
var keyObject = keythereum.importFromFile(address, datadir);
var privateKey = keythereum.recover(password, keyObject);
console.log(privateKey.toString('hex'));
推荐阅读
- 区块链|去中心化应用Dapp和web 应用架构对比
- geth|geth常用命令
- forkdelta|测试网络部署forkdelta
- 以太坊|Mac OSX 清理Ethereum主网络chaindata(区块链数据)的方法
- 区块链|ethereum和eos的收费模型比较