harbor run -t openthoughts/tasktrove-exp-rpt-stack-rust-v2-stack-rust-6580harbor download openthoughts/tasktrove-exp-rpt-stack-rust-v2-stack-rust-6580Implement the required functionality for mining new blocks in a proof-of-work blockchain system by completing the functions defined in the provided Rust test code. This includes mining the genesis block, mining subsequent blocks, and writing the mined blocks to JSON files.
Mining Genesis Block:
write_genesis function that calls mine_genesis to create the genesis block (block height 0).Mining Subsequent Blocks:
mine_once function to mine a new block based on the latest mined block.Backlog Submission:
mine_and_submit function which continuously mines blocks and submits them to the client.process_backlog function to attempt to submit the mined block to a remote client. Log success or error messages based on the outcome of the submission.File Handling:
Testing:
Place the completed code in the /app/ directory of the project structure, ensuring to adhere to Rust's coding conventions and proper error handling practices.