Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,7 @@ fork-tree = { version = "13.0.1" }
ureq = { version = "3.1.2", default-features = false }
url = { version = "2.5.7", default-features = false }
blockfrost-openapi = { version = "0.1.75", default-features = false }
chrono = { version = "0.4.31", default-features = false }

# substrate dependencies
frame-benchmarking = { default-features = false, git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2509" }
Expand Down
12 changes: 8 additions & 4 deletions demo/node/src/data_sources.rs
Original file line number Diff line number Diff line change
Expand Up @@ -107,18 +107,22 @@ pub async fn create_dolos_data_sources(
) -> std::result::Result<DataSources, Box<dyn Error + Send + Sync + 'static>> {
let dolos_client = partner_chains_dolos_data_sources::get_connection_from_env()?;
let pool = partner_chains_db_sync_data_sources::get_connection_from_env().await?;
let block = Arc::new(
let block_dbsync = Arc::new(
partner_chains_db_sync_data_sources::BlockDataSourceImpl::new_from_env(pool.clone())
.await?,
);
let block_dolos = Arc::new(
partner_chains_dolos_data_sources::BlockDataSourceImpl::new_from_env(dolos_client.clone())
.await?,
);
Ok(DataSources {
sidechain_rpc: Arc::new(
partner_chains_dolos_data_sources::SidechainRpcDataSourceImpl::new(
dolos_client.clone(),
),
),
mc_hash: Arc::new(partner_chains_dolos_data_sources::McHashDataSourceImpl::new(
dolos_client.clone(),
block_dolos.clone(),
)),
authority_selection: Arc::new(
partner_chains_dolos_data_sources::AuthoritySelectionDataSourceImpl::new(
Expand All @@ -137,15 +141,15 @@ pub async fn create_dolos_data_sources(
pool.clone(),
metrics_opt.clone(),
GOVERNED_MAP_CACHE_SIZE,
block.clone(),
block_dbsync.clone(),
)
.await?,
),
bridge: Arc::new(
partner_chains_db_sync_data_sources::CachedTokenBridgeDataSourceImpl::new(
pool,
metrics_opt,
block,
block_dbsync,
BRIDGE_TRANSFER_CACHE_LOOKAHEAD,
),
),
Expand Down
2 changes: 1 addition & 1 deletion dev/local-environment/setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
PARTNER_CHAINS_NODE_IMAGE="ghcr.io/input-output-hk/partner-chains/partner-chains-node-unstable:latest"
CARDANO_IMAGE="ghcr.io/intersectmbo/cardano-node:10.5.1"
DBSYNC_IMAGE="ghcr.io/intersectmbo/cardano-db-sync:13.6.0.5"
DOLOS_IMAGE="ghcr.io/txpipe/dolos:1.0.0-beta.8"
DOLOS_IMAGE="ghcr.io/txpipe/dolos:1.0.0-rc.2"
OGMIOS_IMAGE="cardanosolutions/ogmios:v6.13.0"
POSTGRES_IMAGE="postgres:17.2"
TESTS_IMAGE="python:3.12-slim"
Expand Down
2 changes: 1 addition & 1 deletion toolkit/data-sources/db-sync/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ sqlx = { workspace = true }
db-sync-sqlx = { workspace = true }
tokio = { workspace = true, features = ["full"] }
futures = { workspace = true }
chrono = "0.4.31"
chrono = { workspace = true }
hex = { workspace = true }
hex-literal = { workspace = true }
itertools = { workspace = true }
Expand Down
3 changes: 3 additions & 0 deletions toolkit/data-sources/db-sync/src/candidates/cached.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ pub type ArcMut<T> = Arc<Mutex<T>>;

type AriadneParametersCacheKey = (McEpochNumber, PolicyId, PolicyId);
type CandidatesCacheKey = (McEpochNumber, String);
/// Cached candidate data source
pub struct CandidateDataSourceCached {
inner: CandidatesDataSourceImpl,
get_ariadne_parameters_for_epoch_cache:
Expand Down Expand Up @@ -96,6 +97,7 @@ impl CandidateDataSourceCacheConfig {
}

impl CandidateDataSourceCached {
/// Creates new instance of the data source
pub fn new(
inner: CandidatesDataSourceImpl,
candidates_for_epoch_cache_size: usize,
Expand All @@ -114,6 +116,7 @@ impl CandidateDataSourceCached {
}
}

/// Creates a new instance of the data source, reading configuration from the environment.
pub fn new_from_env(
inner: CandidatesDataSourceImpl,
candidates_for_epoch_cache_size: usize,
Expand Down
2 changes: 1 addition & 1 deletion toolkit/data-sources/db-sync/src/candidates/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ use sqlx::PgPool;
use std::collections::HashMap;
use std::error::Error;

mod cached;
pub mod cached;

#[cfg(test)]
mod tests;
Expand Down
2 changes: 1 addition & 1 deletion toolkit/data-sources/db-sync/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ pub use crate::block::{BlockDataSourceImpl, DbSyncBlockDataSourceConfig};
#[cfg(feature = "bridge")]
pub use crate::bridge::{TokenBridgeDataSourceImpl, cache::CachedTokenBridgeDataSourceImpl};
#[cfg(feature = "candidate-source")]
pub use crate::candidates::CandidatesDataSourceImpl;
pub use crate::candidates::{CandidatesDataSourceImpl, cached::CandidateDataSourceCached};
#[cfg(feature = "governed-map")]
pub use crate::governed_map::{GovernedMapDataSourceCachedImpl, GovernedMapDataSourceImpl};
#[cfg(feature = "mc-hash")]
Expand Down
3 changes: 3 additions & 0 deletions toolkit/data-sources/dolos/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@ cardano-serialization-lib = { workspace = true }
itertools = { workspace = true }
figment = { workspace = true }
tokio = { workspace = true }
derive-new = { workspace = true }
chrono = { workspace = true }
bech32 = { workspace = true }

[features]
default = []
Expand Down
Loading
Loading