Improve and extend CLI interface

This commit is contained in:
Paul Hauner
2019-08-31 12:34:27 +10:00
parent 6ba093d14f
commit 5f0509be50
5 changed files with 141 additions and 49 deletions

View File

@@ -158,12 +158,6 @@ impl<T: BeaconChainTypes> BeaconChain<T> {
genesis_state_root,
));
info!(log, "BeaconChain init";
"genesis_validator_count" => genesis_state.validators.len(),
"genesis_state_root" => format!("{}", genesis_state_root),
"genesis_block_root" => format!("{}", genesis_block_root),
);
// Slot clock
let slot_clock = T::SlotClock::from_eth2_genesis(
spec.genesis_slot,
@@ -172,6 +166,12 @@ impl<T: BeaconChainTypes> BeaconChain<T> {
)
.ok_or_else(|| Error::SlotClockDidNotStart)?;
info!(log, "Beacon chain initialized from genesis";
"validator_count" => genesis_state.validators.len(),
"state_root" => format!("{}", genesis_state_root),
"block_root" => format!("{}", genesis_block_root),
);
Ok(Self {
spec,
slot_clock,
@@ -211,6 +211,13 @@ impl<T: BeaconChainTypes> BeaconChain<T> {
let op_pool = p.op_pool.into_operation_pool(state, &spec);
info!(log, "Beacon chain initialized from store";
"head_root" => format!("{}", p.canonical_head.beacon_block_root),
"head_epoch" => format!("{}", p.canonical_head.beacon_block.slot.epoch(T::EthSpec::slots_per_epoch())),
"finalized_root" => format!("{}", last_finalized_root),
"finalized_epoch" => format!("{}", last_finalized_block.slot.epoch(T::EthSpec::slots_per_epoch())),
);
Ok(Some(BeaconChain {
spec,
slot_clock,