Skip to content

Commit

Permalink
Merge pull request #25 from blinklabs-io/feat/better-log
Browse files Browse the repository at this point in the history
feat: better log messages for tuna blocks
  • Loading branch information
wolf31o2 authored Sep 2, 2023
2 parents 4d4be85 + 3e6a3b3 commit cf2cfe0
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion internal/indexer/indexer.go
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,22 @@ func (i *Indexer) handleEvent(evt event.Event) error {
i.lastBlockData = blockData
// TODO: do the thing

logger.Infof("found updated datum: %#v", blockData)
messageBytes, err := hex.DecodeString(blockData.Message)
if err != nil {
panic(err)
}
message := string(messageBytes)

logger.Infof("found updated datum: block number: %d, hash: %s, leading zeros: %d, difficulty number: %d, epoch time: %d, real time now: %d, message: %s",
blockData.BlockNumber,
blockData.TargetHash,
blockData.LeadingZeros,
blockData.DifficultyNumber,
blockData.EpochTime,
blockData.RealTimeNow,
message,
)


// Restart workers for new datum
if i.tipReached {
Expand Down

0 comments on commit cf2cfe0

Please sign in to comment.