Skip to content

Commit

Permalink
Merge branch 'main' into dependabot/npm_and_yarn/utilities/wallet-tes…
Browse files Browse the repository at this point in the history
…ter/vite-5.4.7
  • Loading branch information
stevenj committed Sep 26, 2024
2 parents 4d52c66 + 4327abb commit 8f064fd
Show file tree
Hide file tree
Showing 155 changed files with 5,491 additions and 804 deletions.
1 change: 1 addition & 0 deletions .config/dictionaries/project.dic
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
aapt
aarch
abnf
addr
addrr
adminer
afinet
Expand Down
11 changes: 2 additions & 9 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,6 @@ permissions:

jobs:
ci:
uses: input-output-hk/catalyst-ci/.github/workflows/ci.yml@master
uses: input-output-hk/catalyst-forge/.github/workflows/ci.yml@master
with:
aws_ecr_registry: 332405224602.dkr.ecr.eu-central-1.amazonaws.com
aws_role_arn: arn:aws:iam::332405224602:role/ci
aws_region: eu-central-1
secrets:
dockerhub_token: ${{ secrets.DOCKERHUB_TOKEN }}
dockerhub_username: ${{ secrets.DOCKERHUB_USERNAME }}
earthly_runner_address: ${{ secrets.EARTHLY_SATELLITE_ADDRESS }}
earthly_runner_secret: ${{ secrets.EARTHLY_RUNNER_SECRET }}
forge_version: latest
2 changes: 1 addition & 1 deletion .github/workflows/nightly-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ jobs:
if: always()
continue-on-error: true
with:
earthfile: ./catalyst_voices_packages/catalyst_cardano/catalyst_cardano/test/wallet-automation/
earthfile: ./catalyst_voices_packages/catalyst_cardano/catalyst_cardano/wallet-automation/
flags: --allow-privileged
targets: nightly-test
target_flags:
Expand Down
6 changes: 3 additions & 3 deletions Earthfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
VERSION 0.8

IMPORT github.com/input-output-hk/catalyst-ci/earthly/mdlint:v3.2.03 AS mdlint-ci
IMPORT github.com/input-output-hk/catalyst-ci/earthly/cspell:v3.2.03 AS cspell-ci
IMPORT github.com/input-output-hk/catalyst-ci/earthly/postgresql:v3.2.03 AS postgresql-ci
IMPORT github.com/input-output-hk/catalyst-ci/earthly/mdlint:v3.2.07 AS mdlint-ci
IMPORT github.com/input-output-hk/catalyst-ci/earthly/cspell:v3.2.07 AS cspell-ci
IMPORT github.com/input-output-hk/catalyst-ci/earthly/postgresql:v3.2.07 AS postgresql-ci

FROM debian:stable-slim

Expand Down
51 changes: 51 additions & 0 deletions blueprint.cue
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
version: "1.0"
global: {
ci: {
local: [
"^check(-.*)?$",
"^build(-.*)?$",
"^package(-.*)?$",
"^test(-.*)?$",
"^release(-.*)?$",
"^publish(-.*)?$",
]
registries: [
ci.providers.aws.registry,
]
providers: {
aws: {
region: "eu-central-1"
registry: "332405224602.dkr.ecr.eu-central-1.amazonaws.com"
role: "arn:aws:iam::332405224602:role/ci"
}

docker: credentials: {
provider: "aws"
path: "global/ci/docker"
}

earthly: {
credentials: {
provider: "aws"
path: "global/ci/earthly"
}
org: "Catalyst"
satellite: "ci"
version: "0.8.15"
}

github: registry: "ghcr.io"
}
secrets: [
{
name: "GITHUB_TOKEN"
optional: true
provider: "env"
path: "GITHUB_TOKEN"
},
]
tagging: {
strategy: "commit"
}
}
}
4 changes: 2 additions & 2 deletions catalyst-gateway/Earthfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
VERSION 0.8

IMPORT github.com/input-output-hk/catalyst-ci/earthly/rust:v3.2.03 AS rust-ci
IMPORT github.com/input-output-hk/catalyst-ci/earthly/rust:v3.2.07 AS rust-ci

#cspell: words rustfmt toolsets USERARCH stdcfgs

Expand Down Expand Up @@ -62,7 +62,7 @@ all-hosts-build:
package-cat-gateway:
ARG tag="latest"

FROM alpine:3.19
FROM alpine:3.20.3
WORKDIR /cat-gateway

RUN apk add --no-cache gcc bash
Expand Down
4 changes: 2 additions & 2 deletions catalyst-gateway/Justfile
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,12 @@ build-cat-gateway: code-format code-lint
# Run cat-gateway natively on preprod
run-cat-gateway: build-cat-gateway
CHAIN_FOLLOWER_SYNC_TASKS="16" \
RUST_LOG="error,cat-gateway=debug,cardano_chain_follower=debug,mithril-client=debug" \
RUST_LOG="error,cat_gateway=debug,cardano_chain_follower=debug,mithril-client=debug" \
CHAIN_NETWORK="Preprod" \
./target/release/cat-gateway run --log-level debug

# Run cat-gateway natively on mainnet
run-cat-gateway-mainnet: build-cat-gateway
CHAIN_FOLLOWER_SYNC_TASKS="1" \
RUST_LOG="error,cat-gateway=debug,cardano_chain_follower=debug,mithril-client=debug" \
RUST_LOG="error,cat_gateway=debug,cardano_chain_follower=debug,mithril-client=debug" \
./target/release/cat-gateway run --log-level debug
14 changes: 9 additions & 5 deletions catalyst-gateway/bin/src/cardano/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ use tracing::{error, info, warn};

use crate::{
db::index::{block::index_block, session::CassandraSession},
settings::Settings,
settings::{chain_follower, Settings},
};

// pub(crate) mod cip36_registration_obsolete;
Expand All @@ -26,9 +26,13 @@ const MAX_BLOCKS_BATCH_LEN: usize = 1024;
const INDEXING_DB_READY_WAIT_INTERVAL: Duration = Duration::from_secs(1);

/// Start syncing a particular network
async fn start_sync_for(chain: Network) -> anyhow::Result<()> {
let cfg = ChainSyncConfig::default_for(chain);
info!(chain = %cfg.chain, "Starting Blockchain Sync");
async fn start_sync_for(cfg: &chain_follower::EnvVars) -> anyhow::Result<()> {
let chain = cfg.chain;
let dl_config = cfg.dl_config.clone();

let mut cfg = ChainSyncConfig::default_for(chain);
cfg.mithril_cfg = cfg.mithril_cfg.with_dl_config(dl_config);
info!(chain = %chain, "Starting Blockchain Sync");

if let Err(error) = cfg.run().await {
error!(chain=%chain, error=%error, "Failed to start chain sync task");
Expand Down Expand Up @@ -275,7 +279,7 @@ pub(crate) async fn start_followers() -> anyhow::Result<()> {
cfg.log();

// Start Syncing the blockchain, so we can consume its data as required.
start_sync_for(cfg.chain).await?;
start_sync_for(&cfg).await?;
info!(chain=%cfg.chain,"Chain Sync is started.");

tokio::spawn(async move {
Expand Down
6 changes: 3 additions & 3 deletions catalyst-gateway/bin/src/db/index/block/certs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ use crate::{
session::CassandraSession,
},
service::utilities::convert::from_saturating,
settings::CassandraEnvVars,
settings::cassandra_db,
};

/// Insert TXI Query and Parameters
Expand Down Expand Up @@ -109,7 +109,7 @@ impl StakeRegistrationInsertQuery {

/// Prepare Batch of Insert TXI Index Data Queries
pub(crate) async fn prepare_batch(
session: &Arc<Session>, cfg: &CassandraEnvVars,
session: &Arc<Session>, cfg: &cassandra_db::EnvVars,
) -> anyhow::Result<SizedBatch> {
let insert_queries = PreparedQueries::prepare_batch(
session.clone(),
Expand Down Expand Up @@ -145,7 +145,7 @@ impl CertInsertQuery {

/// Prepare Batch of Insert TXI Index Data Queries
pub(crate) async fn prepare_batch(
session: &Arc<Session>, cfg: &CassandraEnvVars,
session: &Arc<Session>, cfg: &cassandra_db::EnvVars,
) -> anyhow::Result<SizedBatch> {
// Note: for now we have one query, but there are many certs, and later we may have more
// to add here.
Expand Down
4 changes: 2 additions & 2 deletions catalyst-gateway/bin/src/db/index/block/cip36/insert_cip36.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ use tracing::error;

use crate::{
db::index::queries::{PreparedQueries, SizedBatch},
settings::CassandraEnvVars,
settings::cassandra_db,
};

/// Index Registration by Stake Address
Expand Down Expand Up @@ -82,7 +82,7 @@ impl Params {

/// Prepare Batch of Insert CIP-36 Registration Index Data Queries
pub(super) async fn prepare_batch(
session: &Arc<Session>, cfg: &CassandraEnvVars,
session: &Arc<Session>, cfg: &cassandra_db::EnvVars,
) -> anyhow::Result<SizedBatch> {
let insert_queries = PreparedQueries::prepare_batch(
session.clone(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ use tracing::error;

use crate::{
db::index::queries::{PreparedQueries, SizedBatch},
settings::CassandraEnvVars,
settings::cassandra_db,
};

/// Index Registration by Vote Key
Expand Down Expand Up @@ -49,7 +49,7 @@ impl Params {

/// Prepare Batch of Insert CIP-36 Registration Index Data Queries
pub(super) async fn prepare_batch(
session: &Arc<Session>, cfg: &CassandraEnvVars,
session: &Arc<Session>, cfg: &cassandra_db::EnvVars,
) -> anyhow::Result<SizedBatch> {
let insert_queries = PreparedQueries::prepare_batch(
session.clone(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ use tracing::error;

use crate::{
db::index::queries::{PreparedQueries, SizedBatch},
settings::CassandraEnvVars,
settings::cassandra_db,
};

/// Index Registration by Stake Address (Invalid Registrations)
Expand Down Expand Up @@ -99,7 +99,7 @@ impl Params {

/// Prepare Batch of Insert CIP-36 Registration Index Data Queries
pub(super) async fn prepare_batch(
session: &Arc<Session>, cfg: &CassandraEnvVars,
session: &Arc<Session>, cfg: &cassandra_db::EnvVars,
) -> anyhow::Result<SizedBatch> {
let insert_queries = PreparedQueries::prepare_batch(
session.clone(),
Expand Down
4 changes: 2 additions & 2 deletions catalyst-gateway/bin/src/db/index/block/cip36/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ use crate::{
queries::{FallibleQueryTasks, PreparedQuery, SizedBatch},
session::CassandraSession,
},
settings::CassandraEnvVars,
settings::cassandra_db,
};

/// Insert CIP-36 Registration Queries
Expand All @@ -39,7 +39,7 @@ impl Cip36InsertQuery {

/// Prepare Batch of Insert Cip36 Registration Data Queries
pub(crate) async fn prepare_batch(
session: &Arc<Session>, cfg: &CassandraEnvVars,
session: &Arc<Session>, cfg: &cassandra_db::EnvVars,
) -> anyhow::Result<(SizedBatch, SizedBatch, SizedBatch)> {
let insert_cip36_batch = insert_cip36::Params::prepare_batch(session, cfg).await;
let insert_cip36_invalid_batch =
Expand Down
4 changes: 2 additions & 2 deletions catalyst-gateway/bin/src/db/index/block/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ pub(crate) mod txo;
use cardano_chain_follower::MultiEraBlock;
use certs::CertInsertQuery;
use cip36::Cip36InsertQuery;
use tracing::{debug, error};
use tracing::error;
use txi::TxiInsertQuery;
use txo::TxoInsertQuery;

Expand Down Expand Up @@ -75,7 +75,7 @@ pub(crate) async fn index_block(block: &MultiEraBlock) -> anyhow::Result<()> {
match handle.await {
Ok(join_res) => {
match join_res {
Ok(res) => debug!(res=?res,"Query OK"),
Ok(_res) => {}, // debug!(res=?res,"Query OK")
Err(error) => {
// IF a query fails, assume everything else is broken.
error!(error=%error,"Query Failed");
Expand Down
4 changes: 2 additions & 2 deletions catalyst-gateway/bin/src/db/index/block/txi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ use crate::{
queries::{FallibleQueryTasks, PreparedQueries, PreparedQuery, SizedBatch},
session::CassandraSession,
},
settings::CassandraEnvVars,
settings::cassandra_db,
};

/// Insert TXI Query and Parameters
Expand Down Expand Up @@ -54,7 +54,7 @@ impl TxiInsertQuery {

/// Prepare Batch of Insert TXI Index Data Queries
pub(crate) async fn prepare_batch(
session: &Arc<Session>, cfg: &CassandraEnvVars,
session: &Arc<Session>, cfg: &cassandra_db::EnvVars,
) -> anyhow::Result<SizedBatch> {
let txi_insert_queries = PreparedQueries::prepare_batch(
session.clone(),
Expand Down
4 changes: 2 additions & 2 deletions catalyst-gateway/bin/src/db/index/block/txo/insert_txo.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ use tracing::error;

use crate::{
db::index::queries::{PreparedQueries, SizedBatch},
settings::CassandraEnvVars,
settings::cassandra_db,
};

/// TXO by Stake Address Indexing query
Expand Down Expand Up @@ -54,7 +54,7 @@ impl Params {

/// Prepare Batch of Staked Insert TXO Asset Index Data Queries
pub(super) async fn prepare_batch(
session: &Arc<Session>, cfg: &CassandraEnvVars,
session: &Arc<Session>, cfg: &cassandra_db::EnvVars,
) -> anyhow::Result<SizedBatch> {
let txo_insert_queries = PreparedQueries::prepare_batch(
session.clone(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use tracing::error;

use crate::{
db::index::queries::{PreparedQueries, SizedBatch},
settings::CassandraEnvVars,
settings::cassandra_db,
};

/// TXO Asset by Stake Address Indexing Query
Expand Down Expand Up @@ -56,7 +56,7 @@ impl Params {

/// Prepare Batch of Staked Insert TXO Asset Index Data Queries
pub(super) async fn prepare_batch(
session: &Arc<Session>, cfg: &CassandraEnvVars,
session: &Arc<Session>, cfg: &cassandra_db::EnvVars,
) -> anyhow::Result<SizedBatch> {
let txo_insert_queries = PreparedQueries::prepare_batch(
session.clone(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use tracing::error;

use crate::{
db::index::queries::{PreparedQueries, SizedBatch},
settings::CassandraEnvVars,
settings::cassandra_db,
};

/// Unstaked TXO by Stake Address Indexing query
Expand Down Expand Up @@ -47,7 +47,7 @@ impl Params {

/// Prepare Batch of Staked Insert TXO Asset Index Data Queries
pub(super) async fn prepare_batch(
session: &Arc<Session>, cfg: &CassandraEnvVars,
session: &Arc<Session>, cfg: &cassandra_db::EnvVars,
) -> anyhow::Result<SizedBatch> {
let txo_insert_queries = PreparedQueries::prepare_batch(
session.clone(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use tracing::error;

use crate::{
db::index::queries::{PreparedQueries, SizedBatch},
settings::CassandraEnvVars,
settings::cassandra_db,
};

/// Unstaked TXO Asset by Stake Address Indexing Query
Expand Down Expand Up @@ -56,7 +56,7 @@ impl Params {

/// Prepare Batch of Staked Insert TXO Asset Index Data Queries
pub(super) async fn prepare_batch(
session: &Arc<Session>, cfg: &CassandraEnvVars,
session: &Arc<Session>, cfg: &cassandra_db::EnvVars,
) -> anyhow::Result<SizedBatch> {
let txo_insert_queries = PreparedQueries::prepare_batch(
session.clone(),
Expand Down
4 changes: 2 additions & 2 deletions catalyst-gateway/bin/src/db/index/block/txo/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ use crate::{
session::CassandraSession,
},
service::utilities::convert::from_saturating,
settings::CassandraEnvVars,
settings::cassandra_db,
};

/// This is used to indicate that there is no stake address.
Expand Down Expand Up @@ -52,7 +52,7 @@ impl TxoInsertQuery {

/// Prepare Batch of Insert TXI Index Data Queries
pub(crate) async fn prepare_batch(
session: &Arc<Session>, cfg: &CassandraEnvVars,
session: &Arc<Session>, cfg: &cassandra_db::EnvVars,
) -> anyhow::Result<(SizedBatch, SizedBatch, SizedBatch, SizedBatch)> {
let txo_staked_insert_batch = insert_txo::Params::prepare_batch(session, cfg).await;
let txo_unstaked_insert_batch =
Expand Down
Loading

0 comments on commit 8f064fd

Please sign in to comment.