Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Each block generated by our miners will first be stored in the blockchain managed by
litecoind. We will need to search these blocks and persist them to our database in order to calculate our shares. We reduce overhead of this cron by ensuring that we only list all transactions past our last persisted block.
This is the basic workflow of this Cron:
- Retrieve blockhash of last block persisted to database (if any)
- Connect to
litecoindto gather information
listsinceblockto gather latest transactions since last block
getdifficultyto store difficulty for the blocks found
- Parse transactions
- Transaction of type
immatureindicates a block
litecoindfor block details via
- Persist all relevant information to Database
- Parse added blocks
- Find blocks upstream accepted share
- Persist shares and finders to DB
This cron will run safely without dependencies to other crons. One should ensure that not more than one instance of this cron is running at a time to avoid duplication of blocks.
NOTE: We are safeguarding against that already at database level by adding a UNIQUE index on the block height.