Skip to content

Commit

Permalink
Allow to specify --boot-nodes, --features and other CLI params se…
Browse files Browse the repository at this point in the history
…parated by comma
  • Loading branch information
povi committed Mar 19, 2024
1 parent e9ca5ad commit 6fe2be2
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 6 deletions.
12 changes: 6 additions & 6 deletions grandine/src/grandine_args.rs
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ pub struct GrandineArgs {
graffiti: Vec<H256>,

/// List of optional runtime features to enable
#[clap(long)]
#[clap(long, value_delimiter = ',')]
features: Vec<Feature>,

#[clap(subcommand)]
Expand Down Expand Up @@ -181,7 +181,7 @@ struct HttpApiOptions {

/// List of Access-Control-Allow-Origin header values for the HTTP API server.
/// Defaults to the listening URL of the HTTP API server.
#[clap(long)]
#[clap(long, value_delimiter = ',')]
http_allowed_origins: Vec<HeaderValue>,

/// Max number of events stored in a single channel for HTTP API /events api call
Expand Down Expand Up @@ -458,19 +458,19 @@ struct NetworkConfigOptions {
enr_quic_port_ipv6: Option<NonZeroU16>,

/// List of ENR boot node addresses
#[clap(long)]
#[clap(long, value_delimiter = ',')]
boot_nodes: Vec<Enr>,

/// List of Multiaddr node addresses
#[clap(long)]
#[clap(long, value_delimiter = ',')]
libp2p_nodes: Vec<Multiaddr>,

/// Target number of network peers
#[clap(long, default_value_t = DEFAULT_TARGET_PEERS)]
target_peers: usize,

/// List of trusted peers
#[clap(long)]
#[clap(long, value_delimiter = ',')]
trusted_peers: Vec<PeerIdSerialized>,
}

Expand Down Expand Up @@ -690,7 +690,7 @@ struct ValidatorOptions {
builder_max_skipped_slots_per_epoch: u64,

/// List of public keys to use from Web3Signer
#[clap(long, num_args = 1..)]
#[clap(long, num_args = 1.., value_delimiter = ',')]
web3signer_public_keys: Vec<PublicKeyBytes>,

/// [DEPRECATED] List of Web3Signer API URLs
Expand Down
7 changes: 7 additions & 0 deletions grandine/src/predefined_network.rs
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,13 @@ impl PredefinedNetwork {
genesis_download_url: Option<Url>,
) -> Result<GenesisProvider<P>> {
let config = &self.chain_config();

#[cfg(any(
feature = "network-goerli",
feature = "network-sepolia",
feature = "network-holesky",
test
))]
let load_genesis_state = |default_download_url: &str| {
load_or_download_genesis_state(
config,
Expand Down

0 comments on commit 6fe2be2

Please sign in to comment.