Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add get-earliest-available-block-slot to debug tool #8649

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