/voi_drops

Primary LanguageJavaScript

This repository contains a set of scripts to perform airdrop functions for the Voi blockchain network.

There are four core scripts located in the scripts folder:

Initial airdrop script - airdrop.js

Performs an airdrop of network tokens to the accounts in <acctlist>, which is a CSV file containing three columns -- account address, account type, and atomic amount

Optional Parameters: <blacklist> -- a CSV containing a list of accounts to exclude from the airdrop <group_size> -- the number of accounts to include in each atomic transaction group (note -- if an issue arrises with an address, such as it being invalid, all transactions in the group will fail and be included in the errorList.csv generated by the script) <mnemonic> -- this can be either a mnemonic string (space-separated words) entered inside quotes on the command line, or the name of a text file containing the mnemonic string

Usage: node airdrop.js -a <acctlist> [-b <blacklist>] [-g <group_size>] [-m "mnemonic"]

Epoch reward calculaton script - epoch_calc.js

Given a STARTBLOCK and ENDBLOCK, and an integer of atomic tokens (EPOCHREWARD) to distribute evenly among block proposers, this script calculates the number of tokens to distribute to each block proposer and writes it to FILENAME. This output file can then be used as the <acctList> input to airdrop.js to airdrop the alloted tokens to each address.

Usage: node epoch_calc.js -s STARTBLOCK -e ENDBLOCK -r EPOCHREWARD -f FILENAME

Account bucketing scirpt - buckets.js

Usage: node buckets.js

NOTE: buckets.js is incomplete.

Block finder by timestamp - find_block.js

Given a GMT timestamp in the format YYYY-MM-DDTHH:II:SS, find the block produced at the specified time, or the next block produced after the specified time. For example, if block 123 is produced at 2023-08-30T07:59:59 and block 124 is produced at 2023-08-30T08:00:01, and the TIMESTAMP input is 2023-08-30T08:00:00 then the script will return 124.

Usage: node find_block.js -t TIMESTAMP