From 0ed31393b3876296f79fd14209253d296a9f3a52 Mon Sep 17 00:00:00 2001 From: Roman Storm Date: Sat, 11 Nov 2017 19:56:02 -0800 Subject: [PATCH] script enhancement --- README.md | 9 ++++++++- scripts/whitelist.js | 1 + 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 81e4920..949c870 100644 --- a/README.md +++ b/README.md @@ -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 ``` diff --git a/scripts/whitelist.js b/scripts/whitelist.js index 63266bb..86552c9 100644 --- a/scripts/whitelist.js +++ b/scripts/whitelist.js @@ -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);