2021-04-23 13:20:26 +02:00
|
|
|
use std::time::Duration;
|
|
|
|
|
|
2021-04-10 09:47:21 +02:00
|
|
|
pub const DB_VERSION: u32 = 0;
|
|
|
|
|
pub const CHAIN_VERSION: u32 = 0;
|
2021-03-10 22:21:50 +01:00
|
|
|
|
2021-04-10 09:47:21 +02:00
|
|
|
pub const ZONE_DIFFICULTY: u32 = 28;
|
|
|
|
|
pub const ZONE_MIN_DIFFICULTY: u32 = 22;
|
2021-04-19 21:19:00 +02:00
|
|
|
pub const SIGNER_DIFFICULTY: u32 = 16;
|
2021-04-10 09:47:21 +02:00
|
|
|
pub const KEYSTORE_DIFFICULTY: u32 = 23;
|
2021-03-10 22:21:50 +01:00
|
|
|
|
2021-04-13 18:49:26 +02:00
|
|
|
/// Blocks start to be signed starting from this index
|
|
|
|
|
pub const BLOCK_SIGNERS_START: u64 = 35;
|
|
|
|
|
|
|
|
|
|
/// How many signers are chosen for signing
|
|
|
|
|
pub const BLOCK_SIGNERS_ALL: u64 = 7;
|
|
|
|
|
|
|
|
|
|
/// Minimal signatures needed
|
|
|
|
|
pub const BLOCK_SIGNERS_MIN: u64 = 4;
|
|
|
|
|
|
|
|
|
|
/// Signers have 30 minutes to sign, after that time any owner of first 1000 block can add needed signature
|
|
|
|
|
pub const BLOCK_SIGNERS_TIME: i64 = 1800;
|
|
|
|
|
|
|
|
|
|
/// PoS signers, that sign blocks when chosen signers didn't sign
|
|
|
|
|
pub const BLOCK_POS_SIGNERS: u64 = 1000;
|
|
|
|
|
|
|
|
|
|
/// We start mining signing blocks after random delay, this is the max delay
|
|
|
|
|
pub const BLOCK_SIGNERS_START_RANDOM: i64 = 180;
|
2021-03-13 21:04:40 +01:00
|
|
|
|
2021-04-10 09:47:21 +02:00
|
|
|
pub const NEW_DOMAINS_INTERVAL: i64 = 86400; // One day in seconds
|
|
|
|
|
pub const DOMAIN_LIFETIME: i64 = 86400 * 365; // One year
|
2021-03-16 14:00:14 +01:00
|
|
|
|
2021-03-21 01:31:33 +01:00
|
|
|
pub const ZONE_MAX_LENGTH: usize = 10;
|
2021-04-10 09:47:21 +02:00
|
|
|
pub const MAX_RECONNECTS: u32 = 5;
|
|
|
|
|
|
2021-04-26 21:49:01 +02:00
|
|
|
pub const DB_NAME: &str = "blockchain.db";
|
2021-04-10 09:47:21 +02:00
|
|
|
pub const CLASS_ZONE: &str = "zone";
|
2021-04-17 16:45:49 +02:00
|
|
|
pub const CLASS_DOMAIN: &str = "domain";
|
2021-04-21 17:05:07 +02:00
|
|
|
pub const ALFIS_DEBUG: &str = "ALFIS_DEBUG";
|
2021-04-17 16:45:49 +02:00
|
|
|
|
|
|
|
|
/// Public nodes listen port
|
|
|
|
|
pub const LISTEN_PORT: u16 = 4244;
|
|
|
|
|
pub const UI_REFRESH_DELAY_MS: u128 = 250;
|
|
|
|
|
pub const LOG_REFRESH_DELAY_SEC: u64 = 60;
|
2021-04-23 13:20:26 +02:00
|
|
|
|
|
|
|
|
pub const POLL_TIMEOUT: Option<Duration> = Some(Duration::from_millis(250));
|
|
|
|
|
pub const MAX_PACKET_SIZE: usize = 1 * 1024 * 1024; // 1 Mb
|
2021-04-24 23:32:08 +02:00
|
|
|
pub const MAX_READ_BLOCK_TIME: u128 = 500;
|
2021-04-23 21:22:22 +02:00
|
|
|
pub const MAX_NODES: usize = 15;
|