Add validator-info for net/ managed nodes (#5538)

This commit is contained in:
Michael Vines
2019-08-16 11:39:58 -07:00
committed by GitHub
parent d925902b3f
commit c298474e6f
2 changed files with 25 additions and 4 deletions

View File

@@ -235,7 +235,14 @@ fn main() -> Result<(), Box<dyn error::Error>> {
.help(&format!(
"Validator description, max characters: {}",
MAX_LONG_FIELD_LENGTH
)),
))
)
.arg(
Arg::with_name("force")
.long("force")
.takes_value(false)
.hidden(true) // Don't document this argument to discourage its use
.help("Override keybase username validity check"),
),
)
.subcommand(
@@ -311,7 +318,14 @@ fn main() -> Result<(), Box<dyn error::Error>> {
let keys = vec![(id(), false), (validator_keypair.pubkey(), true)];
let validator_info = parse_args(&matches);
if let Some(string) = validator_info.get("keybaseUsername") {
verify_keybase(&validator_keypair.pubkey(), &string)?;
let result = verify_keybase(&validator_keypair.pubkey(), &string);
if result.is_err() {
if matches.is_present("force") {
println!("--force supplied, ignoring: {:?}", result);
} else {
result?;
}
}
}
let validator_string = serde_json::to_string(&validator_info)?;
let validator_info = ValidatorInfo {