Skip to content

Commit

Permalink
add clock 'age' to substreams run command
Browse files Browse the repository at this point in the history
  • Loading branch information
sduchesneau committed Nov 5, 2024
1 parent 3040ccc commit e0b2129
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions docs/release-notes/change-log.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
## Unreleased

* Fix `substreams gui` selecting the wrong module in the 'outputs' view if there is no output the selected output_module.
* Add the block 'age' printed clock headers in the`substreams run` command.

## v1.10.9

Expand Down
3 changes: 2 additions & 1 deletion tui/print.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
"encoding/json"
"fmt"
"strings"
"time"

"github.com/dustin/go-humanize"
"github.com/jhump/protoreflect/desc"
Expand Down Expand Up @@ -356,7 +357,7 @@ func decodeAsString(in []byte) []byte { return []byte(fmt.Sprintf("%q", string(i
func decodeAsHex(in []byte) string { return "(hex) " + hex.EncodeToString(in) }

func printClock(block *pbsubstreamsrpc.BlockScopedData) {
fmt.Printf("----------- BLOCK #%s (%s) ---------------\n", humanize.Comma(int64(block.Clock.Number)), block.Clock.Id)
fmt.Printf("----------- BLOCK #%s (%s) age=%s ---------------\n", humanize.Comma(int64(block.Clock.Number)), block.Clock.Id, time.Since(block.Clock.Timestamp.AsTime()))
}

func printUndo(lastGoodClock *pbsubstreams.BlockRef, cursor string) {
Expand Down

0 comments on commit e0b2129

Please sign in to comment.