Skip to content

Latest commit

 

History

History

SnapshotChecker

Snapshot and Airdrop Tools for validating and updating our airdrop data

airdrop.sql:

  • Schema for airdrop MySQL database

index.php:

  • Simple page for querying the database.
  • Be sure to add mysql credentials as needed.

create_sql.php:

  • Clears the database and creates INSERT statements to populate the data based on a snapshot.

export_requested_to_be_processed.sql:

  • Used to export a csv file of requested airdrops below 100 EOS.
  • Example:
    • mysql -u <user> -p <db> < export_requested_to_be_processed.sql | sed 's/\t/,/g' > requests.csv

parse_logs.php:

  • Used to parse the logs and create update sql statements.

parse_log_sequence.sh:

  • Used to process a batch of log files.
  • Example:
    • ./parse_log_sequence.sh 51 100
    • mysql -u <user> -p <db> < update.sql

Procedures

Updating the Airdrop Tool Code.

  1. Commit to git and push.
  2. Login to the webserver.
  3. cd airdrop
  4. git pull
  5. cd SnapshotChecker
  6. sudo cp index.php /var/www/html/airdrop/index_hidden.php
  7. Test at https://eosdac.io/airdrop/index_hidden.php
  8. If needed, make changes and go back to step 1.
  9. When satisfied sudo cp index.php /var/www/html/airdrop/index.php

Updating the Airdrop Data with COMPLETED transactions

  1. Login to the webserver.
  2. mysql -u <user> -p <db>
  3. use airdrop;
  4. Run select count(*), status from eos_holders GROUP BY status; and note the output
  5. Login to the webserver in a second window.
  6. cd airdrop
  7. git pull
  8. cd SnapshotChecker
  9. ./parse_log_sequence.sh 101 200 (or whatever batch amount you want to use)
  10. View update.sql to make sure it's valid.
  11. mysql -u <user> -p <db> < update.sql
  12. Run select count(*), status from eos_holders GROUP BY status; in the other window and check the results