Skip to content

Commit

Permalink
update some accounts with a given json accounts
Browse files Browse the repository at this point in the history
  • Loading branch information
hackmod committed Mar 16, 2019
1 parent 338d1ba commit aa68e32
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion tools/richlist.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
var _ = require('lodash');
var Web3 = require('web3');
var async = require('async');
var fs = require('fs');
var BigNumber = require('bignumber.js');
var mongoose = require('mongoose');

Expand Down Expand Up @@ -547,7 +548,22 @@ var latestBlock = web3.eth.blockNumber;
// run
console.log("* latestBlock = " + latestBlock);

if (useParity) {
// only update some accounts and exit
if (process.argv[2]) {
console.log("Update accounts ...");
var addrs = process.argv[2];
try {
if (fs.existsSync(addrs)) {
var content = fs.readFileSync(addrs);
var json = JSON.parse(content);
readJsonAccounts(json, latestBlock, updateAccounts);
}
} catch(err) {
console.error(err);
process.exit(1);
}
}
else if (useParity) {
makeParityRichList(500, null, latestBlock, updateAccounts);
} else {
// load genesis account
Expand Down

0 comments on commit aa68e32

Please sign in to comment.