-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
0182e26
commit 647192c
Showing
5 changed files
with
63 additions
and
9 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,38 @@ | ||
#!/bin/bash | ||
set -e | ||
|
||
# Build the contract | ||
# Build both contracts | ||
echo "Building contracts..." | ||
cd "$(dirname $0)" | ||
./build.sh | ||
cd ../context-proxy | ||
./build.sh | ||
cd ../context-config | ||
|
||
# Stop the replica | ||
# Stop and start dfx | ||
echo "Restarting dfx..." | ||
dfx stop | ||
dfx start --background --clean | ||
|
||
# Start the replica | ||
dfx start --background | ||
# Force remove existing canisters if they exist | ||
echo "Cleaning up old canisters..." | ||
dfx canister delete context_contract || true | ||
dfx canister delete ledger || true | ||
|
||
# Deploy the contract | ||
# Create and deploy canisters | ||
echo "Deploying contracts..." | ||
dfx canister create --all --force | ||
dfx deploy | ||
|
||
# Get the proxy wasm | ||
echo "Reading proxy WASM..." | ||
PROXY_WASM=$(xxd -p ../context-proxy/res/calimero_context_proxy_icp.wasm | tr -d '\n') | ||
|
||
# Set proxy code in context config | ||
echo "Setting proxy code in context config..." | ||
dfx canister call context_contract set_proxy_code "( | ||
vec {$(echo $PROXY_WASM | sed 's/\([0-9a-f]\{2\}\)/0x\1;/g')}, | ||
principal \"$LEDGER_ID\" | ||
)" | ||
|
||
echo "Deployment complete!" |
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