-
Notifications
You must be signed in to change notification settings - Fork 1k
findblock
Sebastian Grewe edited this page May 31, 2013
·
2 revisions
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
litecoind
to gather information -
listsinceblock
to gather latest transactions since last block -
getdifficulty
to store difficulty for the blocks found - Parse transactions
- Transaction of type
generate
orimmature
indicates a block - Query
litecoind
for block details viagetblock
- 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.
-
- installation of Redis requires TCL 8.5 or newer TCL Download Page