Correct bootnodes cli parameter
This commit is contained in:
parent
8e5829c0ba
commit
3f160d3b99
@ -77,7 +77,7 @@ impl ClientConfig {
|
|||||||
}
|
}
|
||||||
// Custom listening address ipv4/ipv6
|
// Custom listening address ipv4/ipv6
|
||||||
// TODO: Handle list of addresses
|
// TODO: Handle list of addresses
|
||||||
if let Some(listen_address_str) = args.value_of("listen_address") {
|
if let Some(listen_address_str) = args.value_of("listen-address") {
|
||||||
if let Ok(listen_address) = listen_address_str.parse::<IpAddr>() {
|
if let Ok(listen_address) = listen_address_str.parse::<IpAddr>() {
|
||||||
let multiaddr = SocketAddr::new(listen_address, config.net_conf.listen_port)
|
let multiaddr = SocketAddr::new(listen_address, config.net_conf.listen_port)
|
||||||
.to_multiaddr()
|
.to_multiaddr()
|
||||||
@ -91,7 +91,7 @@ impl ClientConfig {
|
|||||||
|
|
||||||
// Custom bootnodes
|
// Custom bootnodes
|
||||||
// TODO: Handle list of addresses
|
// TODO: Handle list of addresses
|
||||||
if let Some(boot_addresses_str) = args.value_of("boot_nodes") {
|
if let Some(boot_addresses_str) = args.value_of("boot-nodes") {
|
||||||
if let Ok(boot_address) = boot_addresses_str.parse::<Multiaddr>() {
|
if let Ok(boot_address) = boot_addresses_str.parse::<Multiaddr>() {
|
||||||
config.net_conf.boot_nodes.append(&mut vec![boot_address]);
|
config.net_conf.boot_nodes.append(&mut vec![boot_address]);
|
||||||
} else {
|
} else {
|
||||||
|
@ -26,7 +26,7 @@ fn main() {
|
|||||||
)
|
)
|
||||||
// network related arguments
|
// network related arguments
|
||||||
.arg(
|
.arg(
|
||||||
Arg::with_name("listen_address")
|
Arg::with_name("listen-address")
|
||||||
.long("listen-address")
|
.long("listen-address")
|
||||||
.value_name("Listen Address")
|
.value_name("Listen Address")
|
||||||
.help("The Network address to listen for p2p connections.")
|
.help("The Network address to listen for p2p connections.")
|
||||||
|
@ -122,12 +122,17 @@ impl TestingBeaconStateBuilder {
|
|||||||
})
|
})
|
||||||
.collect();
|
.collect();
|
||||||
|
|
||||||
|
// TODO: Testing only. Burn with fire later.
|
||||||
|
// set genesis to the last 30 minute block.
|
||||||
|
// this is used for testing only. Allows multiple nodes to connect within a 30min window
|
||||||
|
// and agree on a genesis
|
||||||
let now = SystemTime::now()
|
let now = SystemTime::now()
|
||||||
.duration_since(SystemTime::UNIX_EPOCH)
|
.duration_since(SystemTime::UNIX_EPOCH)
|
||||||
.unwrap()
|
.unwrap()
|
||||||
.as_secs()
|
.as_secs();
|
||||||
- 30;
|
let secs_after_last_period = now.checked_rem(30 * 60).unwrap_or(0);
|
||||||
let genesis_time = now; // arbitrary
|
// genesis is now the last 30 minute block.
|
||||||
|
let genesis_time = now - secs_after_last_period;
|
||||||
|
|
||||||
let mut state = BeaconState::genesis(
|
let mut state = BeaconState::genesis(
|
||||||
genesis_time,
|
genesis_time,
|
||||||
|
@ -292,11 +292,13 @@ impl<B: BeaconNodeDuties + 'static, S: Signer + 'static> Service<B, S> {
|
|||||||
let current_epoch = self.current_slot.epoch(self.spec.slots_per_epoch);
|
let current_epoch = self.current_slot.epoch(self.spec.slots_per_epoch);
|
||||||
// spawn a new thread separate to the runtime
|
// spawn a new thread separate to the runtime
|
||||||
// TODO: Handle thread termination/timeout
|
// TODO: Handle thread termination/timeout
|
||||||
std::thread::spawn(move || {
|
// TODO: Add duties thread back in, with channel to process duties in duty change.
|
||||||
// the return value is a future which returns ready.
|
// leave sequential for now.
|
||||||
// built to be compatible with the tokio runtime.
|
//std::thread::spawn(move || {
|
||||||
let _empty = cloned_manager.run_update(current_epoch, cloned_log.clone());
|
// the return value is a future which returns ready.
|
||||||
});
|
// built to be compatible with the tokio runtime.
|
||||||
|
let _empty = cloned_manager.run_update(current_epoch, cloned_log.clone());
|
||||||
|
//});
|
||||||
}
|
}
|
||||||
|
|
||||||
/// If there are any duties to process, spawn a separate thread and perform required actions.
|
/// If there are any duties to process, spawn a separate thread and perform required actions.
|
||||||
|
Loading…
Reference in New Issue
Block a user