Skip to content

Commit

Permalink
Add get-earliest-available-block-slot to debug tool (#8649)
Browse files Browse the repository at this point in the history
* add get-earliest-available-block-slot to debug tool

Signed-off-by: Gabriel Fukushima <[email protected]>

---------

Signed-off-by: Gabriel Fukushima <[email protected]>
  • Loading branch information
gfukushima authored Sep 29, 2024
1 parent ac6ee63 commit d8a8cc4
Showing 1 changed file with 23 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,29 @@ public int getFinalizedState(
}
}

@Command(
name = "get-earliest-available-block-slot",
description = "Get the earliest available block slot in the database",
mixinStandardHelpOptions = true,
showDefaultValues = true,
abbreviateSynopsis = true,
versionProvider = PicoCliVersionProvider.class,
synopsisHeading = "%n",
descriptionHeading = "%nDescription:%n%n",
optionListHeading = "%nOptions:%n",
footerHeading = "%n",
footer = "Teku is licensed under the Apache License 2.0")
public int getEarliestAvailableBlockSlot(
@Mixin final BeaconNodeDataOptions beaconNodeDataOptions,
@Mixin final Eth2NetworkOptions eth2NetworkOptions)
throws Exception {
try (final Database database = createDatabase(beaconNodeDataOptions, eth2NetworkOptions)) {
Optional<UInt64> earliestAvailableBlockSlot = database.getEarliestAvailableBlockSlot();
earliestAvailableBlockSlot.ifPresent(System.out::println);
}
return 0;
}

@Command(
name = "get-finalized-state-indices",
description = "Display the slots of finalized states that are stored.",
Expand Down

0 comments on commit d8a8cc4

Please sign in to comment.