mirror of
https://github.com/logos-co/nomos-node.git
synced 2026-08-27 09:31:10 +00:00
chore(init): replace --ibd with --skip-ibd (#3097)
This commit is contained in:
@@ -36,7 +36,7 @@ pub struct GenerateConfigArgs {
|
||||
pub state_path: *const c_char,
|
||||
pub storage_path: *const c_char,
|
||||
pub logs_path: *const c_char,
|
||||
pub ibd: *const bool,
|
||||
pub skip_ibd: *const bool,
|
||||
pub log_filter: *const c_char,
|
||||
pub kms_file: *const c_char,
|
||||
}
|
||||
@@ -116,9 +116,9 @@ impl From<GenerateConfigArgs> for EmbeddedInitArgs {
|
||||
init_args.logs_path = Some(logs_path.to_string_lossy().to_string().into());
|
||||
}
|
||||
|
||||
// ---- ibd ----
|
||||
if !value.ibd.is_null() {
|
||||
init_args.ibd = unsafe { *value.ibd };
|
||||
// ---- skip_ibd ----
|
||||
if !value.skip_ibd.is_null() {
|
||||
init_args.skip_ibd = unsafe { *value.skip_ibd };
|
||||
}
|
||||
|
||||
// ---- log_filter ----
|
||||
|
||||
@@ -164,7 +164,7 @@ fn build_cryptarchia_config(
|
||||
CryptarchiaConfig::with_required_values(CryptarchiaConfigRequiredValues {
|
||||
funding_pk: cryptarchia_funding_key.to_public_key(),
|
||||
});
|
||||
if cryptarchia_args.ibd
|
||||
if !cryptarchia_args.skip_ibd
|
||||
&& let Some(initial_peers) = initial_peers
|
||||
{
|
||||
cryptarchia_config.network.bootstrap.ibd.peers = initial_peers
|
||||
|
||||
@@ -140,7 +140,7 @@ fn update_cryptarchia_config(
|
||||
.expect("Cryptarchia funding key set by default");
|
||||
cryptarchia_config.set_funding_pk(cryptarchia_funding_key.to_public_key());
|
||||
|
||||
if cryptarchia_args.ibd
|
||||
if !cryptarchia_args.skip_ibd
|
||||
&& let Some(initial_peers) = initial_peers
|
||||
{
|
||||
cryptarchia_config.network.bootstrap.ibd.peers = initial_peers
|
||||
|
||||
@@ -183,7 +183,7 @@ pub struct InitArgs {
|
||||
#[derive(Debug)]
|
||||
pub struct EmbeddedInitArgs {
|
||||
/// Trusted peers to bootstrap from (multiaddr format).
|
||||
/// If `--ibd` is set, peers whose multiaddrs include a `PeerId`
|
||||
/// If `--skip-ibd` is not set, peers whose multiaddrs include a `PeerId`
|
||||
/// are also used as IBD peers.
|
||||
pub initial_peers: Vec<Multiaddr>,
|
||||
|
||||
@@ -207,9 +207,9 @@ pub struct EmbeddedInitArgs {
|
||||
pub storage_path: Option<PathBuf>,
|
||||
pub logs_path: Option<PathBuf>,
|
||||
|
||||
/// Enable Initial Block Download (IBD) using peers
|
||||
/// passed via `--initial-peers`/`-p`.
|
||||
pub ibd: bool,
|
||||
/// Disable Initial Block Download (IBD) by leaving the IBD peer list
|
||||
/// empty, regardless of any peers passed via `--initial-peers`/`-p`.
|
||||
pub skip_ibd: bool,
|
||||
|
||||
/// Log filter directives to write into the generated config, e.g.
|
||||
/// `warn,logos_blockchain=debug,libp2p_gossipsub::behaviour=error`.
|
||||
@@ -239,7 +239,7 @@ impl From<EmbeddedInitArgs> for InitArgs {
|
||||
init_args.blend.blend_addr =
|
||||
Some(BlendCoreConfig::default_listening_address(args.blend_port));
|
||||
|
||||
init_args.cryptarchia.ibd = args.ibd;
|
||||
init_args.cryptarchia.skip_ibd = args.skip_ibd;
|
||||
init_args.api.addr = Some(args.http_addr);
|
||||
init_args.state.path.clone_from(&args.state_path);
|
||||
init_args.storage_path.clone_from(&args.storage_path);
|
||||
@@ -263,7 +263,7 @@ impl Default for EmbeddedInitArgs {
|
||||
state_path: None,
|
||||
storage_path: None,
|
||||
logs_path: None,
|
||||
ibd: false,
|
||||
skip_ibd: false,
|
||||
log_filter: None,
|
||||
kms_file: None,
|
||||
}
|
||||
|
||||
@@ -263,10 +263,10 @@ pub struct CryptarchiaArgs {
|
||||
)]
|
||||
pub cryptarchia_funding_pk: Option<ZkPublicKey>,
|
||||
|
||||
/// Enable Initial Block Download (IBD) using peers
|
||||
/// passed via `--net-initial-peers`/`-p`.
|
||||
#[clap(long = "ibd", default_value_t = false)]
|
||||
pub ibd: bool,
|
||||
/// Disable Initial Block Download (IBD) by leaving the IBD peer list
|
||||
/// empty, regardless of any peers passed via `--net-initial-peers`/`-p`.
|
||||
#[clap(long = "skip-ibd", default_value_t = false)]
|
||||
pub skip_ibd: bool,
|
||||
}
|
||||
|
||||
#[derive(Parser, Debug, Default, Clone, Copy)]
|
||||
|
||||
Reference in New Issue
Block a user