2024-12-29 14:11:47 +02:00
|
|
|
use std::path::PathBuf;
|
2024-11-25 07:26:16 +02:00
|
|
|
|
2025-11-26 00:27:20 +03:00
|
|
|
use serde::{Deserialize, Serialize};
|
|
|
|
|
|
2025-07-29 14:20:03 +03:00
|
|
|
#[derive(Debug, Serialize, Deserialize, Clone)]
|
2025-11-26 00:27:20 +03:00
|
|
|
/// Helperstruct for account serialization
|
2025-07-29 14:20:03 +03:00
|
|
|
pub struct AccountInitialData {
|
2025-11-24 17:09:30 +03:00
|
|
|
/// Hex encoded account id
|
|
|
|
|
pub account_id: 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)]
|
2025-11-24 17:09:30 +03:00
|
|
|
/// Helperstruct to initialize commitments
|
2025-09-24 14:29:56 +03:00
|
|
|
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 {
|
2025-11-26 00:27:20 +03:00
|
|
|
/// Home dir of sequencer storage
|
2024-11-25 07:26:16 +02:00
|
|
|
pub home: PathBuf,
|
2025-11-26 00:27:20 +03:00
|
|
|
/// Override rust log (env var logging level)
|
2024-11-28 22:05:14 +02:00
|
|
|
pub override_rust_log: Option<String>,
|
2025-11-26 00:27:20 +03:00
|
|
|
/// Genesis id
|
2024-11-25 07:26:16 +02:00
|
|
|
pub genesis_id: u64,
|
2025-11-26 00:27:20 +03:00
|
|
|
/// If `True`, then adds random sequence of bytes to genesis block
|
2024-11-25 07:26:16 +02:00
|
|
|
pub is_genesis_random: bool,
|
2025-11-26 00:27:20 +03:00
|
|
|
/// Maximum number of transactions in block
|
2024-11-25 07:26:16 +02:00
|
|
|
pub max_num_tx_in_block: usize,
|
2025-11-26 00:27:20 +03:00
|
|
|
/// Mempool maximum size
|
2025-10-23 16:23:47 -03:00
|
|
|
pub mempool_max_size: usize,
|
2025-11-26 00:27:20 +03:00
|
|
|
/// Interval in which blocks produced
|
2024-12-29 14:11:47 +02:00
|
|
|
pub block_create_timeout_millis: u64,
|
2025-11-26 00:27:20 +03:00
|
|
|
/// Port to listen
|
2024-12-29 14:11:47 +02:00
|
|
|
pub port: u16,
|
2025-11-26 00:27:20 +03:00
|
|
|
/// List of initial accounts data
|
2025-07-29 14:20:03 +03:00
|
|
|
pub initial_accounts: Vec<AccountInitialData>,
|
2025-11-26 00:27:20 +03:00
|
|
|
/// List of initial commitments
|
2025-09-24 14:29:56 +03:00
|
|
|
pub initial_commitments: Vec<CommitmentsInitialData>,
|
2025-11-26 00:27:20 +03:00
|
|
|
/// Sequencer own signing key
|
2025-09-03 10:29:51 +03:00
|
|
|
pub signing_key: [u8; 32],
|
2024-11-25 07:26:16 +02:00
|
|
|
}
|