From 3e9c802c8cad75df172e10bd7deb65846115a966 Mon Sep 17 00:00:00 2001 From: JeromeDeschamps <jerome.deschamps@uca.fr> Date: Thu, 15 Feb 2024 15:33:22 +0100 Subject: [PATCH] created new parameterizable script for simulation on docker compose --- scripts/run_simulation_2_nodes.sh | 35 +++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100755 scripts/run_simulation_2_nodes.sh diff --git a/scripts/run_simulation_2_nodes.sh b/scripts/run_simulation_2_nodes.sh new file mode 100755 index 0000000..21e7cbf --- /dev/null +++ b/scripts/run_simulation_2_nodes.sh @@ -0,0 +1,35 @@ +#!/bin/sh +export MINER_SIGNING_KEY=4c0883a69102937d6231471b5dbb6204fe5129617082792ae468d01a3f362318; +export MNEMONIC='before exclude interest push zone jealous boat ice chimney juice young side diagram silent pipe'; + +# MINER_SIGNING_KEY & MNEMONIC env vars are set on workstation. +# 30 mins +#TOTAL_SIMULATION_TIME=1800; +# 12 sec + +# export RPC_URL=http://ecomobicoin-1.cri.local.isima.fr:8545; +# export CHAIN_ID=6363; +export CHAIN_ID=636363; + + +# ./target/release/testnet-injector simulate-bx-from-csv ../movement-data/public-transport/MF_user_mobility_june-to-august-2023_mulhouse_dataset/anonymized_june-to-august-2023_mulhouse_dataset.csv $TOTAL_SIMULATION_TIME & +# Send BX +./target/release/testnet-injector simulate-bx-from-csv ./data/dataset-extract.csv $TOTAL_SIMULATION_TIME & + +echo "TOTAL_SIMULATION_TIME = $TOTAL_SIMULATION_TIME and block time = $BLOCK_TIME" +# Mine +for ((i=1; i<=100; i++)) +do + echo "MINE $i/100"; + if ((i % 2 == 0)); then + export RPC_URL=$RPC_URL_MINER_1; ./target/release/testnet-injector mine + else + export RPC_URL=$RPC_URL_MINER_2; ./target/release/testnet-injector mine + fi + + if [ $i -ne 100 ]; then + sleep $BLOCK_TIME + fi +done + + -- GitLab