From b952cfc0a61b772ed1add3ebc6693622d5d427eb Mon Sep 17 00:00:00 2001 From: Carla Kirk-Cohen Date: Wed, 10 Apr 2024 15:35:23 -0400 Subject: [PATCH] scripts: add stop network script to pull down existing containers --- README.md | 5 ++--- scripts/stop_network.sh | 12 ++++++++++++ 2 files changed, 14 insertions(+), 3 deletions(-) create mode 100755 scripts/stop_network.sh diff --git a/README.md b/README.md index e83e0b7..a334f5e 100644 --- a/README.md +++ b/README.md @@ -109,12 +109,11 @@ repository to be in the current directory. * You'll only need to do this once, but leave it running! * When you're done with it, bring it down with [./attackathon/scripts/stop_warnet.sh](./scripts/stop_warnet.sh) -* Start network: [./attackathon/scripts/start_network.sh](/.scripts/start_network.sh) +* Start network: [./attackathon/scripts/start_network.sh ln_10](/.scripts/start_network.sh) brings up your lightning network, opens channels, simulates random payments in the network and mines blocks every 5 minutes. - `./attackathon/scripts/start_network.sh ln_10` * If you want to kill your test network and start fresh, you can - re-run this script. + use [./attackathon/scripts/stop_network.sh ln_10](./scripts/stop_network.sh) * Start attacking pods: [./attackathon/scripts/start_attacker.sh](./scripts/start_attacker.sh) brings up the lightning nodes that you will use for your attack and a bitcoin node that you can use to fund the nodes / mine blocks. diff --git a/scripts/stop_network.sh b/scripts/stop_network.sh new file mode 100755 index 0000000..d547e0b --- /dev/null +++ b/scripts/stop_network.sh @@ -0,0 +1,12 @@ +#!/bin/bash + +# Check if the correct number of arguments are provided +if [ "$#" -ne 1 ]; then + echo "Usage: $0 " + exit 1 +fi + +network_name="$1" + +echo "Tearing down previous network" +warcli network down