Skip to content

Commit

Permalink
patch validator yaml file generation
Browse files Browse the repository at this point in the history
  • Loading branch information
0o-de-lally committed Jul 23, 2022
1 parent 3cecb9e commit faa81ac
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
6 changes: 4 additions & 2 deletions config/management/genesis/src/ol_node_files.rs
Original file line number Diff line number Diff line change
Expand Up @@ -368,17 +368,19 @@ fn make_validator_cfg(output_dir: PathBuf, namespace: &str, seed_addresses: Opti
vfn_net.listen_address = format!("/ip4/0.0.0.0/tcp/{}", DEFAULT_VFN_PORT).parse()?;

let mut pub_net = NetworkConfig::network_with_id(NetworkId::Public);
pub_net.listen_address = format!("/ip4/0.0.0.0/tcp/{}", DEFAULT_PUB_PORT).parse()?;

pub_net.listen_address = format!("/ip4/127.0.0.1/tcp/{}", DEFAULT_PUB_PORT).parse()?; // Don't fullnode sync requests

// This ID is how the Validator node identifies themselves on their private VFN network.
// same ID as being used in the validator network.
vfn_net.identity = network_id.clone();
pub_net.identity = network_id;

if let Some(s) = seed_addresses {
vfn_net.seed_addrs = s.clone();
pub_net.seed_addrs = s;
}

// pub_net.discovery_method = DiscoveryMethod::Onchain;

c.full_node_networks = vec![vfn_net.to_owned(), pub_net.to_owned()];

Expand Down
5 changes: 3 additions & 2 deletions ol/cli/src/commands/init_cmd.rs
Original file line number Diff line number Diff line change
Expand Up @@ -202,8 +202,9 @@ impl Runnable for InitCmd {

let namespace = app_cfg.format_oper_namespace();
let output_dir = app_cfg.workspace.node_home.clone();
let seeds = pick_seed_peer(&mut app_cfg, entry_args.swarm_path.clone());
match ol_node_files::make_val_file(output_dir, seeds.ok(), None, &namespace) {
let seeds = if self.seed_peer { pick_seed_peer(&mut app_cfg, entry_args.swarm_path.clone()).ok() } else { None };

match ol_node_files::make_val_file(output_dir, seeds,None, &namespace) {
Ok(_) => {}
Err(e) => {
println!("Could not create file, exiting. Message: {:?}", e);
Expand Down

0 comments on commit faa81ac

Please sign in to comment.