Skip to content
This repository has been archived by the owner on Oct 23, 2024. It is now read-only.

[TASK] Simplify light client relayer configuration #66

Open
salman01zp opened this issue Sep 13, 2023 · 0 comments
Open

[TASK] Simplify light client relayer configuration #66

salman01zp opened this issue Sep 13, 2023 · 0 comments
Labels
p2 🟡 Issue should be resolved soon

Comments

@salman01zp
Copy link
Contributor

Overview

Simplyfy configuration, we can divide config into three parts

  • LightClientRelayerConfig
  • BeaconChainConfig
  • TangleSubstrateConfig

and set default values for most of the values and just pass simple single configuration file

#[derive(Debug, Clone, Deserialize, Serialize, Default)]
#[serde(rename_all(serialize = "camelCase", deserialize = "kebab-case"))]
pub struct LightClientRelayerConfig {
    pub tangle_config : TangleSubstrateConfig,
    pub beacon_chain_config : BeaconChainConfig,
    // endpoint for the Ethereum full node, which supports Eth1 RPC API
    pub eth1_endpoint: String,
    pub get_light_client_update_by_epoch: Option<bool>,
    // the max number of headers submitted in one batch to eth client
    pub headers_batch_size: u32,
    
}

#[derive(Debug, Clone, Deserialize, Serialize, Default)]
#[serde(rename_all(serialize = "camelCase", deserialize = "kebab-case"))]
pub struct BeaconChainConfig {
    pub name: String,
    // Beacon http endpoint
    #[serde(skip_serializing)]
    pub http_endpoint: RpcUrl,
    // Beacon rpc version (V1_1, V1_2)
    pub beacon_rpc_version: BeaconRPCVersion,
    // sleep time on sync
    pub sleep_time_on_sync_secs: u64,

}

#[derive(Debug, Clone, Deserialize, Serialize, Default)]
#[serde(rename_all(serialize = "camelCase", deserialize = "kebab-case"))]
pub struct TangleSubstrateConfig {
    /// String that groups configuration for this chain on a human-readable name.
    pub name: String,
    /// Websocket Endpoint for long living connections
    #[serde(skip_serializing)]
    pub ws_endpoint: RpcUrl,
    #[serde(skip_serializing)]
    pub suri: Option<Suri>,
}

@salman01zp salman01zp added p3 🔵 Issues should be resolved eventually p2 🟡 Issue should be resolved soon labels Sep 13, 2023
@salman01zp salman01zp removed the p3 🔵 Issues should be resolved eventually label Sep 18, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
p2 🟡 Issue should be resolved soon
Projects
None yet
Development

No branches or pull requests

1 participant