diff --git a/scripts/update_mina.sh b/scripts/update_mina.sh new file mode 100755 index 0000000..131af16 --- /dev/null +++ b/scripts/update_mina.sh @@ -0,0 +1,35 @@ +#!/bin/bash +# This script is used to update the mina daemon and archive node version in the project. +# Usage: +# 1. Update the variables below to the desired versions +# 2. ./scripts/update_mina.sh + +daemon_old="gcr.io/o1labs-192920/mina-daemon:2.0.0rampup6-4061884-bullseye-berkeley" +daemon_new="gcr.io/o1labs-192920/mina-daemon:2.0.0rampup7-4a0fff9-bullseye-berkeley" + +archive_old="gcr.io/o1labs-192920/mina-archive:2.0.0rampup6-4061884-bullseye" +archive_new="gcr.io/o1labs-192920/mina-archive:2.0.0rampup7-4a0fff9-bullseye" + +commit_old="4061884" +commit_new="4a0fff9" + +escape_slashes() { + echo "$1" | sed 's_/_\\/_g' +} + +daemon_old_escaped=$(escape_slashes "$daemon_old") +daemon_new_escaped=$(escape_slashes "$daemon_new") +archive_old_escaped=$(escape_slashes "$archive_old") +archive_new_escaped=$(escape_slashes "$archive_new") + +# Function to generate the sed command +generate_sed_command() { + echo "sed -i 's|$1|$2|g;s|$3|$4|g;s|$5|$6|g' \$1" +} + +# Generate the sed command +sed_command=$(generate_sed_command "$daemon_old_escaped" "$daemon_new_escaped" "$archive_old_escaped" "$archive_new_escaped" "$commit_old" "$commit_new") + +# Apply replacements in files under 'src' and 'tests' directories +find "./src" -type f -exec bash -c "$sed_command" bash {} \; +find "./tests" -type f -exec bash -c "$sed_command" bash {} \; diff --git a/src/main.rs b/src/main.rs index ce34042..1141c52 100644 --- a/src/main.rs +++ b/src/main.rs @@ -38,11 +38,13 @@ const LEAST_COMPOSE_VERSION: &str = "2.21.0"; // Hardcoded daemon image for default network const DEFAULT_DAEMON_DOCKER_IMAGE: &str = - "gcr.io/o1labs-192920/mina-daemon:2.0.0rampup6-4061884-bullseye-berkeley"; + "gcr.io/o1labs-192920/mina-daemon:2.0.0rampup7-4a0fff9-bullseye-berkeley"; // Hardcoded archive image for default network const DEFAULT_ARCHIVE_DOCKER_IMAGE: &str = - "gcr.io/o1labs-192920/mina-archive:2.0.0rampup6-4061884-bullseye"; + "gcr.io/o1labs-192920/mina-archive:2.0.0rampup7-4a0fff9-bullseye"; + +const IMAGE_COMMIT_HASH: &str = "4a0fff9"; // Timeout in seconds for waiting operations const TIMEOUT_IN_SECS: u16 = 180; @@ -889,8 +891,8 @@ fn generate_default_topology( peers: Some(vec![peer]), archive_docker_image: Some(docker_image_archive.into()), archive_schema_files: Some(vec![ - "https://raw.githubusercontent.com/MinaProtocol/mina/4061884b18137c1182c7fcfa80f52804008a2509/src/app/archive/zkapp_tables.sql".into(), - "https://raw.githubusercontent.com/MinaProtocol/mina/4061884b18137c1182c7fcfa80f52804008a2509/src/app/archive/create_schema.sql".into(), + format!("https://raw.githubusercontent.com/MinaProtocol/mina/{IMAGE_COMMIT_HASH}/src/app/archive/zkapp_tables.sql"), + format!("https://raw.githubusercontent.com/MinaProtocol/mina/{IMAGE_COMMIT_HASH}/src/app/archive/create_schema.sql"), ]), archive_port: Some(3086), ..Default::default() diff --git a/tests/data/large_network/topology.json b/tests/data/large_network/topology.json index 9c847ed..be66497 100644 --- a/tests/data/large_network/topology.json +++ b/tests/data/large_network/topology.json @@ -3,7 +3,7 @@ "pk": "B62qqYWdCfrjEznYNc7fsve5Rk5wuho9KwZa2bntKZBdshz1M6RsBna", "sk": "EKERBeqQE7GLuD9xtCBCGYNAyXpYX8UnXBTkg6rbvwT2LKPYiDdF", "role": "Snark_coordinator", - "docker_image": "gcr.io/o1labs-192920/mina-daemon:2.0.0rampup6-4061884-bullseye-berkeley", + "docker_image": "gcr.io/o1labs-192920/mina-daemon:2.0.0rampup7-4a0fff9-bullseye-berkeley", "git_build": null, "worker_nodes": 2, "snark_worker_fee": "0.0001", @@ -26,12 +26,12 @@ "pk": "B62qjw6nhuPRERVeUwwEdT7KAcEg7D8pUiKdDmf7Ny1W7utcq9UKw1q", "sk": "EKFbpuwm2ALsgDXy7NSpmEaDF62W6ULMSzdV8haSCaHeizFCHcDm", "role": "Archive_node", - "docker_image": "gcr.io/o1labs-192920/mina-daemon:2.0.0rampup6-4061884-bullseye-berkeley", - "archive_image": "gcr.io/o1labs-192920/mina-archive:2.0.0rampup6-4061884-bullseye", + "docker_image": "gcr.io/o1labs-192920/mina-daemon:2.0.0rampup7-4a0fff9-bullseye-berkeley", + "archive_image": "gcr.io/o1labs-192920/mina-archive:2.0.0rampup7-4a0fff9-bullseye", "git_build": null, "schema_files": [ - "https://raw.githubusercontent.com/MinaProtocol/mina/4061884b18137c1182c7fcfa80f52804008a2509/src/app/archive/create_schema.sql", - "https://raw.githubusercontent.com/MinaProtocol/mina/4061884b18137c1182c7fcfa80f52804008a2509/src/app/archive/zkapp_tables.sql" + "https://raw.githubusercontent.com/MinaProtocol/mina/4a0fff9/src/app/archive/create_schema.sql", + "https://raw.githubusercontent.com/MinaProtocol/mina/4a0fff9/src/app/archive/zkapp_tables.sql" ], "libp2p_pass": "naughty blue worm", "libp2p_keyfile": "./tests/data/large_network/libp2p_keys/archive_node.json", @@ -53,7 +53,7 @@ "sk": "EKF4pbSdHbXjSXJLWhcgqH3gLzcihNH7uxhxpsoB74JabufNT2p2", "privkey_path": "./tests/data/large_network/block_producer_keys/receiver.json", "role": "Block_producer", - "docker_image": "gcr.io/o1labs-192920/mina-daemon:2.0.0rampup6-4061884-bullseye-berkeley", + "docker_image": "gcr.io/o1labs-192920/mina-daemon:2.0.0rampup7-4a0fff9-bullseye-berkeley", "git_build": null, "libp2p_pass": "naughty blue worm", "libp2p_keyfile": "./tests/data/large_network/libp2p_keys/receiver.json", @@ -75,7 +75,7 @@ "sk": "EKEDFANcgihUz6X8kkZKoB1VNr38zJUaCDYbtbaarKbpMKzCKuH1", "privkey_path": "./tests/data/large_network/block_producer_keys/empty_node-1.json", "role": "Block_producer", - "docker_image": "gcr.io/o1labs-192920/mina-daemon:2.0.0rampup6-4061884-bullseye-berkeley", + "docker_image": "gcr.io/o1labs-192920/mina-daemon:2.0.0rampup7-4a0fff9-bullseye-berkeley", "git_build": null, "libp2p_pass": "naughty blue worm", "libp2p_keyfile": "./tests/data/large_network/libp2p_keys/empty_node-1.json", @@ -97,7 +97,7 @@ "sk": "EKEDFANcgihUz6X8kkZKoB1VNr38zJUaCDYbtbaarKbpMKzCKuH1", "privkey_path": "./tests/data/large_network/block_producer_keys/empty_node-2.json", "role": "Block_producer", - "docker_image": "gcr.io/o1labs-192920/mina-daemon:2.0.0rampup6-4061884-bullseye-berkeley", + "docker_image": "gcr.io/o1labs-192920/mina-daemon:2.0.0rampup7-4a0fff9-bullseye-berkeley", "git_build": null, "libp2p_pass": "naughty blue worm", "libp2p_keyfile": "./tests/data/large_network/libp2p_keys/empty_node-2.json", @@ -119,7 +119,7 @@ "sk": "EKEDFANcgihUz6X8kkZKoB1VNr38zJUaCDYbtbaarKbpMKzCKuH1", "privkey_path": "./tests/data/large_network/block_producer_keys/observer.json", "role": "Block_producer", - "docker_image": "gcr.io/o1labs-192920/mina-daemon:2.0.0rampup6-4061884-bullseye-berkeley", + "docker_image": "gcr.io/o1labs-192920/mina-daemon:2.0.0rampup7-4a0fff9-bullseye-berkeley", "git_build": null, "libp2p_pass": "naughty blue worm", "libp2p_keyfile": "./tests/data/large_network/libp2p_keys/observer.json", @@ -141,7 +141,7 @@ "sk": "EKEmQoyTKdFqKuAz58jA7iAM8UKAzuyfPFKcjFQavCBVgYWC8y2Y", "privkey_path": null, "role": "Seed_node", - "docker_image": "gcr.io/o1labs-192920/mina-daemon:2.0.0rampup6-4061884-bullseye-berkeley", + "docker_image": "gcr.io/o1labs-192920/mina-daemon:2.0.0rampup7-4a0fff9-bullseye-berkeley", "git_build": null, "libp2p_pass": "naughty blue worm", "libp2p_keyfile": "./tests/data/large_network/libp2p_keys/seed-0.json", @@ -163,7 +163,7 @@ "sk": "EKDmEM9PvTrwD2AwB1qsSqWwyzf7ZVawzVxk4xwXG5XYRxhGiQdy", "privkey_path": null, "role": "Seed_node", - "docker_image": "gcr.io/o1labs-192920/mina-daemon:2.0.0rampup6-4061884-bullseye-berkeley", + "docker_image": "gcr.io/o1labs-192920/mina-daemon:2.0.0rampup7-4a0fff9-bullseye-berkeley", "git_build": null, "libp2p_pass": "naughty blue worm", "libp2p_keyfile": "./tests/data/large_network/libp2p_keys/seed-1.json", diff --git a/tests/data/small_network/topology.json b/tests/data/small_network/topology.json index c49d120..4a2ee54 100644 --- a/tests/data/small_network/topology.json +++ b/tests/data/small_network/topology.json @@ -4,7 +4,7 @@ "sk": "EKFFrQVB9tmtHVxAGBqvZYUy9Wm2e5ERwNh4dgZpjyLsT6nfpmPS", "privkey_path": "./tests/data/small_network/block_producer_keys/receiver.json", "role": "Block_producer", - "docker_image": "gcr.io/o1labs-192920/mina-daemon:2.0.0rampup6-4061884-bullseye-berkeley", + "docker_image": "gcr.io/o1labs-192920/mina-daemon:2.0.0rampup7-4a0fff9-bullseye-berkeley", "git_build": null, "libp2p_pass": "naughty blue worm", "libp2p_keyfile": "./tests/data/small_network/libp2p_keys/receiver.json", @@ -26,7 +26,7 @@ "sk": "EKDyUS6K9wkVGiYrvJhtZHSMjeW4JEMiWCXGNco4ZEkbMN9qSeQk", "privkey_path": null, "role": "Seed_node", - "docker_image": "gcr.io/o1labs-192920/mina-daemon:2.0.0rampup6-4061884-bullseye-berkeley", + "docker_image": "gcr.io/o1labs-192920/mina-daemon:2.0.0rampup7-4a0fff9-bullseye-berkeley", "git_build": null, "libp2p_pass": "naughty blue worm", "libp2p_keyfile": "./tests/data/small_network/libp2p_keys/seed-0.json", diff --git a/tests/data/uptime_service_network/topology.json b/tests/data/uptime_service_network/topology.json index 86a40f3..288f40f 100644 --- a/tests/data/uptime_service_network/topology.json +++ b/tests/data/uptime_service_network/topology.json @@ -3,7 +3,7 @@ "pk": "B62qjwzawZqMmm27zwDg5xF8XtrH1TcQedsS3EVStct8wr1FcpRZFbm", "sk": "EKFBPN3My4Y5GqaYj9pMYvtfzvrzuSQyvTEgxTZmCx4QZg7vJePB", "role": "Snark_coordinator", - "docker_image": "gcr.io/o1labs-192920/mina-daemon:2.0.0rampup6-4061884-bullseye-berkeley", + "docker_image": "gcr.io/o1labs-192920/mina-daemon:2.0.0rampup7-4a0fff9-bullseye-berkeley", "git_build": null, "worker_nodes": 1, "snark_worker_fee": "0.0001", @@ -27,7 +27,7 @@ "sk": "EKF83r3ibZ8eCC1PwcgrTAVLVoA3dKXt2iSGxb6vDnofs9nKUY3V", "privkey_path": "./tests/data/uptime_service_network/block_producer_keys/node-a.json", "role": "Block_producer", - "docker_image": "gcr.io/o1labs-192920/mina-daemon:2.0.0rampup6-4061884-bullseye-berkeley", + "docker_image": "gcr.io/o1labs-192920/mina-daemon:2.0.0rampup7-4a0fff9-bullseye-berkeley", "git_build": null, "libp2p_pass": "naughty blue worm", "libp2p_keyfile": "./tests/data/uptime_service_network/libp2p_keys/node-a.json", @@ -49,7 +49,7 @@ "sk": "EKF5AkJQX1B6CgmmaXgsyw4tZFp1M27TRcJrzw67Mtnp7o45rEvv", "privkey_path": "./tests/data/uptime_service_network/block_producer_keys/node-b.json", "role": "Block_producer", - "docker_image": "gcr.io/o1labs-192920/mina-daemon:2.0.0rampup6-4061884-bullseye-berkeley", + "docker_image": "gcr.io/o1labs-192920/mina-daemon:2.0.0rampup7-4a0fff9-bullseye-berkeley", "git_build": null, "libp2p_pass": "naughty blue worm", "libp2p_keyfile": "./tests/data/uptime_service_network/libp2p_keys/node-b.json", @@ -71,7 +71,7 @@ "sk": "EKF44LaJVQKTT1iuSJ3XifSFFtBndMb741kHPzVcYAtYEyJbZ11s", "privkey_path": "./tests/data/uptime_service_network/block_producer_keys/node-c.json", "role": "Block_producer", - "docker_image": "gcr.io/o1labs-192920/mina-daemon:2.0.0rampup6-4061884-bullseye-berkeley", + "docker_image": "gcr.io/o1labs-192920/mina-daemon:2.0.0rampup7-4a0fff9-bullseye-berkeley", "git_build": null, "libp2p_pass": "naughty blue worm", "libp2p_keyfile": "./tests/data/uptime_service_network/libp2p_keys/node-c.json", @@ -99,7 +99,7 @@ "sk": "EKEFB6NduHXqgGUkSSe1TFf1SCpn1SDrJtAcRJiHd4zaks4X5GrD", "privkey_path": null, "role": "Seed_node", - "docker_image": "gcr.io/o1labs-192920/mina-daemon:2.0.0rampup6-4061884-bullseye-berkeley", + "docker_image": "gcr.io/o1labs-192920/mina-daemon:2.0.0rampup7-4a0fff9-bullseye-berkeley", "git_build": null, "libp2p_pass": "naughty blue worm", "libp2p_keyfile": "./tests/data/uptime_service_network/libp2p_keys/default-seed.json",