提交 8a5d75f5 authored 作者: 崔大师's avatar 崔大师

fix

上级 09ccc924
......@@ -8,7 +8,7 @@ const web3 = new Web3();
const rpxUrl = "http://rpctest.chainopen.cn"
web3.setProvider(new web3.providers.HttpProvider(rpxUrl));
const mnemonic = fs.readFileSync(".secret").toString().trim();
const {mnemonic} = JSON.parse(fs.readFileSync("./config.json"));
const getPrivateKey = async (mnemonic,n) => {
const seed = await bip39.mnemonicToSeed(mnemonic.trim())
......@@ -17,7 +17,7 @@ const getPrivateKey = async (mnemonic,n) => {
const address = utils.privateToAddress((privateKey))
var account = web3.thk.GetAccount('1', '0x'+address.toString('hex'));
var balance = account.balance;
console.log("0x"+privateKey.toString('hex'),":","0x"+address.toString('hex'),"("+web3.fromWei(balance,'ether')+" ether)")
console.log("("+n+")"+"0x"+privateKey.toString('hex'),":","0x"+address.toString('hex'),"("+web3.fromWei(balance,'ether')+" ether)")
}
for(var i=0;i<10;i++){
getPrivateKey(mnemonic,i);
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论