mirror of
https://github.com/logos-messaging/logos-messaging-simulator.git
synced 2026-01-02 14:03:07 +00:00
removed additional script and files
This commit is contained in:
parent
37e737533f
commit
71882e78b5
@ -25,10 +25,9 @@ services:
|
||||
--allow-origin=*
|
||||
--block-time=12
|
||||
--silent
|
||||
--config-out=anvil-config.txt
|
||||
--config-out=/shared/anvil-config.txt
|
||||
volumes:
|
||||
- privatekeys-volume:/shared
|
||||
- ./getPrivateKeys.sh:/getPrivateKeys.sh
|
||||
networks:
|
||||
- simulation
|
||||
|
||||
|
||||
@ -1,15 +0,0 @@
|
||||
#!/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 indexing
|
||||
echo "Writing private keys to file"
|
||||
echo "$private_keys" > /shared/private-keys.txt
|
||||
29
run_nwaku.sh
29
run_nwaku.sh
@ -1,7 +1,8 @@
|
||||
#!/bin/sh
|
||||
#!/bin/bash
|
||||
|
||||
# Install bind-tools package used for domainname resolution
|
||||
# Install bind-tools package used for domainname resolution and jq for json parsing
|
||||
apk add bind-tools
|
||||
apk add jq
|
||||
|
||||
if test -f .env; then
|
||||
echo "Using .env file"
|
||||
@ -38,6 +39,12 @@ fi
|
||||
#Function to get the index of the container and use it to retrieve a private key to be used to generate the keystore
|
||||
get_private_key(){
|
||||
|
||||
# Read the JSON file
|
||||
json_content=$(cat /shared/anvil-config.txt)
|
||||
|
||||
# Extract private_keys json array using jq
|
||||
private_keys=$(echo "$json_content" | jq -r '.private_keys[]')
|
||||
|
||||
# get the service specified in the docker-compose.yml
|
||||
# by a reverse DNS lookup on the IP
|
||||
SERVICE=`dig -x $IP +short | cut -d'_' -f2`
|
||||
@ -49,9 +56,17 @@ get_private_key(){
|
||||
# extract the replica number from the same PTR entry
|
||||
INDEX=`dig -x $IP +short | sed 's/.*_\([0-9]*\)\..*/\1/'`
|
||||
|
||||
# get the line in the file corresponding to index
|
||||
key=$(sed -n "${INDEX}p" /shared/private-keys.txt)
|
||||
echo $key
|
||||
# iterate through list of private keys and get the one corresponding to the container index
|
||||
# we need to iterate because array objects cannot be used in /bin/ash (Alpine) and a separate script would need to be called to use bash
|
||||
current_index=1
|
||||
for key in $private_keys
|
||||
do
|
||||
if [ $current_index -eq $INDEX ]; then
|
||||
echo $key
|
||||
break
|
||||
fi
|
||||
current_index=$((current_index+1))
|
||||
done
|
||||
}
|
||||
|
||||
if test -f .$RLN_CREDENTIAL_PATH; then
|
||||
@ -60,12 +75,14 @@ else
|
||||
private_key="$(get_private_key)"
|
||||
echo "Private key: $private_key"
|
||||
|
||||
echo "Generating RLN keystore"
|
||||
/usr/bin/wakunode generateRlnKeystore \
|
||||
--rln-relay-eth-client-address="$RPC_URL" \
|
||||
--rln-relay-eth-private-key=$private_key \
|
||||
--rln-relay-eth-contract-address=$RLN_CONTRACT_ADDRESS \
|
||||
--rln-relay-cred-path=$RLN_CREDENTIAL_PATH \
|
||||
--rln-relay-cred-password=$RLN_CREDENTIAL_PASSWORD \
|
||||
--log-level=INFO \
|
||||
--execute
|
||||
fi
|
||||
|
||||
@ -102,7 +119,7 @@ exec /usr/bin/wakunode\
|
||||
--dns-discovery=true\
|
||||
--discv5-discovery=true\
|
||||
--discv5-enr-auto-update=True\
|
||||
--log-level=INFO\
|
||||
--log-level=DEBUG\
|
||||
--metrics-server=True\
|
||||
--metrics-server-address=0.0.0.0\
|
||||
--discv5-bootstrap-node=${BOOTSTRAP_ENR}\
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user