Skip to content
This repository has been archived by the owner on Sep 22, 2022. It is now read-only.

Commit

Permalink
script enhancement
Browse files Browse the repository at this point in the history
  • Loading branch information
rstormsf committed Nov 12, 2017
1 parent b9624aa commit 0ed3139
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
9 changes: 8 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,14 @@ GAS_PRICE=0.7
parity --jsonrpc-port 8549 --chain kovan --unlock 0x0039F22efB07A647557C7C5d17854CFD6D489eF3 --password $HOME/FILE_PATH_TO_YOUR_PASSWORD_FILE
```
5. Copy list of addresses into [scripts/ARRAY_OF_ADDRESSES.json](scripts/ARRAY_OF_ADDRESSES.json)
5. run `node whitelist.js`
6. run `node whitelist.js`
The script will show you how many total transactions will be generated
Caution:
If you see this error:
```diff
- Unhandled rejection Error: Transaction was not mined within 50 blocks, please make sure your transaction was properly send. Be aware that it might still be mined!
```
it's totally ok because the transaction is still in the queue and hasn't been mined yet.

# Test result and gas usage
```
Expand Down
1 change: 1 addition & 0 deletions scripts/whitelist.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ filterAddresses(ARRAY_OF_ADDRESSES).then(async (toWhitelist) => {
console.log(toWhitelist.length);
const addPerTx = 160;
const slices = Math.ceil(toWhitelist.length / addPerTx);
console.log(`THIS SCRIPT WILL GENERATE ${slices} transactions`);
var txcount = await web3.eth.getTransactionCount(UNLOCKED_ADDRESS);
const nonce = web3.utils.toHex(txcount);
console.log('STARTED', nonce);
Expand Down

0 comments on commit 0ed3139

Please sign in to comment.