### Instantiate and Start Internet Computer Source: https://github.com/dfinity/ic/blob/master/rs/tests/README.md Example of how to instantiate and start an Internet Computer within a test setup function. This involves using `InternetComputer::new()` and `setup_and_start()`. ```rust fn setup(test_env: TestEnv) { InternetComputer::new() .with_subnet(/* ... */) .setup_and_start(&test_env); // (1) } fn test(test_env: TestEnv) { use crate::test_env_api::*; let root_subnet = test_env .topology_snapshot() .root_subnet(); // (3) } ``` -------------------------------- ### Start Local Replica Node Source: https://context7.com/dfinity/ic/llms.txt Instructions for starting a local replica node using the `replica` binary. This includes printing a sample configuration, starting with a config file, using an inline config literal, or seeding from a catch-up package. ```bash # Print the full sample configuration replica --print-sample-config > /tmp/replica.toml ``` ```bash # Start the replica with a config file replica \ ``` ```bash --config-file /path/to/replica.toml \ ``` ```bash --replica-version 0.9.0 ``` ```bash # Start with an inline config literal replica \ ``` ```bash --config-literal '{"transport": {"node_ip": "127.0.0.1"}}' \ ``` ```bash --replica-version 0.9.0 ``` ```bash # Seed from a CBOR-encoded catch-up package (for recovery scenarios) replica \ ``` ```bash --config-file /path/to/replica.toml \ ``` ```bash --replica-version 0.9.0 \ ``` ```bash --catch-up-package /path/to/cup.cbor ``` -------------------------------- ### Start Local Replica with dfx Source: https://github.com/dfinity/ic/blob/master/rs/nns/README.adoc Starts a local replica for development and testing. Ensure you are in the `rs/nns` directory. ```shell dfx start --host 127.0.0.1:8080 ``` -------------------------------- ### Complete Disk Image Example Source: https://github.com/dfinity/ic/blob/master/toolchains/sysimage/README.adoc An example demonstrating the creation of a disk image with a single partition populated from a container image. ```bazel build_container_filesystem_tar( name="tree.tar", src=":tree", dep=glob(["tree/**"]), ) ext4_image( name="part1.img.tar", src=":tree.tar", partition_size="1G", ) disk_image( name="disk.img.tar", layout=":partitions.csv", partitions=[ ":part1.img.tar", ], ) ``` -------------------------------- ### Install Backup System Source: https://github.com/dfinity/ic/blob/master/rs/backup/README.md Execute this command to install the backup system. Ensure the machine meets the specified hardware requirements. ```bash bash <(curl -L https://raw.githubusercontent.com/dfinity/ic/master/rs/backup/install.sh) ``` -------------------------------- ### Install Prerequisites with Poetry Source: https://github.com/dfinity/ic/blob/master/ic-os/dev-tools/bare_metal_deployment/README.md Commands to initialize git submodules and install project dependencies using Poetry. ```bash git submodule update --init poetry install ``` -------------------------------- ### System Test Execution Example Source: https://github.com/dfinity/ic/blob/master/rs/tests/README.md Example command to run all 'pre-master' system tests and log the output. This requires the commit to be built by CI/CD. ```bash ./run-system-tests.py --suite pre_master 2>&1 | tee system-test-logs.log ``` -------------------------------- ### Install Dependencies Source: https://github.com/dfinity/ic/blob/master/ic-os/dev-tools/hw_validation/readme.md Installs sysbench and stress-ng on Ubuntu systems. ```bash sudo apt install sysbench stress-ng ``` -------------------------------- ### Install Dependencies Source: https://github.com/dfinity/ic/blob/master/rs/rosetta-api/examples/README.md Installs project dependencies from a requirements.txt file. Ensure you have pip installed. ```sh pip install -r requirements.txt ``` -------------------------------- ### Start Bitcoin Adapter Source: https://github.com/dfinity/ic/blob/master/rs/bitcoin/adapter/README.md Removes old UDS, generates adapter config, and runs the adapter. Ensure you are in the 'ic/rs' directory. ```bash rm /tmp/test-btc-adapter-uds JSON_STRING='{"network":"bitcoin","logger":{"level":"info"}, "incoming_source": {"Path": "/tmp/test-btc-adapter-uds"},"dns_seeds": ["seed.bitcoin.sipa.be", "dnsseed.bluematt.me", "dnsseed.bitcoin.dashjr.org", "seed.bitcoinstats.com", "seed.bitcoin.jonasschnelli.ch", "seed.btc.petertodd.org", "seed.bitcoin.sprovoost.nl", "dnsseed.emzy.de", "seed.bitcoin.wiz.biz"]}' echo $JSON_STRING > /tmp/test-btc-adapter-uds-config.json # cd ic/rs cargo run --bin ic-btc-adapter /tmp/test-btc-adapter-uds-config.json ``` -------------------------------- ### Start Local DFX Replica Source: https://github.com/dfinity/ic/blob/master/rs/ledger_suite/icrc1/ledger/README.adoc Starts the DFX local replica in the background. Ensure the specified port in dfx.json is available. ```bash dfx start --background ``` -------------------------------- ### Start Dogecoind Daemon for Testing Source: https://github.com/dfinity/ic/blob/master/packages/pocket-ic/HOWTO.md Configure and start a dogecoind daemon for integration testing. Ensure the dogecoind binary is accessible and specify network configuration. ```rust // the crate `ic-btc-adapter-test-utils` is available in the dfinity/ic repository use ic_btc_adapter_test_utils::{ bitcoind::{Conf, Daemon} }; // the crate `bitcoin` is available in the dfinity/rust-dogecoin repository use bitcoin::dogecoin::{Network as DogeNetwork}; let dogecoind_path = [...]; // path to the `dogecoind` binary let conf = Conf { p2p: true, ..Conf::default() }; let dogecoind = Daemon::new(&dogecoind_path, DogeNetwork::Regtest, conf).unwrap(); ``` -------------------------------- ### Generate Install Args for BTC Checker Source: https://github.com/dfinity/ic/blob/master/rs/bitcoin/ckbtc/mainnet/btc_checker_reinstall_2024_12_09.md Use this command to generate the installation arguments for the BTC Checker canister. Ensure you have fetched the latest code and are in the correct directory. The output hash should match the expected install args hash. ```bash git fetch git checkout f901615f3daa36a5f3a9a6277140e1895ed53d2d cd rs/bitcoin/checker didc encode -d btc_checker_canister.did -t '(CheckArg)' '(variant { InitArg = record { btc_network = variant { mainnet }; check_mode = variant { Normal }; } })' | xxd -r -p | sha256sum ``` -------------------------------- ### Test All Examples (Basic) Source: https://github.com/dfinity/ic/blob/master/rs/rosetta-api/examples/icrc1/python/README.md Runs a basic test of all non-destructive examples. Requires node address and principal ID. ```sh # Basic test of all non-destructive examples (requires principal ID) python3 test_all.py --node-address http://localhost:8082 --canister-id --principal-id ``` -------------------------------- ### Start Local Replica with Debug Logging Source: https://github.com/dfinity/ic/blob/master/rs/ledger_suite/icp/README.md Starts a local replica with detailed logging enabled to a specified file. Useful for debugging canister behavior. ```bash $ dfx start --clean --background -vv --log file --logfile /tmp/dfx.log ``` -------------------------------- ### Install and Commit GuestOS Upgrade Source: https://github.com/dfinity/ic/blob/master/ic-os/docs/Upgrades.adoc Execute these manageboot.sh commands to install the upgrade image and commit the changes. The system will reboot into the new version. ```bash manageboot.sh upgrade-install update-img.tar ``` ```bash manageboot.sh upgrade-commit ``` -------------------------------- ### Example CUP Verification Command Source: https://github.com/dfinity/ic/blob/master/rs/cup_explorer/README.md Demonstrates the command to verify a CUP file, including the path to the CUP protobuf file. ```bash bazel run rs/cup_explorer:cup_explorer_bin -- verify --cup-path /path/to/cup.pb ``` -------------------------------- ### Generate Bitcoin Checker Install Args Source: https://github.com/dfinity/ic/blob/master/rs/bitcoin/ckbtc/mainnet/btc_checker_install_2024_12_06.md Use this command to generate the installation arguments for the Bitcoin Checker canister. It involves fetching the correct git commit, navigating to the checker directory, encoding the canister's DID definition with initialization arguments, and calculating the SHA256 hash. ```bash git fetch git checkout 9849a2f03af855d09ac42f5949393c86df3d9c47 cd rs/bitcoin/checker didc encode -d btc_checker_canister.did -t '(CheckArg)' '(variant { InitArg = record { btc_network = variant { mainnet }; check_mode = variant { Normal }; } })' | xxd -r -p | sha256sum ``` -------------------------------- ### Get help for ict CLI Source: https://github.com/dfinity/ic/blob/master/rs/tests/README_NEW.md Access the help menu for the `ict` CLI to explore its available commands and options. ```bash devenv-container$ ict -h ``` -------------------------------- ### Get Test Coverage Data Source: https://github.com/dfinity/ic/blob/master/rs/nervous_system/tools/release/README.md Generates coverage reports for a specified canister using cargo-llvm-cov. Requires cargo-llvm-cov to be installed. ```bash get_test_coverage.sh ``` ```bash get_test_coverage.sh sns governance ``` -------------------------------- ### Create Basic Go Project Structure Source: https://github.com/dfinity/ic/blob/master/bazel/README.md Sets up a new directory for a basic Go program and creates the main Go source file. ```bash **mkdir go-demo-basic cd go-demo-basic** **touch main.go** ``` -------------------------------- ### Get Token Balance for an Address Source: https://github.com/dfinity/ic/blob/master/rs/nns/gtc/README.adoc Calls the 'balance' method on the GTC canister to retrieve the token balance for a specific address. Replace the example address with the desired one. ```bash > dfx canister call gtc_rs balance "006b572cd1af263c1f6c7c4d74f9260cd308c937" (756) ``` -------------------------------- ### Run Basic Go Program with Bazel Source: https://github.com/dfinity/ic/blob/master/bazel/README.md Builds and executes the basic Go 'hello world' program using Bazel. ```bash **bazel run //go-demo-basic:go-demo-basic 2>/dev/null** ``` -------------------------------- ### Spin up Dynamic Testnet with Rust Source: https://github.com/dfinity/ic/blob/master/rs/ethereum/cketh/mainnet/README.md Use this Rust code to configure and start a local Internet Computer testnet. It sets up system and application subnets and installs NNS customizations. ```rust pub fn setup(env: TestEnv) { let mut ic = InternetComputer::new().add_subnet(Subnet::new(SubnetType::System).add_nodes(1)); for _ in 0..36 { ic = ic.add_subnet(Subnet::new(SubnetType::Application).add_nodes(1)); } ic.with_unassigned_nodes(1) .setup_and_start(&env) .expect("Failed to setup IC under test"); install_nns_with_customizations_and_check_progress( env.topology_snapshot(), NnsCustomizations::default(), ); } ``` -------------------------------- ### Check Account Balance Source: https://github.com/dfinity/ic/blob/master/rs/rosetta-api/examples/icrc1/python/README.md Retrieve the token balance for a given principal. This example shows how to get both the raw balance and an aggregated balance across all subaccounts, using auto-discovered token information for human-readable formatting. ```python # Get account balance (with auto-discovered token info) balance = client.get_balance(principal="abc123...") print(f"Balance: {int(balance['balances'][0]['value']) / 10**balance['balances'][0]['currency']['decimals']} {balance['balances'][0]['currency']['symbol']}") # Get aggregated balance across all subaccounts aggregated_balance = client.get_aggregated_balance(principal="abc123...") print(f"Total Balance (All Subaccounts): {int(aggregated_balance['balances'][0]['value']) / 10**aggregated_balance['balances'][0]['currency']['decimals']} {aggregated_balance['balances'][0]['currency']['symbol']}") ``` -------------------------------- ### Build GuestOS Image Example Source: https://github.com/dfinity/ic/blob/master/ic-os/README.adoc This specific command builds a development version of the GuestOS image. The output will be located in the specified path. ```bash $ bazel build //ic-os/guestos/envs/dev/... # This will output a GuestOS image in /ic/bazel-bin/ic-os/guestos/envs/dev ``` -------------------------------- ### Initialize SNS Testing Environment Source: https://github.com/dfinity/ic/blob/master/rs/sns/testing/README.md Sets up the environment by building required binaries and adding them to the PATH. Should be run from the root of the 'ic-sns-testing' crate. ```bash . scripts/env.sh ``` -------------------------------- ### Generate Install Args Hash Source: https://github.com/dfinity/ic/blob/master/rs/cross-chain/proposal-cli/templates/install.md This command fetches the latest code, checks out a specific commit, and then encodes the installation arguments using `didc` to generate a SHA256 hash. This is used to verify the integrity of the installation arguments. ```bash git fetch git checkout {{at}} {{install_args.didc_encode_cmd()}} | xxd -r -p | sha256sum ``` -------------------------------- ### Run Minimal ic-boundary Instance Source: https://github.com/dfinity/ic/blob/master/rs/boundary_node/ic_boundary/README.md Use this command to start a basic ic-boundary instance. Specify the local store path for registry data and the HTTP port for listening. ```sh ic-boundary \ --local-store-path \ --http-port \ --log-stdout ``` -------------------------------- ### Run Minimal ic-boundary Instance Source: https://context7.com/dfinity/ic/llms.txt Starts a minimal ic-boundary instance with specified local store path and HTTP port, logging to stdout. ```bash # Run a minimal ic-boundary instance ic-boundary \ --local-store-path /var/lib/ic-boundary/registry \ --http-port 80 \ --log-stdout # List all configuration options ic-boundary --help # Build the boundary node with Bazel bazel build //rs/boundary_node/ic_boundary:ic_boundary ``` -------------------------------- ### View ic-nns-init Options Source: https://context7.com/dfinity/ic/llms.txt Displays all available command-line options for the `ic-nns-init` binary. ```bash cargo run --bin ic-nns-init -- --help ``` -------------------------------- ### Run GuestOS Image in QEMU Source: https://github.com/dfinity/ic/blob/master/ic-os/guestos/README.adoc Boots a GuestOS disk image directly in QEMU. Ensure QEMU with qemu-system and qemu-kvm is installed. Press Ctrl-A then x to exit. ```bash qemu-system-x86_64 \ -machine type=q35,accel=kvm \ -enable-kvm \ -nographic \ -m 4G \ -bios /usr/share/ovmf/OVMF.fd \ -device vhost-vsock-pci,guest-cid=\\"$$CID\\" \ -drive file=disk.img,format=raw,if=virtio \ -netdev user,id=user.0,hostfwd=tcp::2222-:22 \ -device virtio-net,netdev=user.0 ``` -------------------------------- ### Build IC-OS Operating System Images Source: https://context7.com/dfinity/ic/llms.txt Commands to build the production and development variants of IC-OS images (SetupOS, HostOS, GuestOS) using Bazel. Outputs are located in `/ic/bazel-bin/ic-os/...`. ```bash # Build all three OS images bazel build //ic-os/{setupos,hostos,guestos}/envs/prod/... ``` ```bash # Build the dev variants (console access enabled, credentials root/root) bazel build //ic-os/guestos/envs/dev/... bazel build //ic-os/hostos/envs/dev/... bazel build //ic-os/setupos/envs/dev/... ``` ```bash # Build the dev-malicious GuestOS variant (for fault injection testing) bazel build //ic-os/guestos/envs/dev-malicious/... ``` -------------------------------- ### CSV Secrets File Example (No IPv6) Source: https://github.com/dfinity/ic/blob/master/ic-os/dev-tools/bare_metal_deployment/README.md Example of a CSV secrets file with IP address, username, and password for BMCs. ```csv 10.10.10.123,root,password 10.10.10.124,root,password ``` -------------------------------- ### Prepare for Upgrade Source: https://github.com/dfinity/ic/blob/master/rs/ethereum/cketh/mainnet/cketh_archive_upgrade_2024_08_19.md Fetch the latest code, checkout the specific commit, and navigate to the archive directory to prepare for the upgrade process. ```bash git fetch git checkout 3d0b3f10417fc6708e8b5d844a0bac5e86f3e17d cd rs/rosetta-api/icrc1/archive ``` -------------------------------- ### Start Candid Web UI Source: https://context7.com/dfinity/ic/llms.txt Starts the Candid web UI for manual canister interaction. The URL provided is for the Governance canister. ```bash dfx bootstrap # Then open: http://localhost:8081/candid?canisterId=rrkah-fqaaa-aaaaa-aaaaq-cai (Governance) ``` -------------------------------- ### Enable Performance Benchmarking Source: https://github.com/dfinity/ic/blob/master/ic-os/dev-tools/bare_metal_deployment/README.md After deploying the desired image, start benchmarking by adding the `--benchmark` flag to the original deployment command. Ensure an SSH key is provided for node access. ```bash bazel run //ic-os/setupos/envs/dev:launch_bare_metal --config=local -- \ --config_path $(realpath ./ic-os/dev-tools/bare_metal_deployment/zh2-dll01.yaml) \ --ini_filename $(realpath ./zh2-dll01.csv) --benchmark ``` -------------------------------- ### Create Project Directory Source: https://github.com/dfinity/ic/blob/master/rs/ledger_suite/icrc1/ledger/README.adoc Sets up a new, empty directory for the ICRC-1 ledger test environment. ```bash mkdir icrc1_ledger_test cd icrc1_ledger_test ``` -------------------------------- ### CKETH Private Key Example Source: https://github.com/dfinity/ic/blob/master/rs/ethereum/cketh/mainnet/README.md This is an example of a private key in PEM format, used for authenticating with the IC network when submitting proposals. ```text -----BEGIN PRIVATE KEY----- MFMCAQEwBQYDK2VwBCIEIHS9H6NEjE5Leh3oMjTXcESspk8fgapoDI/xCBZV fnKNoSMDIQD2HfCf/GkgYxwyFO2lbjCEcHa1yNj1HO8kGMftgRS8lA== -----END PRIVATE KEY----- ``` -------------------------------- ### Bazel Wildcard Target Examples Source: https://github.com/dfinity/ic/blob/master/bazel/README.md Demonstrates the use of wildcard targets like `:all` and `...` in Bazel for building or testing multiple targets. ```bash bazel build //rs/log_analyzer:all ``` ```bash cd rs; bazel build ... ``` ```bash cd rs; bazel test ... ``` -------------------------------- ### Start DFX with Verbose Logging Source: https://context7.com/dfinity/ic/llms.txt Starts the dfx daemon with clean state, in the background, and with verbose logging enabled. Logs are saved to `/tmp/dfx.log`. ```bash dfx start --clean --background -vv --log file --logfile /tmp/dfx.log ``` -------------------------------- ### Start Local DFX Replica for NNS Source: https://context7.com/dfinity/ic/llms.txt Starts a local dfx replica targeting the NNS directory. Ensure you are in the correct directory before running. ```bash cd rs/nns dfx start --host 127.0.0.1:8080 ``` -------------------------------- ### Create Advanced Go Project Structure Source: https://github.com/dfinity/ic/blob/master/bazel/README.md Sets up a new directory for an advanced Go program and creates the main Go source file. ```bash **mkdir go-demo-advanced cd go-demo-advanced touch main.go** ``` -------------------------------- ### Enter Docker Container for Bazel Source: https://github.com/dfinity/ic/blob/master/rs/tests/README_NEW.md Before running Bazel targets, enter the provided Docker container which sets up the necessary environment. ```bash /ic$ ./ci/container/container-run.sh ``` -------------------------------- ### Base Reward Calculation Example Source: https://github.com/dfinity/ic/blob/master/rs/node_rewards/node_provider_reward_calculations.md A simple example demonstrating the base calculation for node rewards, combining rewards for different node types. ```rust (4 * 240) + 456 // 4 'type1' nodes at 240 XDR + 1 'type3' node at 456 XDR ``` -------------------------------- ### Start Testnet with Container Script Source: https://github.com/dfinity/ic/blob/master/rs/ethereum/cketh/mainnet/README.md Execute this shell command to initiate the testnet creation process using the provided container script. Specify the output directory and temporary directory for the testnet. ```shell ./ci/container/container-run.sh ict testnet create small --output-dir=./small -- --test_tmpdir=./small ``` -------------------------------- ### ckUSDC Initialization Arguments Example Source: https://github.com/dfinity/ic/blob/master/rs/ethereum/ledger-suite-orchestrator/README.adoc Example arguments for initializing the ckUSDC token with the ledger suite orchestrator. Refer to the Candid interface for the most up-to-date information. ```text . `contract`: Uniquely identifies the ERC-20 smart contract. .. `chain_id = 1`: designates Ethereum mainnet. This value MUST be `1`. .. `address = "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48"`: address of the ERC-20 smart contract on Ethereum mainnet. The address MUST be a valid Ethereum address corresponding to an ERC-20 smart contract as specified in https://eips.ethereum.org/EIPS/eip-20[EIP-20]. . `ledger_init_arg`: Initialization arguments for the ledger that will be spawned off by the orchestrator. .. `decimals = 6`: number of decimals to used by the ledger. This SHOULD be the same number as the one returned by `decimals()` on the ERC-20 smart contract. .. `transfer_fee = 10_000`: cost of a user transaction on the ledger (e.g., `icrc1_transfer`, `icrc2_approve`, etc.). The goal of this fee is that it should be high enough to prevent spam (and in the future to pay for the cycles consumption), but low enough to encourage users from using the ckERC20 token. ... This number SHOULD be a power of 10 (e.g., 1, 10, 100, 1_000, 10_000, etc.) to ease any user's mental arithmetic. ... This number SHOULD be between the equivalent of 0.001 USD to 0.01 USD. .. `token_symbol = "ckUSDC"`: symbol of the twin ERC-20 token on the IC. This MUST be an ASCII string of at most 20 characters starting with the `ck` prefix. The symbol MUST be unique among all ckERC20 tokens. This SHOULD correspond to the `symbol()` of the ERC-20 smart contract prefixed with `ck`. .. `token_name = "ckUSDC"`: name of the twin ERC-20 token on the IC. This MAY be the same as `token_symbol`. .. `token_logo = "data:image/svg+xml;base64PHN2ZyB3...+Cg==`: logo of the twin ERC-20 token on the IC. This MUST be a https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URLs[data URL]. ``` -------------------------------- ### Deploy Blob Store Canister Locally Source: https://github.com/dfinity/ic/blob/master/rs/cross-chain/blob_store/README.md Start a local Internet Computer network and deploy the blob store canister. Ensure a local network is running before deployment. ```bash icp network start -d icp deploy ``` -------------------------------- ### Start Candid Web Server Source: https://github.com/dfinity/ic/blob/master/rs/nns/README.adoc Starts the Candid web server for manual interaction with NNS canisters. Use `--network=nnstestnet` if testing against a remote replica. ```shell dfx bootstrap ``` ```shell dfx bootstrap --network=nnstestnet ``` -------------------------------- ### Set up Userdata YAML for Cloud Instance Source: https://github.com/dfinity/ic/blob/master/ci/container/README.md Export revision and SSH key, then substitute variables in the userdata template to generate the final YAML for cloud-init. ```bash export REVISION="ff8d2c62c88a84b744bb1114c17aa1ea3......e" export SSH_KEY="ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPUaR2BDvN0ZDfQ+WFNa3NW3X3V3Qrxb7f6wn6ZbQkJm" envsubst < userdata-ubuntu-2204.yaml > userdata.yaml ``` -------------------------------- ### Prepare for Upgrade Arguments Source: https://github.com/dfinity/ic/blob/master/rs/bitcoin/ckbtc/mainnet/minter_upgrade_2025_01_24.md Fetch the latest code, checkout the specific commit, navigate to the minter directory, and encode the upgrade arguments. This prepares the environment for generating the upgrade arguments hash. ```bash git fetch git checkout 744f4683df2ca79f5f537b3db48a1c03d4ff084e cd rs/bitcoin/ckbtc/minter didc encode '()' | xxd -r -p | sha256sum ``` -------------------------------- ### CSV Secrets File Example (With IPv6) Source: https://github.com/dfinity/ic/blob/master/ic-os/dev-tools/bare_metal_deployment/README.md Example of a CSV secrets file including BMC credentials and the GuestOS IPv6 address for successful deployment verification. ```csv 10.10.10.123,root,password,2a00:fb01:400:44:6801::1234 10.10.10.124,root,password,2a00:fb01:400:44:6801::1235 ``` -------------------------------- ### Install Indexer Canister Source: https://github.com/dfinity/ic/blob/master/rs/ethereum/cketh/mainnet/README.md Installs the indexer canister using `ic-admin`. This command requires HSM configuration, canister details, and paths to the WASM module and argument file. ```shell ../../../../bazel-bin/rs/registry/admin/ic-admin \ --use-hsm \ --key-id $KEY_ID \ --slot 0 \ --pin $HSM_PIN \ --nns-url "https://ic0.app" \ propose-to-change-nns-canister \ --proposer $NEURON_ID \ --canister-id s3zol-vqaaa-aaaar-qacpa-cai \ --mode install \ --wasm-module-path ./ic-icrc1-index-ng-u256.wasm.gz \ --wasm-module-sha256 $WASM_SHA256 \ --arg index_arg.bin \ --summary-file ./index_proposal.md ``` -------------------------------- ### Start bitcoind Process Source: https://github.com/dfinity/ic/blob/master/packages/pocket-ic/HOWTO.md Initializes a `bitcoind` process for testing. Ensure the `bitcoind` binary is available and specify its path. The configuration allows P2P connections. ```rust // the crate `ic-btc-adapter-test-utils` is available in the dfinity/ic repository use ic_btc_adapter_test_utils::{ bitcoin::{Network as BtcNetwork}, bitcoind::{Conf, Daemon} }; let bitcoind_path = [...]; // path to the `bitcoind` binary let conf = Conf { p2p: true, ..Conf::default() }; let bitcoind = Daemon::new(&bitcoind_path, BtcNetwork::Regtest, conf).unwrap(); ``` -------------------------------- ### Install Minter Canister with Initialization Arguments Source: https://github.com/dfinity/ic/blob/master/rs/dogecoin/ckdoge/staging/README.md Deploys the minter canister to the IC with specific initialization arguments. Ensure the ledger ID in `canister_ids.json` supports u256 balances. The `doge_network` is set to `Mainnet` and `min_confirmations` to 60. ```bash dfx deploy minter --network ic --argument \ '\ (\ variant {\ Init = record {\ get_utxos_cache_expiration_seconds = opt (60 : nat64);\ retrieve_doge_min_amount = 5_000_000_000 : nat64;\ ecdsa_key_name = "key_1";\ mode = variant { GeneralAvailability };\ ledger_id = principal "yivyw-aqaaa-aaaar-qbzxq-cai";\ max_time_in_queue_nanos = 600_000_000_000 : nat64;\ max_num_inputs_in_transaction = opt (500 : nat64);\ utxo_consolidation_threshold = opt (10_000 : nat64);\ doge_network = variant { Mainnet };\ min_confirmations = opt (60 : nat32);\ }\ }\ )\ ' ``` -------------------------------- ### Install Index Canister Proposal Source: https://github.com/dfinity/ic/blob/master/rs/bitcoin/ckbtc/mainnet/README.md Submits an installation proposal for the index canister using `ic-admin`. Requires HSM configuration and correct paths for WASM module and arguments. ```shell bazel build //rs/registry/admin:ic-admin ../../../../bazel-bin/rs/registry/admin/ic-admin \ --use-hsm \ --key-id $KEY_ID \ --slot 0 \ --pin $HSM_PIN \ --nns-url "https://ic0.app" \ propose-to-change-nns-canister \ --proposer $NEURON_ID \ --canister-id n5wcd-faaaa-aaaar-qaaea-cai \ --mode install \ --wasm-module-path ./ic-icrc1-index-ng.wasm.gz \ --wasm-module-sha256 $WASM_SHA256 \ --arg index_arg.bin \ --summary-file ./index_proposal.md ```