### Setup Project Environment Source: https://github.com/dfinity/examples/blob/master/motoko/vetkd/README.md Navigate to the example directory and start the local IC replica. This command prepares the environment for deployment. ```bash cd examples/motoko/vetkd dfx start --background --clean ``` -------------------------------- ### Clone Hello, World! Example Source: https://github.com/dfinity/examples/blob/master/motoko/hello_world/README.md Clone the example project to start developing locally. ```bash git clone https://github.com/dfinity/examples cd examples/motoko/hello_world ``` -------------------------------- ### Clone Example Project Source: https://github.com/dfinity/examples/blob/master/rust/send_http_post/README.md Clone the example project from GitHub to get started. ```bash git clone https://github.com/dfinity/examples cd examples/rust/send_http_post ``` -------------------------------- ### Setup Project Environment Source: https://github.com/dfinity/examples/blob/master/motoko/cert-var/README.md Navigate to the project directory and start a local IC instance. ```bash cd examples/motoko/cert-var dfx start --background ``` -------------------------------- ### Install Dependencies and Start Development Server Source: https://github.com/dfinity/examples/blob/master/svelte/svelte-motoko-starter/src/frontend/README.md Install project dependencies using npm and start the development server with Rollup. Changes are reflected on hot reload. ```bash cd svelte-app npm install npm run dev ``` -------------------------------- ### Clone the Example Project Source: https://github.com/dfinity/examples/blob/master/motoko/who_am_i/README.md Clone the 'who_am_i' example project from the dfinity/examples repository to start development. ```bash git clone https://github.com/dfinity/examples cd examples/motoko/who_am_i ``` -------------------------------- ### Start Local IC Environment Source: https://github.com/dfinity/examples/blob/master/motoko/icrc2-swap/README.md Navigate to the project directory and start a local instance of the Internet Computer. Ensure the IC SDK is installed. ```bash cd examples/motoko/icrc2-swap dfx start --background ``` -------------------------------- ### Setup Project Environment Source: https://github.com/dfinity/examples/blob/master/rust/canister-snapshots/README.md Navigate to the project directory and start a local IC instance. This command will block the terminal. ```bash cd examples/rust/canister-snapshots dfx start ``` -------------------------------- ### Install Frontend Dependencies and Start Development Server Source: https://github.com/dfinity/examples/blob/master/motoko/ic-pos/README.md Installs project dependencies using pnpm and starts a local development server for the frontend application. The app is typically accessible at http://localhost:5173. ```bash pnpm install pnpm run dev ``` -------------------------------- ### Clone React Frontend Example Source: https://github.com/dfinity/examples/blob/master/hosting/react/README.md Clone the example project from GitHub to start developing locally. Ensure Node.js and icp-cli are installed. ```bash git clone https://github.com/dfinity/examples cd examples/hosting/react ``` -------------------------------- ### Clone EVM Block Explorer Example Source: https://github.com/dfinity/examples/blob/master/rust/evm_block_explorer/README.md Clone the example project from GitHub to get started. ```bash git clone https://github.com/dfinity/examples cd examples/rust/evm_block_explorer ``` -------------------------------- ### Clone Example Project Source: https://github.com/dfinity/examples/blob/master/hosting/my_crypto_blog/README.md Clone the example project repository to your local machine. Ensure you have Git installed. ```bash git clone https://github.com/dfinity/examples cd examples/hosting/my_crypto_blog ``` -------------------------------- ### Setup Project Environment with DFX Source: https://github.com/dfinity/examples/blob/master/motoko/internet_identity_integration/README.md Navigate to the project directory, start a local IC instance, and create a new dapp project using `dfx new`. ```bash cd examples/motoko/internet_identity_integration dfx start --background dfx new greet ``` -------------------------------- ### Start Local Replica and Deploy Project Source: https://github.com/dfinity/examples/blob/master/rust/vetkd/README.md Commands to start a local Internet Computer replica and deploy the project. Ensure Node.js dependencies are installed first. ```sh cd examples/rust/vetkd dfx start --background --clean ``` ```sh npm install ``` ```sh dfx deploy ``` -------------------------------- ### Clone Example Project Source: https://github.com/dfinity/examples/blob/master/rust/send_http_get/README.md Clone the example project repository to your local machine. This sets up the necessary files for the HTTP GET dapp. ```bash git clone https://github.com/dfinity/examples cd examples/rust/send_http_get ``` -------------------------------- ### Clone Motoko Backend Example Source: https://github.com/dfinity/examples/blob/master/motoko/backend_only/README.md Clone the example project from GitHub to start local development. ```bash git clone https://github.com/dfinity/examples cd examples/motoko/backend_only ``` -------------------------------- ### Clone Rust Backend Example Source: https://github.com/dfinity/examples/blob/master/rust/backend_only/README.md Clone the example project from GitHub to start development. ```bash git clone https://github.com/dfinity/examples cd examples/rust/backend_only ``` -------------------------------- ### Start Local Development Server Source: https://github.com/dfinity/examples/blob/master/motoko/cert-var/README.md This command starts the local development server using npm. Ensure you have the necessary dependencies installed. ```bash npm start ``` -------------------------------- ### Start Local IC Environment Source: https://github.com/dfinity/examples/blob/master/rust/canister-snapshot-download/README.md Starts a clean, background instance of the local Internet Computer. Ensure the IC SDK is installed and the dfx version is compatible with canister snapshots. ```bash cd examples/rust/canister-snapshot-download dfx start --clean --background ``` -------------------------------- ### Deploy Project Locally Source: https://github.com/dfinity/examples/blob/master/motoko/daily_planner/README.md Use this command to start a local Internet Computer environment and deploy the project. Ensure the IC SDK is installed. ```bash dfx start --background --clean && dfx deploy ``` -------------------------------- ### Clone and Install dfx CLI Source: https://github.com/dfinity/examples/blob/master/README.md Clone the examples repository and install the dfx command-line tool to manage ICP projects locally. ```bash git clone https://github.com/dfinity/examples.git cd examples sh -ci "$(curl -fsSL https://internetcomputer.org/install.sh)" ``` -------------------------------- ### Clone Hello World Example Source: https://github.com/dfinity/examples/blob/master/rust/hello_world/README.md Clone the example project locally to begin development. Navigate into the project directory after cloning. ```bash git clone https://github.com/dfinity/examples cd examples/rust/hello_world ``` -------------------------------- ### Deploy Project with IC SDK Source: https://github.com/dfinity/examples/blob/master/rust/query_stats/README.md Command to start a local IC environment in the background and deploy the project. Ensure the IC SDK is installed and the project is downloaded. ```bash dfx start --background --clean && dfx deploy ``` -------------------------------- ### Clone the Examples Repository Source: https://github.com/dfinity/examples/blob/master/rust/basic_bitcoin/README.md Clone the DFINITY examples repository to access the basic Bitcoin smart contract code. Navigate into the specific example directory. ```bash git clone https://github.com/dfinity/examples cd examples/rust/basic_bitcoin ``` -------------------------------- ### Start Ollama Server Source: https://github.com/dfinity/examples/blob/master/rust/llm_chatbot/README.md Run this command to start the Ollama server for processing LLM prompts. Ensure Ollama is installed first. ```bash ollama serve # Expected to start listening on port 11434 ``` -------------------------------- ### Clone the example project Source: https://github.com/dfinity/examples/blob/master/rust/who_am_i/README.md Use this command to clone the 'who_am_i' example project from GitHub. ```bash git clone https://github.com/dfinity/examples cd examples/rust/who_am_i ``` -------------------------------- ### Clone Photo Storage Example Source: https://github.com/dfinity/examples/blob/master/hosting/photo-storage/README.md Clone the example project from GitHub to your local machine. ```bash git clone https://github.com/dfinity/examples cd examples/hosting/photo-storage ``` -------------------------------- ### Install Frontend Dependencies Source: https://github.com/dfinity/examples/blob/master/motoko/cert-var/README.md Install the necessary Node.js packages for the frontend. ```bash npm install ``` -------------------------------- ### Start Frontend Development Server with NPM Source: https://github.com/dfinity/examples/blob/master/rust/photo_gallery/README.md Starts the frontend development server, useful for local development and testing of the user interface. ```bash npm start ``` -------------------------------- ### Install Frontend Dependencies Source: https://github.com/dfinity/examples/blob/master/svelte/svelte-motoko-starter/README.md Navigate to the frontend directory and install its dependencies using npm. This is a prerequisite for building and running the frontend. ```bash cd src/frontend npm install cd .. ``` -------------------------------- ### Deploy and Start Local IC Source: https://github.com/dfinity/examples/blob/master/rust/x509/README.md Starts a local instance of the Internet Computer using the IC SDK for local development and testing. ```bash cd examples/rust/x509 dfx start --background npm install dfx deploy ``` -------------------------------- ### Install Auth Client and Identity Libraries Source: https://github.com/dfinity/examples/blob/master/motoko/internet_identity_integration/README.md Install the @dfinity/auth-client and @dfinity/identity libraries as development dependencies for your frontend application. ```bash npm install @dfinity/auth-client @dfinity/identity --save-dev ``` -------------------------------- ### Clone the Example Dapp Project Source: https://github.com/dfinity/examples/blob/master/rust/qrcode/README.md Clones the repository containing the QR code generator example from GitHub. ```bash git clone https://github.com/dfinity/examples ``` -------------------------------- ### Start Local Replica Source: https://github.com/dfinity/examples/blob/master/motoko/icp_transfer/README.md Starts a local replica for the Internet Computer in the background and cleans previous states. ```bash dfx start --background --clean ``` -------------------------------- ### Start Local Replica Source: https://github.com/dfinity/examples/blob/master/rust/simd/README.md Starts a local instance of the replica. Requires dfx version 0.20.2-beta.0 or later. ```sh dfx start --clean Running dfx start for version 0.20.2-beta.0 [...] Dashboard: http://localhost:63387/_/dashboard ``` -------------------------------- ### Example GitHub Actions CI Workflow Source: https://github.com/dfinity/examples/blob/master/ADDING_AN_EXAMPLE.md This is an example of a GitHub Actions CI file for an example project. It defines build actions for Darwin and Linux, and tests for both Motoko and Rust projects. Ensure this file is named appropriately, e.g., '.github/workflows/hello_world.yml'. ```yaml .github/workflows/hello_world.yml ``` -------------------------------- ### Start Local Replica with dfx Source: https://github.com/dfinity/examples/blob/master/rust/periodic_tasks/README.md Starts a local instance of the Internet Computer replica. This command will block the terminal until interrupted. ```sh cd examples/rust/periodic_tasks dfx start --clean ``` -------------------------------- ### Install project dependencies and deploy locally Source: https://github.com/dfinity/examples/blob/master/motoko/daily_planner/BUILD.md Installs project dependencies using npm and deploys the project to the local dfx environment. ```sh npm install ``` ```sh dfx deploy ``` -------------------------------- ### Start Local IC Replica and Navigate Project Source: https://github.com/dfinity/examples/blob/master/motoko/ic-pos/README.md Navigate to the project directory and start a local instance of the Internet Computer. This is the first step for manual deployment. ```bash cd examples/motoko/ic-pos dfx start --background ``` -------------------------------- ### Clone the example project Source: https://github.com/dfinity/examples/blob/master/hosting/oisy-signer-demo/README.md Use git to clone the repository and navigate into the project directory. ```bash git clone https://github.com/dfinity/examples cd examples/hosting/oisy-signer-demo ``` -------------------------------- ### Initialize Project Environment Source: https://github.com/dfinity/examples/blob/master/motoko/token_transfer/README.md Sets up the local Internet Computer instance and creates a new Motoko project for token transfers. Ensure the IC SDK is installed. ```bash dfx start --background dfx new --type=motoko token_transfer --no-frontend cd token_transfer ``` -------------------------------- ### Clone Static Website Example Project Source: https://github.com/dfinity/examples/blob/master/hosting/static-website/README.md Clones the example project from GitHub and navigates into the static website directory. This sets up the local environment for deployment. ```bash git clone https://github.com/dfinity/examples cd examples/hosting/static-website ``` -------------------------------- ### Start Local Replica and Deploy Dapp Source: https://github.com/dfinity/examples/blob/master/rust/qrcode/README.md Commands to start a local replica and deploy the QR code generator dapp. Ensure you are in the project's directory. ```bash cd examples/rust/qrcode dfx start --clean --background ``` ```bash dfx deploy ``` -------------------------------- ### Clone Godot HTML5 Sample Project Source: https://github.com/dfinity/examples/blob/master/hosting/godot-html5-template/README.md Clone the example project from GitHub to your local machine. This command initializes the project structure for deployment. ```bash git clone https://github.com/dfinity/examples cd examples/hosting/godot-html5-template ``` -------------------------------- ### Run Test Suite Source: https://github.com/dfinity/examples/blob/master/motoko/icrc2-swap/README.md Execute the project's test suite to demonstrate and verify the core functionality of the ICRC-2 swap example. This command should be run after installing dependencies. ```bash make test ``` -------------------------------- ### Start Timer with Interval Source: https://github.com/dfinity/examples/blob/master/rust/periodic_tasks/README.md Initiates a timer within the timer canister to execute a periodic task at a specified interval in seconds. This is an example of interacting with the canister's interface. ```sh dfx canister call timer start_with_interval_secs 5 ``` -------------------------------- ### Get Messages API Example Source: https://github.com/dfinity/examples/blob/master/rust/vetkeys/encrypted_chat/SPEC.md Retrieves encrypted messages for a given chat, excluding expired messages based on the set expiry duration. 'Limit' specifies the maximum number of messages to retrieve. ```motoko get_messages : (ChatId, ChatMessageId, opt Limit) -> (vec EncryptedMessage) query; ``` -------------------------------- ### Verify BIP341 (Taproot) Signature in JavaScript Source: https://github.com/dfinity/examples/blob/master/motoko/threshold-schnorr/README.md Verifies a BIP341 (Taproot) signature using 'bitcoinjs-lib' and 'tiny-secp256k1'. This example includes key tweaking, which is specific to Taproot. Ensure both libraries are installed and 'bitcoinjs-lib' is initialized with the ECC library. ```javascript async function run() { try { const bip341 = await import('bitcoinjs-lib/src/payments/bip341.js'); const bitcoin = await import('bitcoinjs-lib'); const ecc = await import('tiny-secp256k1'); bitcoin.initEccLib(ecc); const test_tweak = Buffer.from('012345678901234567890123456789012345678901234567890123456789abcd', 'hex'); const test_sig = Buffer.from('3c3e51fc771a5a8cb553bf2dd151bb02d0f473ff274a92d32310267977918d72121f97c318226422c033d33daf376d42c9a07e71643ff332cb30611fe5e163da', 'hex'); const test_pubkey = Buffer.from('02472bb4da5c5ce627d599feba90d0257a558d4e226f9fc7914f811e301ad06f38'.substring(2), 'hex'); const test_msg = Uint8Array.from(Buffer.from("hellohellohellohellohellohello12", 'utf8')); const tweaked_test_pubkey = bip341.tweakKey(test_pubkey, test_tweak).x; console.log(ecc.verifySchnorr(test_msg, tweaked_test_pubkey, test_sig)); } catch(err) { console.log(err); } } run(); ``` -------------------------------- ### Install dfx Source: https://github.com/dfinity/examples/blob/master/motoko/daily_planner/BUILD.md Installs the dfx command-line tool. Ensure you have Rosetta installed on Apple Silicon. ```sh sh -ci "$(curl -fsSL https://internetcomputer.org/install.sh)" ``` -------------------------------- ### Install Rust and Cargo Source: https://github.com/dfinity/examples/blob/master/rust/basic_ethereum/BUILD.md Installs Rust and Cargo, required for Rust projects. Ensure you have Rosetta installed on Apple Silicon. ```sh curl https://sh.rustup.rs -sSf | sh ``` -------------------------------- ### Install ICP CLI Tools Source: https://github.com/dfinity/examples/blob/master/hosting/my_crypto_blog/BUILD.md Install the ICP CLI and WASM tools globally using npm. Ensure Node.js is installed first. ```bash npm install -g @icp-sdk/icp-cli @icp-sdk/ic-wasm ``` -------------------------------- ### Start Local Replica and Create Project Source: https://github.com/dfinity/examples/blob/master/rust/icp_transfer/README.md Commands to start a local replica and create a new Rust project for ICP transfer. Ensure dfx version is 0.22.0 or higher. ```bash dfx start --background dfx new --type=rust icp_transfer --no-frontend cd icp_transfer ``` -------------------------------- ### Example Output for Composite Query Call Source: https://github.com/dfinity/examples/blob/master/rust/performance_counters/README.md Example output from calling the 'for_composite_query' method. Note that the output format and values are similar to the update call example. ```sh % dfx canister call performance_counters for_update (6_621_477 : nat64, 19_893_467 : nat64) ``` -------------------------------- ### Install Rust and candid-extractor Source: https://github.com/dfinity/examples/blob/master/motoko/daily_planner/BUILD.md Installs Rust and the candid-extractor tool for Rust projects. ```sh curl https://sh.rustup.rs -sSf | sh ``` ```sh cargo install candid-extractor ``` -------------------------------- ### Install candid-extractor Source: https://github.com/dfinity/examples/blob/master/rust/basic_ethereum/BUILD.md Installs the candid-extractor tool using Cargo, necessary for Rust projects. ```sh cargo install candid-extractor ``` -------------------------------- ### Clone Unity WebGL Sample Project Source: https://github.com/dfinity/examples/blob/master/hosting/unity-webgl-template/README.md Clone the example project repository from GitHub to your local machine. ```bash git clone https://github.com/dfinity/examples cd examples/hosting/unity-webgl-template ``` -------------------------------- ### Start local dfx environment Source: https://github.com/dfinity/examples/blob/master/motoko/daily_planner/BUILD.md Starts the local dfx development environment in the background. ```sh dfx start --background ``` -------------------------------- ### Start Local Internet Computer Source: https://github.com/dfinity/examples/blob/master/motoko/canister_factory/README.md Starts a local instance of the Internet Computer for development and testing. Use `--clean` to reset the state. ```bash dfx start --background ``` ```bash dfx start --background --clean ``` -------------------------------- ### Clone and Install Project Dependencies Source: https://github.com/dfinity/examples/blob/master/svelte/sveltekit-starter/README.md Clone the repository and install project dependencies using npm. ```bash git clone https://github.com/dfinity/examples cd svelte/sveltekit-starter npm ci ```