-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(da-clients): add Celestia client
- Loading branch information
1 parent
46e7348
commit f7d2ccb
Showing
31 changed files
with
1,217 additions
and
249 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,18 @@ | ||
use serde::Deserialize; | ||
use zksync_basic_types::seed_phrase::SeedPhrase; | ||
use zksync_basic_types::secrets::SeedPhrase; | ||
|
||
#[derive(Clone, Debug, PartialEq, Deserialize)] | ||
#[derive(Clone, Debug, Default, PartialEq, Deserialize)] | ||
pub struct AvailConfig { | ||
pub api_node_url: String, | ||
pub bridge_api_url: String, | ||
pub app_id: u32, | ||
pub timeout: usize, | ||
pub max_retries: usize, | ||
#[serde(skip)] | ||
pub secrets: Option<AvailSecrets>, | ||
} | ||
|
||
#[derive(Clone, Debug, PartialEq)] | ||
pub struct AvailSecrets { | ||
pub seed_phrase: Option<SeedPhrase>, | ||
pub seed_phrase: SeedPhrase, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
use serde::Deserialize; | ||
use zksync_basic_types::secrets::PrivateKey; | ||
|
||
#[derive(Clone, Debug, Default, PartialEq, Deserialize)] | ||
pub struct CelestiaConfig { | ||
pub api_node_url: String, | ||
pub namespace: String, | ||
#[serde(skip)] | ||
pub secrets: Option<CelestiaSecrets>, | ||
} | ||
|
||
#[derive(Clone, Debug, PartialEq)] | ||
pub struct CelestiaSecrets { | ||
pub private_key: PrivateKey, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,15 @@ | ||
use crate::{AvailConfig, ObjectStoreConfig}; | ||
use crate::{AvailConfig, CelestiaConfig, ObjectStoreConfig}; | ||
|
||
pub mod avail; | ||
pub mod celestia; | ||
|
||
pub const AVAIL_CLIENT_CONFIG_NAME: &str = "Avail"; | ||
pub const CELESTIA_CLIENT_CONFIG_NAME: &str = "Celestia"; | ||
pub const OBJECT_STORE_CLIENT_CONFIG_NAME: &str = "ObjectStore"; | ||
|
||
#[derive(Debug, Clone, PartialEq)] | ||
pub enum DAClientConfig { | ||
Avail(AvailConfig), | ||
Celestia(CelestiaConfig), | ||
ObjectStore(ObjectStoreConfig), | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.