-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #30 from arcmindai/dev
Add cycles battery canister and update post_upgrade arguments for arcmindai_controller
- Loading branch information
Showing
19 changed files
with
664 additions
and
110 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
#!/bin/bash | ||
|
||
# Validate required env vars | ||
if [[ -z "${CYCLES_BATTERY_API_KEY}" ]]; then | ||
echo "CYCLES_BATTERY_API_KEY is unset." | ||
exit 1 | ||
fi | ||
|
||
if [[ -z "${OWNER_PRINCIPAL}" ]]; then | ||
echo "OWNER_PRINCIPAL is unset." | ||
exit 1 | ||
fi | ||
|
||
# To deplopy locally, update IC_NETWORK to local. To deploy to ic, update IC_NETWORK to ic. | ||
IC_NETWORK=${IC_NETWORK:-local} | ||
|
||
# Deploy cycles battery canister | ||
echo Deploying cycles battery canister with owner=$OWNER_PRINCIPAL api_key=$CYCLES_BATTERY_API_KEY on $IC_NETWORK | ||
dfx deploy --network $IC_NETWORK cycles_battery --argument "(opt principal \"$OWNER_PRINCIPAL\", opt \"$CYCLES_BATTERY_API_KEY\")" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# To deplopy locally, update IC_NETWORK to local. To deploy to ic, update IC_NETWORK to ic. | ||
IC_NETWORK=${IC_NETWORK:-local} | ||
|
||
# Validate required env vars | ||
if [[ -z "${CYCLES_BATTERY_API_KEY}" ]]; then | ||
echo "CYCLES_BATTERY_API_KEY is unset." | ||
exit 1 | ||
fi | ||
|
||
GROUP_NAME="test" | ||
REQ_CYCLES_AMOUNT=1000000 | ||
CYCLES_BALANCE=3100000000000 | ||
|
||
|
||
echo Calling cycles battery canister with GROUP_NAME=$GROUP_NAME CYCLES_BATTERY_API_KEY=$CYCLES_BATTERY_API_KEY, REQ_CYCLES_AMOUNT=$REQ_CYCLES_AMOUNT, CYCLES_BALANCE=$CYCLES_BALANCE on $IC_NETWORK | ||
dfx canister --network $IC_NETWORK call cycles_battery topup_cycles "(\"$GROUP_NAME\", \"$CYCLES_BATTERY_API_KEY\", $REQ_CYCLES_AMOUNT, $CYCLES_BALANCE)" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.