fuel_core_shared_sequencer/
config.rs

1use std::time::Duration;
2
3/// Endpoints for the shared sequencer client.
4#[derive(Debug, Clone)]
5pub struct Endpoints {
6    /// The RPC address of the sequencer chain tendermint API
7    /// (e.g. "http://127.0.0.1:26657")
8    pub tendermint_rpc_api: String,
9    /// The REST address of the sequencer chain tendermint API
10    /// (e.g. "http://127.0.0.1:1317")
11    pub blockchain_rest_api: String,
12}
13
14/// Configuration for the shared sequencer client
15#[derive(Debug, Clone)]
16pub struct Config {
17    /// Whether the sequencer is enabled.
18    pub enabled: bool,
19    /// The frequency at which to post blocks to the shared sequencer.
20    pub block_posting_frequency: Duration,
21    /// Endpoints for the shared sequencer client.
22    pub endpoints: Option<Endpoints>,
23    /// Topic to post blocks to
24    pub topic: [u8; 32],
25}
26
27impl Config {
28    /// Default configuration for locally running shared sequencer node
29    pub fn local_node() -> Self {
30        Self {
31            enabled: false,
32            block_posting_frequency: Duration::from_secs(12),
33            endpoints: None,
34            topic: [0u8; 32],
35        }
36    }
37}