Skip to content

Commit

Permalink
Merge branch 'main' into refactor/da/backend/celestia
Browse files Browse the repository at this point in the history
  • Loading branch information
popcnt1 authored Nov 14, 2024
2 parents 53be2b7 + 807fda0 commit 8b3eccd
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/docker_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -92,5 +92,5 @@ jobs:
chmod 600 private_key.pem
sudo apt update
sudo apt install -y --no-install-recommends openssh-server
ssh -o StrictHostKeyChecking=no -i private_key.pem $USER@$HOST bash -c "'sleep 30' && docker image prune -a -f && docker ps | grep main_debug | awk '{print \$1}' | xargs -r docker stop && docker ps -a | grep main_debug | awk '{print \$1}' | xargs -r docker rm -f && docker pull 'ghcr.io/rooch-network/rooch:main_debug' && docker run --rm -v /root:/root ghcr.io/rooch-network/rooch:main_debug server clean -n dev -f && docker run -d -v /root:/root -p 6767:6767 -p 9184:9184 'ghcr.io/rooch-network/rooch:main_debug' server start -n dev --btc-rpc-url '${{secrets.BTC_REGTEST_RPC_URL}}' --btc-rpc-username rooch-regtest --btc-rpc-password '${{secrets.BTC_REGTEST_RPC_PWD}}' --da '{\"da-backend\": {\"backends\": [{\"open-da\": {\"scheme\": \"fs\"}}]}}' --traffic-burst-size 100000 --traffic-per-second 1"
ssh -o StrictHostKeyChecking=no -i private_key.pem $USER@$HOST bash -c "'sleep 30' && docker image prune -a -f && docker ps | grep main_debug | awk '{print \$1}' | xargs -r docker stop && docker ps -a | grep main_debug | awk '{print \$1}' | xargs -r docker rm -f && docker pull 'ghcr.io/rooch-network/rooch:main_debug' && docker run --rm -v /root:/root ghcr.io/rooch-network/rooch:main_debug server clean -n dev -f && docker run -d -v /root:/root -p 6767:6767 -p 9184:9184 'ghcr.io/rooch-network/rooch:main_debug' server start -n dev --btc-rpc-url '${{secrets.BTC_REGTEST_RPC_URL}}' --btc-rpc-username rooch-regtest --btc-rpc-password '${{secrets.BTC_REGTEST_RPC_PWD}}' --da '{\"da-backend\": {\"backends\": [{\"open-da\": {\"scheme\": \"fs\", \"config\": {}}}]}}' --traffic-burst-size 100000 --traffic-per-second 1"
ssh -o StrictHostKeyChecking=no -i private_key.pem $USER@$HOST "cd /root/rooch && git pull origin main && bash scripts/check_dev_deploy_status.sh main_debug '${{ secrets.TESTNET_MNEMONIC_PHRASE }}'"
28 changes: 26 additions & 2 deletions crates/rooch-config/src/da_config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -297,6 +297,7 @@ mod tests {
let da_config_str = r#"{"da-backend": {"submit-strategy": "all",
"backends": [{"open-da": {"scheme": "gcs", "config": {"bucket": "test-bucket", "credential": "test-credential"}}},
{"open-da": {"scheme": "celestia", "config": {"endpoint": "test-conn", "auth_token": "test-auth"}, "namespace": "000000000000000000000000000000000000000102030405060708090a"}}]}}"#;
{"open-da": {"scheme": "fs", "config": {}}}]}}"#;

let exp_gcs_config = DABackendOpenDAConfig {
scheme: OpenDAScheme::Gcs,
Expand All @@ -320,14 +321,19 @@ mod tests {
namespace: Some(
"000000000000000000000000000000000000000102030405060708090a".to_string(),
),
let exp_fs_config = DABackendOpenDAConfig {
scheme: OpenDAScheme::Fs,
config: HashMap::new(),
namespace: None,
max_segment_size: None,
};
let exp_da_config = DAConfig {
da_backend: Some(DABackendConfig {
submit_strategy: Some(DAServerSubmitStrategy::All),
backends: vec![
DABackendConfigType::OpenDa(exp_gcs_config.clone()),
DABackendConfigType::OpenDa(exp_celestia_config.clone()),
DABackendConfigType::Celestia(exp_celestia_config.clone()),
DABackendConfigType::OpenDa(exp_openda_config.clone()),
DABackendConfigType::OpenDa(exp_fs_config.clone()),
],
background_submit_interval: None,
}),
Expand All @@ -345,5 +351,23 @@ mod tests {
panic!("Error parsing DA Config: {}", e)
}
}

let da_config_str = "{\"da-backend\": {\"backends\": [{\"open-da\": {\"scheme\": \"fs\", \"config\": {}}}]}}";
let exp_da_config = DAConfig {
da_backend: Some(DABackendConfig {
submit_strategy: None,
backends: vec![DABackendConfigType::OpenDa(exp_fs_config.clone())],
background_submit_interval: None,
}),
base: None,
};
match DAConfig::from_str(da_config_str) {
Ok(da_config) => {
assert_eq!(da_config, exp_da_config);
}
Err(e) => {
panic!("Error parsing DA Config: {}", e)
}
}
}
}

0 comments on commit 8b3eccd

Please sign in to comment.