Skip to content

Commit

Permalink
Merge branch 'master' into spofford/lib-name-fix
Browse files Browse the repository at this point in the history
  • Loading branch information
adamspofford-dfinity authored Sep 26, 2024
2 parents cdcad77 + 07bd312 commit c1be031
Show file tree
Hide file tree
Showing 19 changed files with 103 additions and 73 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@

## Dependencies

### Motoko

Updated Motoko to [0.13.0](https://github.com/dfinity/motoko/releases/tag/0.13.0)

### Replica

Updated replica to elected commit 179973553248415fc85679d853b48b0e0ec231c6.
Expand Down
34 changes: 19 additions & 15 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 5 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,12 @@ license = "Apache-2.0"
[workspace.dependencies]
candid = "0.10.4"
candid_parser = "0.1.4"
ic-agent = { git = "https://github.com/dfinity/agent-rs.git", rev = "6e11a350112f9b907c4d590d8217f340e153d898" }
ic-asset = { path = "src/canisters/frontend/ic-asset" }
dfx-core = { path = "src/dfx-core", version = "0.1.0" }
ic-agent = "0.38"
ic-asset = { path = "src/canisters/frontend/ic-asset", version = "0.21.0" }
ic-cdk = "0.13.1"
ic-identity-hsm = { git = "https://github.com/dfinity/agent-rs.git", rev = "6e11a350112f9b907c4d590d8217f340e153d898" }
ic-utils = { git = "https://github.com/dfinity/agent-rs.git", rev = "6e11a350112f9b907c4d590d8217f340e153d898" }
ic-identity-hsm = "0.38"
ic-utils = "0.38"

aes-gcm = "0.10.3"
anyhow = "1.0.56"
Expand Down
7 changes: 5 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ The `IC SDK` installation script installs several components in default location
| Component | Description | Default location |
|--------------|----------------------------------------------------------------------------------------------------|-----------------------------------------------|
| dfx | Command-line interface (CLI) | `/usr/local/bin/dfx` |
| dfxvm | Command-line interface, version manager | `/usr/local/bin/dfxvm` |
| moc | Motoko runtime compiler | `~/.cache/dfinity/versions/<VERSION>/moc` |
| replica | Internet Computer local network binary | `~/.cache/dfinity/versions/<VERSION>/replica` |
| uninstall.sh | Script to remove the SDK and all of its components | `~/.cache/dfinity/uninstall.sh` |
Expand All @@ -28,8 +29,10 @@ There are a few components above worth expanding on:

1. **dfx** - `dfx` is the command-line interface for the `IC SDK`. This is why many commands for the IC SDK start with the command "`dfx ..`" such as `dfx new` or `dfx stop`.

2. **Canister Development Kit (CDK)** - A CDK is an adapter used by the IC SDK so a programming language has the features needed to create and manage canisters.
The IC SDK comes with a few CDKs already installed for you so you can use them in the language of yoru choice. That is why there is a [Rust CDK](https://github.com/dfinity/cdk-rs), [Python CDK](https://demergent-labs.github.io/kybra/),
2. **dfxvm** - `dfxvm` is the version manager for `dfx`, i.e. a CLI for selecting and managing installed `dfx` versions.

3. **Canister Development Kit (CDK)** - A CDK is an adapter used by the IC SDK so a programming language has the features needed to create and manage canisters.
The IC SDK comes with a few CDKs already installed for you so you can use them in the language of your choice. That is why there is a [Rust CDK](https://github.com/dfinity/cdk-rs), [Python CDK](https://demergent-labs.github.io/kybra/),
[TypeScript CDK](https://demergent-labs.github.io/azle/), etc... Since CDKs are components used the SDK, some developer choose to use the CDK directly (without the `IC SDK`),
but typically are used as part of the whole `IC SDK`.

Expand Down
12 changes: 6 additions & 6 deletions e2e/tests-dfx/basic-project.bash
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ teardown() {
@test "build + install + call + request-status -- greet_mo" {
dfx_new hello
install_asset greet
dfx_start
dfx canister create --all
dfx build
dfx_start --artificial-delay 10000
dfx canister create hello_backend
dfx build hello_backend
# INSTALL_REQUEST_ID=$(dfx canister install hello_backend --async)
# dfx canister request-status $INSTALL_REQUEST_ID
dfx canister install hello_backend
Expand Down Expand Up @@ -57,9 +57,9 @@ teardown() {
@test "build + install + call + request-status -- counter_mo" {
dfx_new hello
install_asset counter
dfx_start
dfx canister create --all
dfx build
dfx_start --artificial-delay 10000
dfx canister create hello_backend
dfx build hello_backend
dfx canister install hello_backend

assert_command dfx canister call hello_backend read
Expand Down
6 changes: 3 additions & 3 deletions e2e/tests-dfx/request_status.bash
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ teardown() {

@test "request-status output raw" {
install_asset greet
dfx_start
dfx canister create --all
dfx build
dfx_start --artificial-delay 10000
dfx canister create hello_backend
dfx build hello_backend

dfx canister install hello_backend

Expand Down
2 changes: 1 addition & 1 deletion e2e/tests-dfx/upgrade_check.bash
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ teardown() {
jq '.canisters.hello_backend.main="v5.mo"' dfx.json | sponge dfx.json
echo yes | (
assert_command dfx deploy
assert_match "Stable interface compatibility check issued an ERROR"
assert_match "Stable interface compatibility check issued a WARNING"
)
assert_command dfx canister call hello_backend read '()'
assert_match "(0 : int)"
Expand Down
18 changes: 9 additions & 9 deletions nix/sources.json
Original file line number Diff line number Diff line change
Expand Up @@ -130,27 +130,27 @@
"builtin": false,
"description": "The Motoko base library",
"owner": "dfinity",
"sha256": "1ilqh5f8y5dwf7vx9g627bw6vprg42z9qm8cl24kdcaakqvb7p8l",
"sha256": "02nf25bm21rmyh425arh0srb52bgsyrbqmnmy7r8zd1lfd6jnpfc",
"type": "tarball",
"url": "https://github.com/dfinity/motoko/releases/download/0.12.1/motoko-base-library.tar.gz",
"url": "https://github.com/dfinity/motoko/releases/download/0.13.0/motoko-base-library.tar.gz",
"url_template": "https://github.com/dfinity/motoko/releases/download/<version>/motoko-base-library.tar.gz",
"version": "0.12.1"
"version": "0.13.0"
},
"motoko-x86_64-darwin": {
"builtin": false,
"sha256": "0yjzfavxfllmg1dnrbmm1aw3l9kk10dxsa8jy5c284iwz6ka3ks1",
"sha256": "1bknwvhh44ysdr1xg3x856x528b55752yn6x808lwjyi1yysnqcc",
"type": "file",
"url": "https://github.com/dfinity/motoko/releases/download/0.12.1/motoko-Darwin-x86_64-0.12.1.tar.gz",
"url": "https://github.com/dfinity/motoko/releases/download/0.13.0/motoko-Darwin-x86_64-0.13.0.tar.gz",
"url_template": "https://github.com/dfinity/motoko/releases/download/<version>/motoko-Darwin-x86_64-<version>.tar.gz",
"version": "0.12.1"
"version": "0.13.0"
},
"motoko-x86_64-linux": {
"builtin": false,
"sha256": "1qmyrnirwgrafgqdwv4bw5803gzinvqa7mfk7qnlmmhgm5csjp8y",
"sha256": "1njn9cyalgj33imysblbbpxpqp0fvadckk5b8wsw92l67fksp0mf",
"type": "file",
"url": "https://github.com/dfinity/motoko/releases/download/0.12.1/motoko-Linux-x86_64-0.12.1.tar.gz",
"url": "https://github.com/dfinity/motoko/releases/download/0.13.0/motoko-Linux-x86_64-0.13.0.tar.gz",
"url_template": "https://github.com/dfinity/motoko/releases/download/<version>/motoko-Linux-x86_64-<version>.tar.gz",
"version": "0.12.1"
"version": "0.13.0"
},
"pocket-ic-x86_64-darwin": {
"rev": "179973553248415fc85679d853b48b0e0ec231c6",
Expand Down
4 changes: 2 additions & 2 deletions src/canisters/frontend/ic-asset/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "ic-asset"
version = "0.20.0"
version = "0.21.0"
authors.workspace = true
edition.workspace = true
repository.workspace = true
Expand All @@ -16,7 +16,7 @@ backoff.workspace = true
brotli = "6.0.0"
candid = { workspace = true }
derivative = "2.2.0"
dfx-core = { path = "../../../dfx-core" }
dfx-core.workspace = true
flate2.workspace = true
futures.workspace = true
futures-intrusive = "0.4.0"
Expand Down
2 changes: 1 addition & 1 deletion src/canisters/frontend/icx-asset/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "icx-asset"
version = "0.20.0"
version = "0.21.0"
authors.workspace = true
edition.workspace = true
repository.workspace = true
Expand Down
5 changes: 4 additions & 1 deletion src/dfx-core/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
[package]
name = "dfx-core"
version = "0.0.1"
version = "0.1.0"
authors.workspace = true
edition.workspace = true
repository.workspace = true
license.workspace = true
rust-version.workspace = true
description = "dfx core library"
documentation = "https://docs.rs/dfx-core"
keywords = ["internet-computer", "icp", "dfinity"]

[dependencies]
aes-gcm.workspace = true
Expand Down
2 changes: 1 addition & 1 deletion src/dfx/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ console = "0.15.0"
crc32fast = "1.3.2"
crossbeam = "0.8.1"
ctrlc = { version = "3.2.1", features = ["termination"] }
dfx-core = { path = "../dfx-core" }
dfx-core.workspace = true
dialoguer = { workspace = true, features = ["fuzzy-select"] }
directories-next.workspace = true
flate2 = { workspace = true, default-features = false, features = ["zlib-ng"] }
Expand Down
16 changes: 8 additions & 8 deletions src/dfx/assets/dfx-asset-sources.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ url = 'https://download.dfinity.systems/ic/179973553248415fc85679d853b48b0e0ec23
sha256 = 'c46651590e9b4b01403d7620856b9c7ea2aa8f60ec5eed0cb6a4113bed01ad5c'

[x86_64-darwin.motoko]
url = 'https://github.com/dfinity/motoko/releases/download/0.12.1/motoko-Darwin-x86_64-0.12.1.tar.gz'
sha256 = '41cfa1a6f93c122458f11229dd1b0873263ab80ab5ae6c5b789552d7b7725f7a'
url = 'https://github.com/dfinity/motoko/releases/download/0.13.0/motoko-Darwin-x86_64-0.13.0.tar.gz'
sha256 = '8c61abbd0fd14b4e1140dd582fca29652151ba29a88fd7436eda1302e1e676ae'
# The replica, canister_sandbox and compiler_sandbox binaries must have the same revision.

[x86_64-darwin.replica]
Expand Down Expand Up @@ -53,8 +53,8 @@ url = 'https://download.dfinity.systems/ic/179973553248415fc85679d853b48b0e0ec23
sha256 = '65a73e56616b65e55ab526f4c03235a82604ff902e086473953fa038c940020a'

[x86_64-darwin.motoko-base]
url = 'https://github.com/dfinity/motoko/releases/download/0.12.1/motoko-base-library.tar.gz'
sha256 = '21a9c67658033a9cfafae2b9b1a601b5536e460621ede835f879a1c76eaa0a45'
url = 'https://github.com/dfinity/motoko/releases/download/0.13.0/motoko-base-library.tar.gz'
sha256 = 'fcefaf998b0ddb75100f46cc23ac8a384ef4d7b26374a38f353055b2c8fa3fb6'

[x86_64-darwin.ic-btc-canister]
url = 'https://github.com/dfinity/bitcoin-canister/releases/download/release%2F2023-10-13/ic-btc-canister.wasm.gz'
Expand All @@ -81,8 +81,8 @@ url = 'https://download.dfinity.systems/ic/179973553248415fc85679d853b48b0e0ec23
sha256 = 'd03ab6254f5a90917a06e60c5c848db18dc9abadb940ecd6f5d71caabd76774d'

[x86_64-linux.motoko]
url = 'https://github.com/dfinity/motoko/releases/download/0.12.1/motoko-Linux-x86_64-0.12.1.tar.gz'
sha256 = '1e5da959a90fd64a2d3ed3d5a3f0b6f1bf0150e18b6cdef0732a3f9ea3cdbee2'
url = 'https://github.com/dfinity/motoko/releases/download/0.13.0/motoko-Linux-x86_64-0.13.0.tar.gz'
sha256 = 'ae82aba73b868ac43547abccc99ada0e5c7cfb5d8b2eed6b1c433eaa3c4b56da'
# The replica, canister_sandbox and compiler_sandbox binaries must have the same revision.

[x86_64-linux.replica]
Expand Down Expand Up @@ -112,8 +112,8 @@ url = 'https://download.dfinity.systems/ic/179973553248415fc85679d853b48b0e0ec23
sha256 = 'a0f883537a23a14df3b1f21987e089a0884dbc226f818bc2cc2e3df028042ad8'

[x86_64-linux.motoko-base]
url = 'https://github.com/dfinity/motoko/releases/download/0.12.1/motoko-base-library.tar.gz'
sha256 = '21a9c67658033a9cfafae2b9b1a601b5536e460621ede835f879a1c76eaa0a45'
url = 'https://github.com/dfinity/motoko/releases/download/0.13.0/motoko-base-library.tar.gz'
sha256 = 'fcefaf998b0ddb75100f46cc23ac8a384ef4d7b26374a38f353055b2c8fa3fb6'

[x86_64-linux.ic-btc-canister]
url = 'https://github.com/dfinity/bitcoin-canister/releases/download/release%2F2023-10-13/ic-btc-canister.wasm.gz'
Expand Down
2 changes: 1 addition & 1 deletion src/dfx/src/commands/canister/create.rs
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ pub async fn exec(
)
.with_context(|| format!("Failed to read Wasm memory limit of {canister_name}."))?;
let log_visibility = get_log_visibility(
opts.log_visibility,
opts.log_visibility.clone(),
Some(config_interface),
Some(canister_name),
)
Expand Down
9 changes: 7 additions & 2 deletions src/dfx/src/commands/canister/status.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,13 @@ async fn canister_status(
"Not Set".to_string()
};
let log_visibility = match status.settings.log_visibility {
LogVisibility::Controllers => "controllers",
LogVisibility::Public => "public",
LogVisibility::Controllers => "controllers".to_string(),
LogVisibility::Public => "public".to_string(),
LogVisibility::AllowedViewers(viewers) => {
let mut viewers: Vec<_> = viewers.iter().map(Principal::to_text).collect();
viewers.sort();
format!("allowed viewers: {}", viewers.join(", "))
}
};

println!("Canister status call result for {canister}.\nStatus: {status}\nControllers: {controllers}\nMemory allocation: {memory_allocation}\nCompute allocation: {compute_allocation}\nFreezing threshold: {freezing_threshold}\nMemory Size: {memory_size:?}\nBalance: {balance} Cycles\nReserved: {reserved} Cycles\nReserved cycles limit: {reserved_cycles_limit}\nWasm memory limit: {wasm_memory_limit}\nModule hash: {module_hash}\nNumber of queries: {queries_total}\nInstructions spent in queries: {query_instructions_total}\nTotal query request payload size (bytes): {query_req_payload_total}\nTotal query response payload size (bytes): {query_resp_payload_total}\nLog visibility: {log_visibility}",
Expand Down
4 changes: 2 additions & 2 deletions src/dfx/src/commands/canister/update_settings.rs
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ pub async fn exec(
let wasm_memory_limit =
get_wasm_memory_limit(opts.wasm_memory_limit, config_interface, canister_name)?;
let log_visibility =
get_log_visibility(opts.log_visibility, config_interface, canister_name)?;
get_log_visibility(opts.log_visibility.clone(), config_interface, canister_name)?;
if let Some(added) = &opts.add_controller {
let status = get_canister_status(env, canister_id, call_sender).await?;
let mut existing_controllers = status.settings.controllers;
Expand Down Expand Up @@ -241,7 +241,7 @@ pub async fn exec(
)
.with_context(|| format!("Failed to get Wasm memory limit for {canister_name}."))?;
let log_visibility = get_log_visibility(
opts.log_visibility,
opts.log_visibility.clone(),
Some(config_interface),
Some(canister_name),
)
Expand Down
Loading

0 comments on commit c1be031

Please sign in to comment.