How can I stop a running canister smart contract?

You can stop canisters that are currently running by running the dfx canister stop command:

dfx canister stop --all

 

This command displays output similar to the following:

Stopping code for canister status_check, with canister_id 75hes-oqbaa-aaaaa-aaaaa-aaaaa-aaaaa-aaaaa-q
Stopping code for canister status_check_assets, with canister_id cxeji-wacaa-aaaaa-aaaaa-aaaaa-aaaaa-aaaaa-q

 

To learn more about how to stop a running canister, please check out the “Managing the Running State of a Canister” content on the Internet Computer Docs.

You can also learn more about canisters on the Internet Computer Wiki.

Updated