mirror of
https://github.com/sigp/lighthouse.git
synced 2026-04-28 02:03:32 +00:00
Merge branch 'master' into spec-v0.12
This commit is contained in:
@@ -19,6 +19,7 @@ logging = { path = "../common/logging" }
|
||||
slog-term = "2.5.0"
|
||||
slog-async = "2.5.0"
|
||||
environment = { path = "./environment" }
|
||||
boot_node = { path = "../boot_node" }
|
||||
futures = "0.3.5"
|
||||
validator_client = { "path" = "../validator_client" }
|
||||
account_manager = { "path" = "../account_manager" }
|
||||
|
||||
@@ -21,3 +21,4 @@ slog-json = "2.3.0"
|
||||
exit-future = "0.2.0"
|
||||
lazy_static = "1.4.0"
|
||||
lighthouse_metrics = { path = "../../common/lighthouse_metrics" }
|
||||
discv5 = "0.1.0-alpha.5"
|
||||
|
||||
@@ -126,3 +126,9 @@ impl TaskExecutor {
|
||||
&self.log
|
||||
}
|
||||
}
|
||||
|
||||
impl discv5::Executor for TaskExecutor {
|
||||
fn spawn(&self, future: std::pin::Pin<Box<dyn Future<Output = ()> + Send>>) {
|
||||
self.spawn(future, "discv5")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,13 +18,11 @@ pub const CLIENT_CONFIG_FILENAME: &str = "beacon-node.toml";
|
||||
pub const ETH2_CONFIG_FILENAME: &str = "eth2-spec.toml";
|
||||
|
||||
fn main() {
|
||||
// Debugging output for libp2p and external crates.
|
||||
Builder::from_env(Env::default()).init();
|
||||
|
||||
// Parse the CLI parameters.
|
||||
let matches = App::new("Lighthouse")
|
||||
.version(crate_version!())
|
||||
.author("Sigma Prime <contact@sigmaprime.io>")
|
||||
.setting(clap::AppSettings::ColoredHelp)
|
||||
.about(
|
||||
"Ethereum 2.0 client by Sigma Prime. Provides a full-featured beacon \
|
||||
node, a validator client and utilities for managing validator accounts.",
|
||||
@@ -40,6 +38,13 @@ fn main() {
|
||||
.global(true)
|
||||
.default_value("mainnet"),
|
||||
)
|
||||
.arg(
|
||||
Arg::with_name("env_log")
|
||||
.short("l")
|
||||
.help("Enables environment logging giving access to sub-protocol logs such as discv5 and libp2p",
|
||||
)
|
||||
.takes_value(false),
|
||||
)
|
||||
.arg(
|
||||
Arg::with_name("logfile")
|
||||
.long("logfile")
|
||||
@@ -64,6 +69,7 @@ fn main() {
|
||||
.help("The verbosity level for emitting logs.")
|
||||
.takes_value(true)
|
||||
.possible_values(&["info", "debug", "trace", "warn", "error", "crit"])
|
||||
.global(true)
|
||||
.default_value("info"),
|
||||
)
|
||||
.arg(
|
||||
@@ -89,10 +95,27 @@ fn main() {
|
||||
.global(true),
|
||||
)
|
||||
.subcommand(beacon_node::cli_app())
|
||||
.subcommand(boot_node::cli_app())
|
||||
.subcommand(validator_client::cli_app())
|
||||
.subcommand(account_manager::cli_app())
|
||||
.get_matches();
|
||||
|
||||
// boot node subcommand circumvents the environment
|
||||
if let Some(bootnode_matches) = matches.subcommand_matches("boot_node") {
|
||||
// The bootnode uses the main debug-level flag
|
||||
let debug_info = matches
|
||||
.value_of("debug-level")
|
||||
.expect("Debug-level must be present")
|
||||
.into();
|
||||
boot_node::run(bootnode_matches, debug_info);
|
||||
return;
|
||||
}
|
||||
|
||||
// Debugging output for libp2p and external crates.
|
||||
if matches.is_present("env_log") {
|
||||
Builder::from_env(Env::default()).init();
|
||||
}
|
||||
|
||||
macro_rules! run_with_spec {
|
||||
($env_builder: expr) => {
|
||||
run($env_builder, &matches)
|
||||
|
||||
Reference in New Issue
Block a user