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

refactor(provider/init): simplify provider info test #247

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion charts/akash-provider/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ type: application
# Versions are expected to follow Semantic Versioning (https://semver.org/)

# Major version bit highlights the mainnet release (e.g. mainnet4 = 4.x.x, mainnet5 = 5.x.x, ...)
version: 8.0.2
version: 8.0.3

# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
Expand Down
11 changes: 6 additions & 5 deletions charts/akash-provider/scripts/init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -75,11 +75,12 @@ if [[ $? -ne 0 ]]; then
fi

echo "Checking whether provider.yaml needs to be updated on the chain ..."
REMOTE_PROVIDER="$(provider-services query provider get $PROVIDER_ADDRESS -o json | jq | sha1sum | awk '{print $1}')"
LOCAL_PROVIDER="$(provider-services tx provider update provider.yaml --offline --generate-only --from $PROVIDER_ADDRESS | jq -r '.body.messages[]' | jq -r 'del(."@type")' | sha1sum | awk '{print $1}')"
if [[ "$REMOTE_PROVIDER" != "$LOCAL_PROVIDER" ]]; then
echo "Updating provider in the blockchain ..."
provider-services tx provider update provider.yaml
diff --color -Nur <(cat provider.yaml | awk '/attributes:/{print;flag=1;next}/^ - key:/{if(flag)sub(" ","");print;next}flag&&/^ /{sub(" "," ");print;next}{flag=0;print}' | sort) <(provider-services query provider get $PROVIDER_ADDRESS -o text | sed -e 's/"//g' -e 's/host_uri:/host:/g' | sort)
rc=$?
if [[ $rc -ne 0 ]]; then
echo "Updating provider info in the blockchain in 10 seconds ..."
sleep 10s
echo provider-services tx provider update provider.yaml
fi

CERT_SYMLINK="${AKASH_HOME}/${PROVIDER_ADDRESS}.pem"
Expand Down
Loading