Stream processing for the Bab vote
docker-compose up -d
npm install
# Edit ./bin/cluster to set the number of workers
npm run start
Open http://localhost:8081 to see the redis state
npm run update-frauds-json
npm run tabulate-votes
- Reads the known
frauds.json
file. - Reads the individual BAB transactions from the broker.
- Fetches voter's complete transaction history prior to the vote.
- Checks if the voter has received a transaction from a known bot/bad actor.
- If yes, the vote is rejected.
- If no, the vote is queued to be verified by the ./bin/process-valid-votes-worker.js
- Reads the valid vote from the transaction worker
- Checks the account for any close outs and invalidates the vote if any are found.
- Reads the invalid votes and the close-outs to update the
frauds.json
file.- If the frauds file has changed, clear the cache and rerun the analysis to ensure all votes are verified with the updated list
- Reads the state of
validated
voters and tabulates the results