Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dev to main #26

Merged
merged 25 commits into from
Aug 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
6f3ade3
add changelog + security
kpeluso Aug 2, 2024
29c80ef
Deployment (#10)
okedeji Aug 2, 2024
8d1ff1e
use internal network dns
okedeji Aug 2, 2024
2f25998
Deployment (#13)
okedeji Aug 2, 2024
8efd4c4
API Adapter with README ORA-2066 (#12)
xmariachi Aug 4, 2024
4a8ed5e
updating readme to tell you to copy the env file and fill it out befo…
Madisonw Aug 5, 2024
e5bbef0
readme changes (#15)
okedeji Aug 5, 2024
2822d38
chore: fix typos README.md (#17)
osrm Aug 6, 2024
1bd9b62
update dependencies, do not print conf (#18)
xmariachi Aug 6, 2024
5adbe40
Cleanups (#16)
okedeji Aug 6, 2024
1184b5c
fix issues with docker-compose initialize
okedeji Aug 6, 2024
1f0ad4f
readme fix
okedeji Aug 6, 2024
9b81dda
forecast should return nodeValue
okedeji Aug 6, 2024
32fde7a
Update dependencies + reputer nonce fix (#19)
xmariachi Aug 7, 2024
b850b4e
fix deprecated docker compose command
okedeji Aug 7, 2024
567b283
string interpolation
okedeji Aug 7, 2024
7e73aad
uniform backoff (#21)
xmariachi Aug 7, 2024
8e34a0c
Update and rename start.docker to init.docker (#22)
kush-alloralabs Aug 7, 2024
dc8971b
fix the conflicting account issues
okedeji Aug 7, 2024
fcda30e
add pull request template
okedeji Aug 8, 2024
a1c351b
correct the wkdir for source github actions
okedeji Aug 8, 2024
94fa22c
allow devs pass in their existing wallets and don't override
okedeji Aug 8, 2024
ecc2e33
fix startup edgecase
okedeji Aug 8, 2024
38cdd05
Diego/fix merge conflicts (main-dev) (#25)
xmariachi Aug 8, 2024
fca10d4
merge conflicts from main
xmariachi Aug 8, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 7 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,22 @@ Allora off-chain nodes publish inferences, forecasts, and losses informed by a c
## How to run with docker
1. Clone the repository
2. Make sure to remove any .env file so it doesn't clash with the automated environment variables
3. Copy config.example.json and populate with your variables
3. Copy config.example.json and populate with your variables. You can either populate with your existing wallet or leave it empty for it to be autocreated

```shell
cp config.example.json config.json
```
4. Run
4. Run command below to load your config.json file to environment

```shell
chmod +x init.docker
./init.docker
chmod +x init.config
./init.config
```

from the root diectory. This will:
- Automatically create allora keys for you. You will have to request for some tokens from faucet to be able to register your worker and stake your reputer. You can find your address in ./data/env_file
- Automatically export the needed variables from the account created to be used by the offchain node and bundles it with the your provided config.json and then pass them to the node as environemnt variable
- Load your config.json file into the environment. Depending on wheather you provided your wallet details or not it will also do the following:
- Automatically create allora keys for you. You will have to request for some tokens from faucet to be able to register your worker and stake your reputer. You can find your address in ./data/env_file
- Automatically export the needed variables from the account created to be used by the offchain node and bundles it with the your provided config.json and then pass them to the node as environemnt variable

5. Run `docker compose up --build`. This will:
- Run the both the offchain node and the source services, communicating through endpoints attached to the internal dns
Expand Down
37 changes: 37 additions & 0 deletions init.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
#!/bin/bash

set -e

if [ ! -f config.json ]; then
echo "Error: config.json file not found, please provide one"
exit 1
fi

nodeName=$(jq -r '.wallet.addressKeyName' config.json)
if [ -z "$nodeName" ]; then
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'" > ./data/env_file
echo "NAME=$nodeName" >> ./data/env_file
echo "ENV_LOADED=true" >> ./data/env_file

echo "wallet mnemonic already provided by you, loading config.json . Please proceed to run docker compose"
exit 1
fi

ENV_LOADED=$(grep '^ENV_LOADED=' ./data/env_file | cut -d '=' -f 2)
if [ "$ENV_LOADED" = "false" ]; then

docker run -it --entrypoint=bash -v $(pwd)/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 loaded to ./data/env_file"
else
echo "config.json is already loaded, skipping the operation. You can set ENV_LOADED variable to false in ./data/env_file to reload the config.json"
fi