Merge pull request #14 from allora-network/cristian/add-worker-data-to-gitigonore

Add worker-data directory to .gitignore
This commit is contained in:
Cristian Conache 2024-08-10 01:31:14 +03:00 committed by GitHub
commit 124872295a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 7 additions and 8 deletions

1
.gitignore vendored
View File

@ -6,6 +6,7 @@ logs/*
.allorad .allorad
.cache .cache
inference-data inference-data
worker-data
config.json config.json
env env

View File

@ -21,11 +21,13 @@ if [ -n "$mnemonic" ]; then
echo "ALLORA_OFFCHAIN_NODE_CONFIG_JSON='$stringified_json'" > ./worker-data/env_file echo "ALLORA_OFFCHAIN_NODE_CONFIG_JSON='$stringified_json'" > ./worker-data/env_file
echo "NAME=$nodeName" >> ./worker-data/env_file echo "NAME=$nodeName" >> ./worker-data/env_file
echo "ENV_LOADED=true" >> ./worker-data/env_file echo "ENV_LOADED=true" >> ./worker-data/env_file
echo "wallet mnemonic already provided by you, loading config.json . Please proceed to run docker compose" echo "wallet mnemonic already provided by you, loading config.json . Please proceed to run docker compose"
exit 1 exit 1
fi fi
# Ensure the worker-data directory exists
mkdir -p ./worker-data
if [ ! -f ./worker-data/env_file ]; then if [ ! -f ./worker-data/env_file ]; then
echo "ENV_LOADED=false" > ./worker-data/env_file echo "ENV_LOADED=false" > ./worker-data/env_file
fi fi
@ -34,8 +36,7 @@ ENV_LOADED=$(grep '^ENV_LOADED=' ./worker-data/env_file | cut -d '=' -f 2)
if [ "$ENV_LOADED" = "false" ]; then if [ "$ENV_LOADED" = "false" ]; then
json_content=$(cat ./config.json) json_content=$(cat ./config.json)
stringified_json=$(echo "$json_content" | jq -c .) stringified_json=$(echo "$json_content" | jq -c .)
docker run -it --entrypoint=bash -v $(pwd)/worker-data:/data -v $(pwd)/scripts:/scripts -e NAME="${nodeName}" -e ALLORA_OFFCHAIN_NODE_CONFIG_JSON="${stringified_json}" alloranetwork/allora-chain:latest -c "bash /scripts/init.sh"
docker run -it --entrypoint=bash -v $(pwd)/worker-data:/data -e NAME="${nodeName}" -e ALLORA_OFFCHAIN_NODE_CONFIG_JSON="${stringified_json}" alloranetwork/allora-chain:latest -c "bash /data/scripts/init.sh"
echo "config.json saved to ./worker-data/env_file" echo "config.json saved to ./worker-data/env_file"
else else
echo "config.json is already loaded, skipping the operation. You can set ENV_LOADED variable to false in ./worker-data/env_file to reload the config.json" echo "config.json is already loaded, skipping the operation. You can set ENV_LOADED variable to false in ./worker-data/env_file to reload the config.json"

View File

@ -1,3 +0,0 @@
ALLORA_OFFCHAIN_NODE_CONFIG_JSON='{"wallet":{"addressKeyName":"test-basic","addressRestoreMnemonic":"your mnemonic will go here","alloraHomeDir":"","gas":"1000000","gasAdjustment":1,"nodeRpc":"https://allora-rpc.devnet.behindthecurtain.xyz","maxRetries":1,"delay":1,"submitTx":false},"worker":[{"topicId":1,"inferenceEntrypointName":"api-worker-reputer","loopSeconds":5,"parameters":{"InferenceEndpoint":"http://inference:8000/inference/{Token}","Token":"ETH"}}]}'
NAME=test-basic
ENV_LOADED=true