lssa/sequencer_core/src/config.rs

45 lines
1.4 KiB
Rust
Raw Normal View History

2025-07-14 10:43:35 +03:00
use serde::{Deserialize, Serialize};
use std::path::PathBuf;
2024-11-25 07:26:16 +02:00
2025-07-29 14:20:03 +03:00
#[derive(Debug, Serialize, Deserialize, Clone)]
///Helperstruct for account serialization
pub struct AccountInitialData {
///Hex encoded `AccountAddress`
pub addr: String,
2025-08-07 15:19:06 -03:00
pub balance: u128,
2025-07-29 14:20:03 +03:00
}
2025-09-24 14:29:56 +03:00
#[derive(Debug, Serialize, Deserialize, Clone)]
///Helperstruct to initialize commitments
pub struct CommitmentsInitialData {
pub npk: nssa_core::NullifierPublicKey,
pub account: nssa_core::account::Account,
}
2025-11-18 19:31:03 +03:00
// TODO: Provide default values
2025-07-25 10:00:27 +03:00
#[derive(Clone, Serialize, Deserialize)]
2024-11-25 07:26:16 +02:00
pub struct SequencerConfig {
///Home dir of sequencer storage
pub home: PathBuf,
///Override rust log (env var logging level)
pub override_rust_log: Option<String>,
2024-11-25 07:26:16 +02:00
///Genesis id
pub genesis_id: u64,
///If `True`, then adds random sequence of bytes to genesis block
pub is_genesis_random: bool,
///Maximum number of transactions in block
pub max_num_tx_in_block: usize,
2025-10-23 16:23:47 -03:00
///Mempool maximum size
pub mempool_max_size: usize,
///Interval in which blocks produced
pub block_create_timeout_millis: u64,
///Port to listen
pub port: u16,
2025-07-23 15:16:53 +03:00
///List of initial accounts data
2025-07-29 14:20:03 +03:00
pub initial_accounts: Vec<AccountInitialData>,
2025-09-18 15:59:17 +03:00
///List of initial commitments
2025-09-24 14:29:56 +03:00
pub initial_commitments: Vec<CommitmentsInitialData>,
2025-09-03 10:29:51 +03:00
///Sequencer own signing key
pub signing_key: [u8; 32],
2024-11-25 07:26:16 +02:00
}