-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'feat--icp-contracts' into icp_query_mutate_integration
- Loading branch information
Showing
5 changed files
with
30 additions
and
21 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,18 @@ | ||
#!/bin/bash | ||
|
||
# Exit on error | ||
#!/bin/sh | ||
set -e | ||
|
||
# Ensure we have the wasm32 target | ||
rustup target add wasm32-unknown-unknown | ||
cd "$(dirname $0)" | ||
|
||
# Build the contract | ||
cargo build --target wasm32-unknown-unknown --release | ||
TARGET="${CARGO_TARGET_DIR:-./target}" | ||
|
||
rustup target add wasm32-unknown-unknown | ||
|
||
# Generate the candid interface | ||
candid-extractor target/wasm32-unknown-unknown/release/context_contract.wasm > context_contract.did | ||
cargo build --target wasm32-unknown-unknown --profile app-release | ||
|
||
# Stop the replica | ||
dfx stop | ||
mkdir -p res | ||
|
||
# Start the replica | ||
dfx start --background | ||
cp $TARGET/wasm32-unknown-unknown/app-release/context_contract.wasm ./res/context_contract.wasm | ||
|
||
# Deploy the contract | ||
dfx deploy | ||
if command -v wasm-opt > /dev/null; then | ||
wasm-opt -Oz ./res/context_contract.wasm -o ./res/context_contract.wasm | ||
fi |
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 @@ | ||
#!/bin/bash | ||
|
||
# Build the contract | ||
bash ./build.sh | ||
|
||
# Generate the candid interface | ||
candid-extractor res/context_contract.wasm > context_contract.did | ||
|
||
# Stop the replica | ||
dfx stop | ||
|
||
# Start the replica | ||
dfx start --background | ||
|
||
# Deploy the contract | ||
dfx deploy |
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