mirror of
https://github.com/logos-blockchain/logos-blockchain-testing.git
synced 2026-01-04 06:13:09 +00:00
refactor(configs): name timing defaults
This commit is contained in:
parent
3e7d14b5f6
commit
ca9042a6b6
@ -8,6 +8,8 @@ use nomos_utils::net::get_available_udp_port;
|
|||||||
|
|
||||||
use crate::node_address_from_port;
|
use crate::node_address_from_port;
|
||||||
|
|
||||||
|
const PEER_RESPONSE_TIMEOUT: Duration = Duration::from_secs(60);
|
||||||
|
|
||||||
#[derive(Default, Clone)]
|
#[derive(Default, Clone)]
|
||||||
pub enum Libp2pNetworkLayout {
|
pub enum Libp2pNetworkLayout {
|
||||||
#[default]
|
#[default]
|
||||||
@ -66,7 +68,7 @@ pub fn create_network_configs(
|
|||||||
node_key,
|
node_key,
|
||||||
port,
|
port,
|
||||||
chain_sync_config: cryptarchia_sync::Config {
|
chain_sync_config: cryptarchia_sync::Config {
|
||||||
peer_response_timeout: Duration::from_secs(60),
|
peer_response_timeout: PEER_RESPONSE_TIMEOUT,
|
||||||
},
|
},
|
||||||
nat_config: nat_settings(port),
|
nat_config: nat_settings(port),
|
||||||
..default_swarm_config()
|
..default_swarm_config()
|
||||||
|
|||||||
@ -8,6 +8,9 @@ use time::OffsetDateTime;
|
|||||||
|
|
||||||
const DEFAULT_SLOT_TIME: u64 = 2;
|
const DEFAULT_SLOT_TIME: u64 = 2;
|
||||||
const CONSENSUS_SLOT_TIME_VAR: &str = "CONSENSUS_SLOT_TIME";
|
const CONSENSUS_SLOT_TIME_VAR: &str = "CONSENSUS_SLOT_TIME";
|
||||||
|
const DEFAULT_NTP_SERVER: &str = "pool.ntp.org";
|
||||||
|
const DEFAULT_NTP_TIMEOUT: Duration = Duration::from_secs(5);
|
||||||
|
const DEFAULT_NTP_UPDATE_INTERVAL: Duration = Duration::from_secs(16);
|
||||||
|
|
||||||
#[derive(Clone, Debug)]
|
#[derive(Clone, Debug)]
|
||||||
pub struct GeneralTimeConfig {
|
pub struct GeneralTimeConfig {
|
||||||
@ -27,9 +30,9 @@ pub fn default_time_config() -> GeneralTimeConfig {
|
|||||||
GeneralTimeConfig {
|
GeneralTimeConfig {
|
||||||
slot_duration: Duration::from_secs(slot_duration),
|
slot_duration: Duration::from_secs(slot_duration),
|
||||||
chain_start_time: OffsetDateTime::now_utc(),
|
chain_start_time: OffsetDateTime::now_utc(),
|
||||||
ntp_server: String::from("pool.ntp.org"),
|
ntp_server: String::from(DEFAULT_NTP_SERVER),
|
||||||
timeout: Duration::from_secs(5),
|
timeout: DEFAULT_NTP_TIMEOUT,
|
||||||
interface: IpAddr::V4(Ipv4Addr::UNSPECIFIED),
|
interface: IpAddr::V4(Ipv4Addr::UNSPECIFIED),
|
||||||
update_interval: Duration::from_secs(16),
|
update_interval: DEFAULT_NTP_UPDATE_INTERVAL,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user