Skip to content

Commit b8b890a

Browse files
Merge branch 'master' into tl/testnet4_update
2 parents 0f6608e + f7e90c5 commit b8b890a

File tree

425 files changed

+76949
-18916
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

425 files changed

+76949
-18916
lines changed

.github/CODEOWNERS

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,25 +5,34 @@
55
/c/reverse/ @dfinity/growth
66

77
/hosting/godot-html5-template/ @dfinity/sdk
8+
/hosting/my_crypto_blog/ @dfinity/ninja-devs
89
/hosting/photo-storage/ @dfinity/sdk
10+
/hosting/react/ @dfinity/ninja-devs
911
/hosting/static-website/ @dfinity/sdk
1012
/hosting/unity-webgl-template/ @dfinity/sdk
1113

1214
/motoko/basic_bitcoin/ @dfinity/execution
1315
/motoko/basic_dao/ @dfinity/languages
16+
/motoko/backend_only/ @dfinity/ninja-devs
1417
/motoko/canister_logs/ @dfinity/execution
1518
/motoko/cert-var/ @dfinity/trust
1619
/motoko/classes/ @dfinity/languages
1720
/motoko/composite_query/ @dfinity/languages
1821
/motoko/counter/ @dfinity/languages
22+
/motoko/daily_planner/ @dfinity/ninja-devs
1923
/motoko/encrypted-notes-dapp-vetkd/ @dfinity/crypto-team
2024
/motoko/encrypted-notes-dapp/ @dfinity/crypto-team
25+
/motoko/evm_block_explorer/ @dfinity/ninja-devs
26+
/motoko/filevault/ @dfinity/ninja-devs
27+
/motoko/flying_ninja/ @dfinity/ninja-devs
2128
/motoko/hello_cycles/ @dfinity/languages
29+
/motoko/hello_world/ @dfinity/ninja-devs
2230
/motoko/ic-pos/ @dfinity/growth
2331
/motoko/icp_transfer/ @dfinity/growth
2432
/motoko/icrc2-swap/ @dfinity/growth
2533
/motoko/internet_identity_integration/ @dfinity/identity
2634
/motoko/life/ @dfinity/languages
35+
/motoko/llm_chatbot/ @dfinity/ninja-devs
2736
/motoko/minimal-counter-dapp/ @dfinity/growth
2837
/motoko/parallel_calls/ @dfinity/languages
2938
/motoko/pub-sub/ @dfinity/growth
@@ -34,32 +43,39 @@
3443
/motoko/superheroes/ @dfinity/growth
3544
/motoko/threshold-ecdsa/ @dfinity/crypto-team
3645
/motoko/threshold-schnorr/ @dfinity/crypto-team
46+
/motoko/tokenmania/ @dfinity/ninja-devs
3747
/motoko/token_transfer/ @dfinity/growth
3848
/motoko/token_transfer_from/ @dfinity/growth
3949
/motoko/vetkd/ @dfinity/crypto-team
40-
/motoko/whoami/ @dfinity/growth
50+
/motoko/who_am_i/ @dfinity/ninja-devs
4151

4252
/native-apps/unity_ii_applink/ @dfinity/sdk
4353
/native-apps/unity_ii_deeplink/ @dfinity/sdk
4454

4555
/rust/basic_bitcoin/ @dfinity/execution
4656
/rust/basic_dao/ @dfinity/testing-verification
4757
/rust/basic_ethereum/ @dfinity/cross-chain-team
58+
/rust/backend_only/ @dfinity/ninja-devs
4859
/rust/canister-info/ @dfinity/testing-verification
4960
/rust/canister-snapshots/ @dfinity/execution
5061
/rust/canister_logs/ @dfinity/execution
5162
/rust/composite_query/ @dfinity/execution
5263
/rust/counter/ @dfinity/growth
64+
/rust/daily_planner/ @dfinity/ninja-devs
5365
/rust/defi/ @dfinity/growth
5466
/rust/dip721-nft-container/ @dfinity/sdk
5567
/rust/encrypted-notes-dapp-vetkd/ @dfinity/crypto-team
5668
/rust/encrypted-notes-dapp/ @dfinity/crypto-team
69+
/rust/evm_block_explorer/ @dfinity/ninja-devs
5770
/rust/face-recognition/ @dfinity/execution
71+
/rust/flying_ninja/ @dfinity/ninja-devs
5872
/rust/guards/ @dfinity/cross-chain-team
59-
/rust/hello/ @dfinity/sdk
73+
/rust/hello_world/ @dfinity/ninja-devs
6074
/rust/icp_transfer/ @dfinity/growth
6175
/rust/image-classification/ @dfinity/execution
6276
/rust/inter-canister-calls/ @dfinity/ic-message-routing-owners
77+
/rust/llm_chatbot/ @dfinity/ninja-devs
78+
/rust/low_wasm_memory/ @dfinity/execution
6379
/rust/nft-wallet/ @dfinity/growth
6480
/rust/parallel_calls/ @dfinity/research
6581
/rust/performance_counters/ @dfinity/execution
@@ -71,9 +87,11 @@
7187
/rust/simd/ @dfinity/execution
7288
/rust/threshold-ecdsa/ @dfinity/crypto-team
7389
/rust/threshold-schnorr/ @dfinity/crypto-team
90+
/rust/tokenmania/ @dfinity/ninja-devs
7491
/rust/token_transfer/ @dfinity/growth
7592
/rust/token_transfer_from/ @dfinity/growth
7693
/rust/vetkd/ @dfinity/crypto-team
94+
/rust/who_am_i/ @dfinity/ninja-devs
7795
/rust/x509/ @dfinity/crypto-team
7896

7997
/svelte/svelte-motoko-starter/ @dfinity/sdk

.github/CONTRIBUTING.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# Contributing
22

3+
> For ICP Ninja: check [NINJA_CONTRIBUTING.md](./../NINJA_CONTRIBUTING.md) for how to contribute a project to ICP Ninja.
4+
35
Thank you for your interest in contributing to example apps for the Internet Computer.
46
By participating in this project, you agree to abide by our [Code of Conduct](./CODE_OF_CONDUCT.md).
57

.github/workflows/motoko-hello_cycles-example.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ jobs:
3434
run: bash .github/workflows/provision-linux.sh
3535
- name: Motoko Hello Cycles Linux
3636
run: |
37-
dfxvm update
3837
dfx start --background --clean
3938
pushd motoko/hello_cycles
4039
make test

.github/workflows/motoko-whoami-example.yaml

Lines changed: 0 additions & 40 deletions
This file was deleted.

.github/workflows/ninja_pr_checks.yml

Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
name: Test ICP Ninja Examples
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- master
7+
8+
concurrency:
9+
group: ninja-pr-checks-${{ github.workflow }}-${{ github.ref }}
10+
cancel-in-progress: true
11+
12+
jobs:
13+
check-ninja-example-changes:
14+
name: Filter projects
15+
runs-on: ubuntu-22.04
16+
outputs:
17+
matrix: ${{ steps.set-matrix.outputs.matrix }}
18+
has_examples: ${{ steps.set-matrix.outputs.has_examples }}
19+
steps:
20+
- name: Checkout
21+
uses: actions/checkout@v4
22+
23+
- name: Fetch all branches
24+
run: git fetch origin
25+
26+
- name: Set matrix based on changes
27+
id: set-matrix
28+
run: |
29+
changed_files=$(git diff --name-only origin/master ${{ github.sha }})
30+
echo "Changed files: $changed_files"
31+
32+
examples=()
33+
declare -A example_paths=(
34+
["My Crypto Blog (Frontend)"]="hosting/my_crypto_blog"
35+
["React (Frontend)"]="hosting/react"
36+
["Motoko backend (Motoko)"]="motoko/backend_only"
37+
["Daily Planner (Motoko)"]="motoko/daily_planner"
38+
["EVM Block Explorer (Motoko)"]="motoko/evm_block_explorer"
39+
["FileVault (Motoko)"]="motoko/filevault"
40+
["Flying Ninja (Motoko)"]="motoko/flying_ninja"
41+
["Hello World (Motoko)"]="motoko/hello_world"
42+
["LLM Chatbot (Motoko)"]="motoko/llm_chatbot"
43+
["Tokenmania (Motoko)"]="motoko/tokenmania"
44+
["Who Am I (Motoko)"]="motoko/who_am_i"
45+
["Rust backend (Rust)"]="rust/backend_only"
46+
["Daily Planner (Rust)"]="rust/daily_planner"
47+
["EVM Block Explorer (Rust)"]="rust/evm_block_explorer"
48+
["Flying Ninja (Rust)"]="rust/flying_ninja"
49+
["Hello World (Rust)"]="rust/hello_world"
50+
["LLM Chatbot (Rust)"]="rust/llm_chatbot"
51+
["Tokenmania (Rust)"]="rust/tokenmania"
52+
["Who Am I (Rust)"]="rust/who_am_i"
53+
)
54+
for name in "${!example_paths[@]}"; do
55+
path=${example_paths[$name]}
56+
echo "Checking path: $path"
57+
58+
if echo "$changed_files" | grep -q "^$path/"; then
59+
examples+=("{\"name\": \"$name\", \"path\": \"$path\"}")
60+
echo "Added example: $name with path $path"
61+
fi
62+
done
63+
64+
if [ ${#examples[@]} -eq 0 ]; then
65+
echo "No examples detected. Setting has_examples to false."
66+
echo "has_examples=false" >> $GITHUB_OUTPUT
67+
echo "matrix={\"example\": []}" >> $GITHUB_OUTPUT
68+
else
69+
matrix="{\"example\": [$(IFS=, ; echo "${examples[*]}")]}"
70+
echo "Matrix generated: $matrix"
71+
echo "has_examples=true" >> $GITHUB_OUTPUT
72+
echo "matrix=$matrix" >> $GITHUB_OUTPUT
73+
fi
74+
75+
build-examples:
76+
name: Build
77+
needs: check-ninja-example-changes
78+
if: needs.check-ninja-example-changes.outputs.has_examples == 'true'
79+
runs-on: ubuntu-22.04
80+
container: ghcr.io/dfinity/icp-dev-env-slim:17
81+
strategy:
82+
matrix: ${{ fromJson(needs.check-ninja-example-changes.outputs.matrix) }}
83+
84+
steps:
85+
- name: Checkout
86+
uses: actions/checkout@v4
87+
88+
- name: Install dfx # This is a temporary workaround. Dfx is already installed in the container, but it does not start in the next step if we don't install it here again.
89+
uses: dfinity/setup-dfx@main
90+
91+
- name: Start dfx
92+
run: dfx start --background
93+
94+
- name: Build project
95+
working-directory: ${{ matrix.example.path }}
96+
run: dfx deploy

.github/workflows/provision-darwin.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ rm node.pkg
1818

1919
# Install DFINITY SDK.
2020
curl --location --output install-dfx.sh "https://raw.githubusercontent.com/dfinity/sdk/master/public/install-dfxvm.sh"
21-
DFX_VERSION=${DFX_VERSION:=0.25.0} DFXVM_INIT_YES=true bash install-dfx.sh
21+
DFX_VERSION=${DFX_VERSION:=0.26.0} DFXVM_INIT_YES=true bash install-dfx.sh
2222
rm install-dfx.sh
2323
echo "$HOME/Library/Application Support/org.dfinity.dfx/bin" >> $GITHUB_PATH
2424
source "$HOME/Library/Application Support/org.dfinity.dfx/env"
@@ -38,8 +38,8 @@ if [ -f "${GITHUB_WORKSPACE}/.ic-commit" ]; then
3838
fi
3939

4040
# Install ic-repl
41-
version=0.7.0
42-
curl --location --output ic-repl "https://github.com/chenyan2002/ic-repl/releases/download/$version/ic-repl-macos"
41+
version=0.7.7
42+
curl --location --output ic-repl "https://github.com/dfinity/ic-repl/releases/download/$version/ic-repl-macos"
4343
mv ./ic-repl /usr/local/bin/ic-repl
4444
chmod a+x /usr/local/bin/ic-repl
4545

.github/workflows/provision-linux.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ rm nodesource_setup.sh
1313

1414
# Install DFINITY SDK.
1515
wget --output-document install-dfx.sh "https://raw.githubusercontent.com/dfinity/sdk/master/public/install-dfxvm.sh"
16-
DFX_VERSION=${DFX_VERSION:=0.25.0} DFXVM_INIT_YES=true bash install-dfx.sh
16+
DFX_VERSION=${DFX_VERSION:=0.26.0} DFXVM_INIT_YES=true bash install-dfx.sh
1717
rm install-dfx.sh
1818
echo "$HOME/.local/share/dfx/bin" >>$GITHUB_PATH
1919
source "$HOME/.local/share/dfx/env"
@@ -32,8 +32,8 @@ if [ -f "${GITHUB_WORKSPACE}/.ic-commit" ]; then
3232
fi
3333

3434
# Install ic-repl
35-
version=0.7.0
36-
curl --location --output ic-repl "https://github.com/chenyan2002/ic-repl/releases/download/$version/ic-repl-linux64"
35+
version=0.7.7
36+
curl --location --output ic-repl "https://github.com/dfinity/ic-repl/releases/download/$version/ic-repl-linux64"
3737
mv ./ic-repl /usr/local/bin/ic-repl
3838
chmod a+x /usr/local/bin/ic-repl
3939

.github/workflows/rust-composite_query-example.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,9 @@ jobs:
2525
run: |
2626
pushd rust/composite_query
2727
dfx start --background
28-
dfx canister create data_partition
28+
dfx canister create data_partition --no-wallet
2929
dfx build data_partition
30-
dfx canister create kv_frontend
30+
dfx canister create kv_frontend --no-wallet
3131
dfx build kv_frontend
3232
dfx canister install kv_frontend
3333
dfx canister call kv_frontend put '(1, 1337)'
@@ -43,9 +43,9 @@ jobs:
4343
run: |
4444
pushd rust/composite_query
4545
dfx start --background
46-
dfx canister create data_partition
46+
dfx canister create data_partition --no-wallet
4747
dfx build data_partition
48-
dfx canister create kv_frontend
48+
dfx canister create kv_frontend --no-wallet
4949
dfx build kv_frontend
5050
dfx canister install kv_frontend
5151
dfx canister call kv_frontend put '(1, 1337)'

.github/workflows/rust-hello-example.yml

Lines changed: 0 additions & 40 deletions
This file was deleted.
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
name: rust-low_wasm_memory
2+
on:
3+
push:
4+
branches:
5+
- master
6+
pull_request:
7+
paths:
8+
- rust/low_wasm_memory/**
9+
- .github/workflows/provision-darwin.sh
10+
- .github/workflows/provision-linux.sh
11+
- .github/workflows/rust-low_wasm_memory-example.yml
12+
- .github/workflows/rust-low_wasm_memory-skip.yml
13+
- .ic-commit
14+
concurrency:
15+
group: ${{ github.workflow }}-${{ github.ref }}
16+
cancel-in-progress: true
17+
jobs:
18+
rust-low_wasm_memory-darwin:
19+
runs-on: macos-15
20+
steps:
21+
- uses: actions/checkout@v1
22+
- name: Provision Darwin
23+
run: bash .github/workflows/provision-darwin.sh
24+
- name: Rust low_wasm_memory Darwin
25+
run: |
26+
pushd rust/low_wasm_memory
27+
dfx start --background
28+
dfx deploy low_wasm_memory_hook
29+
dfx canister update-settings low_wasm_memory_hook --wasm-memory-limit 3000000 --wasm-memory-threshold 2000000
30+
dfx canister status low_wasm_memory_hook
31+
dfx canister call low_wasm_memory_hook --query get_executed_functions_order | grep -q 'OnLowWasmMemory' || while ! dfx canister call low_wasm_memory_hook --query get_executed_functions_order | grep -q 'OnLowWasmMemory'; do
32+
sleep 1
33+
done
34+
popd
35+
rust-low_wasm_memory-linux:
36+
runs-on: ubuntu-22.04
37+
steps:
38+
- uses: actions/checkout@v1
39+
- name: Provision Linux
40+
run: bash .github/workflows/provision-linux.sh
41+
- name: Rust low_wasm_memory Linux
42+
run: |
43+
pushd rust/low_wasm_memory
44+
dfx start --background
45+
dfx deploy low_wasm_memory_hook
46+
dfx canister update-settings low_wasm_memory_hook --wasm-memory-limit 3000000 --wasm-memory-threshold 2000000
47+
dfx canister status low_wasm_memory_hook
48+
dfx canister call low_wasm_memory_hook --query get_executed_functions_order | grep -q 'OnLowWasmMemory' || while ! dfx canister call low_wasm_memory_hook --query get_executed_functions_order | grep -q 'OnLowWasmMemory'; do
49+
sleep 1
50+
done
51+
popd

0 commit comments

Comments
 (0)