Template subcommand improvements #294
No reviewers
Labels
No labels
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
parasitepool/para!294
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "template-improvements"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Template Subcommand Enhancements
Checklist
Done
--rawto output actual protocol format--networkflag for address encoding--quietmode (significant events only)Future Work
template-comparesubcommand)Foreword
I was checking out our issues seeing if there was anything I could tackle. Since I originally authored this subcommand, I figured it was especially my responsibility to work on this.
Refactored and extended the
templatesubcommand with simplified output, watch mode improvements, and additional analysis features.Changes
Output Structure
BlockHeaderInfo,VersionBits,MiningParams) into cleaner top-level fields--rawnow prints actualmining.notifyJSON array as received from protocol--show-coinbase-hexand--show-merkleflagsNew Features
--network <bitcoin|testnet|signet|regtest>- Address encoding for coinbase outputs--quiet- Only show significant events (new blocks, difficulty changes); implies--watchmerkle_rootfieldversion_infowith ASICBoost/version rolling detection (BIP320)new_block,difficulty_change,template_updateevents)size_bytesfieldCode Cleanup
NotifyDatawrapper struct, usestratum::Notifydirectlystratum::Difficultyinstead of manual calculationchronofor timestamp formattinganyhow::Contextfor better error messagesExample Output
Non-Goals
std::timedoesn't have date formatting capabilities, but I found out we can usechronoto save a ton of lines here.@paratoxicdev I have addressed all of your concerns, cut it down from 600 to 200 lines :)