Skip to content

Commit 2a5347c

Browse files
committed
Add skip-cardano-bin-download option in e2e
This option allows to use directly the cardano-cli & cardano-node binary files in the /mithril-devnet directory, without having to download them on IOHK github repository
1 parent 40bd071 commit 2a5347c

File tree

3 files changed

+22
-4
lines changed

3 files changed

+22
-4
lines changed

mithril-test-lab/mithril-devnet/devnet-mkfiles.sh

+12-4
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,12 @@ NUM_POOL_NODES=$3
4141
SLOT_LENGTH=$4
4242
EPOCH_LENGTH=$5
4343

44+
if [[ "$SKIP_CARDANO_BIN_DOWNLOAD" = "true" ]]; then
45+
SKIP_CARDANO_BIN_DOWNLOAD=true
46+
else
47+
SKIP_CARDANO_BIN_DOWNLOAD=false
48+
fi
49+
4450
SUPPLY=100000000000
4551
NETWORK_MAGIC=42
4652
SECURITY_PARAM=2
@@ -105,10 +111,12 @@ if ! mkdir -p "${ROOT}"; then
105111
exit
106112
fi
107113

108-
# download cardano-cli & cardano-node
109-
curl -sL ${CARDANO_BINARY_URL} --output cardano-bin.tar.gz
110-
tar xzf cardano-bin.tar.gz ./cardano-cli ./cardano-node
111-
rm -f cardano-bin.tar.gz
114+
# download cardano-cli & cardano-node if enabled (default: yes)
115+
if [ "$SKIP_CARDANO_BIN_DOWNLOAD" = false ]; then
116+
curl -sL ${CARDANO_BINARY_URL} --output cardano-bin.tar.gz
117+
tar xzf cardano-bin.tar.gz ./cardano-cli ./cardano-node
118+
rm -f cardano-bin.tar.gz
119+
fi
112120

113121
# and copy cardano-cli & cardano-node
114122
cp cardano-cli ${ROOT}/cardano-cli

mithril-test-lab/mithril-end-to-end/src/devnet/runner.rs

+5
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ impl Devnet {
5959
number_of_pool_nodes: u8,
6060
cardano_slot_length: f64,
6161
cardano_epoch_length: f64,
62+
skip_cardano_bin_download: bool,
6263
) -> Result<Devnet, String> {
6364
let bootstrap_script = "devnet-mkfiles.sh";
6465
let bootstrap_script_path = devnet_scripts_dir
@@ -79,6 +80,10 @@ impl Devnet {
7980
}
8081

8182
let mut bootstrap_command = Command::new(&bootstrap_script_path);
83+
bootstrap_command.env(
84+
"SKIP_CARDANO_BIN_DOWNLOAD",
85+
skip_cardano_bin_download.to_string(),
86+
);
8287
let command_args = &[
8388
artifacts_target_dir.to_str().unwrap(),
8489
&number_of_bft_nodes.to_string(),

mithril-test-lab/mithril-end-to-end/src/main.rs

+5
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,10 @@ pub struct Args {
5757
/// Enable run only mode
5858
#[clap(long)]
5959
run_only: bool,
60+
61+
/// Skip cardano binaries download
62+
#[clap(long)]
63+
skip_cardano_bin_download: bool,
6064
}
6165

6266
#[tokio::main]
@@ -84,6 +88,7 @@ async fn main() -> Result<(), Box<dyn Error>> {
8488
args.number_of_pool_nodes,
8589
args.cardano_slot_length,
8690
args.cardano_epoch_length,
91+
args.skip_cardano_bin_download,
8792
)
8893
.await?;
8994

0 commit comments

Comments
 (0)