To deploy canisters locally using dfx follow these steps.
Start dfx server
dfx start --background
Run the install script to build and deploy canisters. you can skip the test run by passing -s
flag
scripts/canisters/local_deploy/install_all_canisters.sh [-s]
NOTE: This will only deploy one subnet-orchestrator (also called user-index in codebase) and will not deploy platform-orchsetrator. Platform-orchestrator needs to be deployed and tested separetly
To upgrade locally deployed canisters. Run the following commands
Run the candid generator script to auto generate the candid files for the canisters.
scripts/candid_generator.sh
Build and upgrade the canisters deployed. You can pass -s
flag to skip the tests
scripts/canisters/local_deploy/upgrade_all_canisters.sh [-s]
These checks are important and should be strictly performed before raising any Pull request and ensure everything passes.
ic_repl_tests/all_tests.sh
(this would create some users locally and will add some posts for testing.)The process of deploying to the mainnet is as follows:
To get the hash for canisters:
Get the canister IDs from canister_ids.json
.
Get hash using the DFX SDK by running: dfx canister info <canister-id> --network=ic
.
The output of the above command should contain Module hash
followed up with the hash value. Example output:
$ > dfx canister info vyatz-hqaaa-aaaam-qauea-cai --network=ic
Controllers: 7gaq2-4kttl-vtbt4-oo47w-igteo-cpk2k-57h3p-yioqe-wkawi-wz45g-jae
wwyo5-vrahh-jwa74-3m6kj-jqbia-jbebm-7vtyd-uvqem-wk3zw-djpci-vqe
Module hash: 0x98863747bb8b1366ae5e3c5721bfe08ce6b7480fe4c3864d4fec3d9827255480
To get the hash for canister deployment:
Deploy all canisters
jobs. (Click to see an example job)Deploy <canister_name> canister
steps. You should find the Module hash
in this step. This value should match the value you got locally. (Click to see an example step)To check the status of the deployment