Skip to content

Commit

Permalink
Provide aggregator args on deployment (#2011)
Browse files Browse the repository at this point in the history
# Motivation
The aggregator takes init args. These are optional but must still be
given if deployed by proposal, not if deployed directly.

# Changes
- Create default arguments when creating a proposal template. These may
be edited by a user if they wish, like everything in the template.
- Provide the arguments when deploying an SNS.

# Tests
This has been used for a deployment to production.

---------

Co-authored-by: Max Murphy-Skvorzov <[email protected]>
  • Loading branch information
bitdivine and bitdivine authored Mar 2, 2023
1 parent 8f4090e commit 574fced
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
6 changes: 5 additions & 1 deletion scripts/sns/aggregator/release
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,11 @@ AGGREGATOR_CANISTER_ID="3r4gx-wqaaa-aaaaq-aaaia-cai"
WASM="./release/docker/sns_aggregator.wasm"
SHA="$(sha256sum <"$WASM" | awk '{print $1}')"

set ic-admin --pin "$DFX_HSM_PIN" --nns-url https://ic0.app --use-hsm --key-id 01 --slot 0 propose-to-change-nns-canister --proposer "$NEURON" --canister-id "$AGGREGATOR_CANISTER_ID" --mode upgrade --wasm-module-path "$WASM" --summary-file ./release/AGGREGATOR_PROPOSAL.md --wasm-module-sha256 "$SHA"
ARG_DID="./release/arg.did"
ARG_PATH="./release/arg.bin"
didc encode "$(cat "$ARG_DID")" | xxd -r -p >"$ARG_PATH"

set ic-admin --pin "$DFX_HSM_PIN" --nns-url https://ic0.app --use-hsm --key-id 01 --slot 0 propose-to-change-nns-canister --proposer "$NEURON" --canister-id "$AGGREGATOR_CANISTER_ID" --mode upgrade --wasm-module-path "$WASM" --summary-file ./release/AGGREGATOR_PROPOSAL.md --wasm-module-sha256 "$SHA" --arg "$ARG_PATH"

echo
echo PLEASE REVIEW THIS COMMAND:
Expand Down
3 changes: 3 additions & 0 deletions scripts/sns/aggregator/release-template
Original file line number Diff line number Diff line change
Expand Up @@ -59,3 +59,6 @@ git checkout "$(git rev-parse HEAD)"
sha256sum sns_aggregator.wasm
\`\`\`
EOF

ARG_DID="./release/arg.did"
echo '(record{})' >"$ARG_DID"

0 comments on commit 574fced

Please sign in to comment.