Skip to content

Commit

Permalink
Merge pull request #1451 from input-output-hk/ensemble/1435-gather-st…
Browse files Browse the repository at this point in the history
…ore-cardano-transactions

Gather and store Cardano transactions from immutable files
  • Loading branch information
jpraynaud authored Jan 24, 2024
2 parents aace2ac + d008636 commit 88c59ab
Show file tree
Hide file tree
Showing 47 changed files with 1,851 additions and 91 deletions.
78 changes: 74 additions & 4 deletions Cargo.lock

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

4 changes: 2 additions & 2 deletions demo/protocol-demo/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "mithrildemo"
version = "0.1.27"
version = "0.1.28"
authors = { workspace = true }
edition = { workspace = true }
documentation = { workspace = true }
Expand All @@ -14,7 +14,7 @@ blake2 = "0.10.6"
clap = { version = "4.4.6", features = ["derive"] }
hex = "0.4.3"
log = "0.4.20"
mithril-common = { path = "../../mithril-common" }
mithril-common = { path = "../../mithril-common", features = ["fs"] }
rand_chacha = "0.3.1"
rand_core = "0.6.4"
serde = { version = "1.0.188", features = ["derive"] }
Expand Down
2 changes: 1 addition & 1 deletion mithril-aggregator/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "mithril-aggregator"
version = "0.4.27"
version = "0.4.28"
description = "A Mithril Aggregator server"
authors = { workspace = true }
edition = { workspace = true }
Expand Down
26 changes: 26 additions & 0 deletions mithril-aggregator/src/database/cardano_transaction_migration.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
//! Migration module for cardano transactions store
//!
use mithril_common::database::SqlMigration;

/// Get all the migrations required by this version of the software.
/// There shall be one migration per database version. There could be several
/// statements per migration.
pub fn get_migrations() -> Vec<SqlMigration> {
vec![
// Migration 1
// Add the `cardano_tx` table.
SqlMigration::new(
1,
r#"
create table cardano_tx (
transaction_hash text not null,
block_number integer not null,
immutable_file_number integer not null,
primary key (transaction_hash)
);
create unique index cardano_tx_immutable_file_number_index on cardano_tx(immutable_file_number);
"#,
),
]
}
2 changes: 2 additions & 0 deletions mithril-aggregator/src/database/mod.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
//! database module.
//! This module contains the entities definition tied with database
//! representation with their associated providers.

pub mod cardano_transaction_migration;
pub mod migration;
pub mod provider;
Loading

0 comments on commit 88c59ab

Please sign in to comment.