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

Let validator reads key pair from network config and remove --address and --validator_idx #1736

Merged
merged 11 commits into from
May 4, 2022
Prev Previous commit
Next Next commit
fmt
  • Loading branch information
Lu Zhang authored and Lu Zhang committed May 3, 2022
commit 3719dc7adcb487be3c55afaeb5283f5db67e96df
25 changes: 12 additions & 13 deletions sui/src/bin/validator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,20 +60,19 @@ async fn main() -> Result<(), anyhow::Error> {
network_config
}
};
let public_key_bytes= network_config.key_pair.public_key_bytes();
let public_key_bytes = network_config.key_pair.public_key_bytes();
let address = SuiAddress::from(public_key_bytes);
let authority =
// Find the network config for this validator
network_config
.authorities
.iter()
.find(|x| SuiAddress::from(&x.public_key) == address)
.ok_or_else(|| {
anyhow!(
"Keypair (pub key: {:?}) in network config is not in the validator committee",
public_key_bytes,
)
})?;
// Find the network config for this validator
let authority = network_config
.authorities
.iter()
.find(|x| SuiAddress::from(&x.public_key) == address)
.ok_or_else(|| {
anyhow!(
"Keypair (pub key: {:?}) in network config is not in the validator committee",
public_key_bytes,
)
})?;

let listen_address = cfg
.listen_address
Expand Down