-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* define functions * clone helper * update examples * bump version Co-authored-by: Yan Chen <yan.chen@dfinity.org>
- Loading branch information
1 parent
f9aa48e
commit 9823a6b
Showing
11 changed files
with
259 additions
and
162 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
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
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,23 +1,29 @@ | ||
#!/usr/bin/ic-repl | ||
function deploy(wallet, wasm, cycle) { | ||
identity default "~/.config/dfx/identity/default/identity.pem"; | ||
call wallet.wallet_create_canister( | ||
record { | ||
cycles = cycle; | ||
settings = record { | ||
controller = null; | ||
freezing_threshold = null; | ||
memory_allocation = null; | ||
compute_allocation = null; | ||
}; | ||
}, | ||
); | ||
let id = _.Ok.canister_id; | ||
call as wallet ic.install_code( | ||
record { | ||
arg = encode (); | ||
wasm_module = wasm; | ||
mode = variant { install }; | ||
canister_id = id; | ||
}, | ||
); | ||
id | ||
}; | ||
|
||
import wallet = "${WALLET_ID:-rwlgt-iiaaa-aaaaa-aaaaa-cai}" as "wallet.did"; | ||
identity default "~/.config/dfx/identity/default/identity.pem"; | ||
call wallet.wallet_create_canister( | ||
record { | ||
cycles = ${CYCLE:-1_000_000}; | ||
settings = record { | ||
controller = null; | ||
freezing_threshold = null; | ||
memory_allocation = null; | ||
compute_allocation = null; | ||
}; | ||
}, | ||
); | ||
let id = _.Ok.canister_id; | ||
call as wallet ic.install_code( | ||
record { | ||
arg = encode (); | ||
wasm_module = file "${WASM_FILE}"; | ||
mode = variant { install }; | ||
canister_id = id; | ||
}, | ||
); | ||
let id = deploy(wallet, file "greet.wasm", 1_000_000); | ||
call id.greet("test"); |
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
Oops, something went wrong.