Print validator pubkeys during generation (#791)
* Start docker docs * Add progress * Update docker.md * Add note about geth syncing * Fix env to use geth * Update docs * Remove sigp goerli node * Change text about eth1 syncing * Address comments from @pscott * Add links to beaconcha.in * Add instructions for starting an eth1 node * Print validator pubkeys during generation * Fix typo * Re-organise Syncing log * Add notes about finding the validator pubkey * Fix double-0x prefix bug * Fix typo
This commit is contained in:
parent
370c658c7c
commit
3afa7b0dab
@ -130,6 +130,7 @@ fn run_new_validator_subcommand<T: EthSpec>(
|
|||||||
&methods,
|
&methods,
|
||||||
deposit_value,
|
deposit_value,
|
||||||
&context.eth2_config.spec,
|
&context.eth2_config.spec,
|
||||||
|
&env.core_context().log,
|
||||||
)?;
|
)?;
|
||||||
|
|
||||||
if matches.is_present("send-deposits") {
|
if matches.is_present("send-deposits") {
|
||||||
@ -249,6 +250,7 @@ fn make_validators(
|
|||||||
methods: &[KeygenMethod],
|
methods: &[KeygenMethod],
|
||||||
deposit_value: u64,
|
deposit_value: u64,
|
||||||
spec: &ChainSpec,
|
spec: &ChainSpec,
|
||||||
|
log: &Logger,
|
||||||
) -> Result<Vec<ValidatorDirectory>, String> {
|
) -> Result<Vec<ValidatorDirectory>, String> {
|
||||||
methods
|
methods
|
||||||
.par_iter()
|
.par_iter()
|
||||||
@ -262,11 +264,25 @@ fn make_validators(
|
|||||||
KeygenMethod::ThreadRandom => builder.thread_random_keypairs(),
|
KeygenMethod::ThreadRandom => builder.thread_random_keypairs(),
|
||||||
};
|
};
|
||||||
|
|
||||||
builder
|
let validator = builder
|
||||||
.create_directory(datadir.clone())?
|
.create_directory(datadir.clone())?
|
||||||
.write_keypair_files()?
|
.write_keypair_files()?
|
||||||
.write_eth1_data_file()?
|
.write_eth1_data_file()?
|
||||||
.build()
|
.build()?;
|
||||||
|
|
||||||
|
let pubkey = &validator
|
||||||
|
.voting_keypair
|
||||||
|
.as_ref()
|
||||||
|
.ok_or_else(|| "Generated validator must have voting keypair".to_string())?
|
||||||
|
.pk;
|
||||||
|
|
||||||
|
info!(
|
||||||
|
log,
|
||||||
|
"Saved new validator to disk";
|
||||||
|
"voting_pubkey" => format!("{:?}", pubkey)
|
||||||
|
);
|
||||||
|
|
||||||
|
Ok(validator)
|
||||||
})
|
})
|
||||||
.collect()
|
.collect()
|
||||||
}
|
}
|
||||||
|
@ -49,6 +49,15 @@ Start the docker-compose environment (you may need to use `sudo`):
|
|||||||
$ docker-compose up
|
$ docker-compose up
|
||||||
```
|
```
|
||||||
|
|
||||||
|
Watch the output of this command for the `Saved new validator to disk` log, as
|
||||||
|
the `voting_pubkey` is the primary identifier for your new validator. This is
|
||||||
|
useful for finding your validator in block explorers. Here's an example of the
|
||||||
|
log:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
validator_client_1 | Jan 10 12:06:05.632 INFO Saved new validator to disk voting_pubkey: 0x8fc28504448783b10b0a7f5a321505b07ad2ad8d6a8430b8868a0fcdedee43766bee725855506626085776e020dfa472
|
||||||
|
```
|
||||||
|
|
||||||
> Note: the docker-compose setup includes a fast-synced geth node. You can
|
> Note: the docker-compose setup includes a fast-synced geth node. You can
|
||||||
> expect the `beacon_node` to log some eth1-related errors whilst the geth node
|
> expect the `beacon_node` to log some eth1-related errors whilst the geth node
|
||||||
> boots and becomes synced. This will only happen on the first start of the
|
> boots and becomes synced. This will only happen on the first start of the
|
||||||
|
@ -74,6 +74,9 @@ Generate new validator BLS keypairs using:
|
|||||||
$ lighthouse account validator new random
|
$ lighthouse account validator new random
|
||||||
```
|
```
|
||||||
|
|
||||||
|
Take note of the `voting_pubkey` of the new validator. This will be the primary
|
||||||
|
identifier of the validator. This is how you can find your validator in block
|
||||||
|
explorers.
|
||||||
|
|
||||||
You've completed this step when you see the equivalent line:
|
You've completed this step when you see the equivalent line:
|
||||||
|
|
||||||
|
@ -81,7 +81,7 @@ impl fmt::Display for PublicKey {
|
|||||||
|
|
||||||
impl fmt::Debug for PublicKey {
|
impl fmt::Debug for PublicKey {
|
||||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||||
write!(f, "0x{}", self.as_hex_string())
|
write!(f, "{}", self.as_hex_string())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user