Merge pull request #12 from allora-network/impr/add-init-config

Improve init script
This commit is contained in:
Cristian Conache 2024-08-09 13:39:31 +03:00 committed by GitHub
commit fcb4c8d152
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 16 additions and 3 deletions

View File

@ -28,8 +28,8 @@ A complete working example is provided in the `docker-compose.yml` file.
Run the following commands from the project's root directory to initialize the worker:
```sh
chmod +x init.docker
./init.docker
chmod +x init.config
./init.config
```
These commands will:
- Automatically create Allora keys for your worker.

View File

@ -9,7 +9,20 @@ fi
nodeName=$(jq -r '.wallet.addressKeyName' config.json)
if [ -z "$nodeName" ]; then
echo "No name was provided for the node, please provide value for wallet.addressKeyName in the config.json"
echo "No wallet name provided for the node, please provide your preferred wallet name. config.json >> wallet.addressKeyName"
exit 1
fi
json_content=$(cat ./config.json)
stringified_json=$(echo "$json_content" | jq -c .)
mnemonic=$(jq -r '.wallet.addressRestoreMnemonic' config.json)
if [ -n "$mnemonic" ]; then
echo "ALLORA_OFFCHAIN_NODE_CONFIG_JSON='$stringified_json'" > ./worker-data/env_file
echo "NAME=$nodeName" >> ./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"
exit 1
fi