diff --git a/docker-compose.yml b/docker-compose.yml index c89da5b..7885729 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -21,11 +21,14 @@ services: --port=8545 --host=0.0.0.0 --chain-id=1337 - --accounts=1 + --accounts=${NUM_NWAKU_NODES:-5} --allow-origin=* --block-time=12 --silent --config-out=anvil-config.txt + volumes: + - privatekeys-volume:/shared + - ./getPrivateKeys.sh:/getPrivateKeys.sh networks: - simulation @@ -216,4 +219,7 @@ services: - redis - foundry networks: - - simulation \ No newline at end of file + - simulation + +volumes: + privatekeys-volume: \ No newline at end of file diff --git a/getPrivateKeys.sh b/getPrivateKeys.sh new file mode 100644 index 0000000..3d9e7b5 --- /dev/null +++ b/getPrivateKeys.sh @@ -0,0 +1,15 @@ +#!/bin/sh + +# Install json parser +apk update +apk add jq + +# Read the JSON file +json_content=$(cat anvil-config.txt) + +# Extract private_keys array values using jq +private_keys=$(echo "$json_content" | jq -r '.private_keys[]') + +# Write private keys to a new file for easier access +echo "Writing private keys to file" +echo "$private_keys" > /shared/private-keys.txt \ No newline at end of file