How to delete a canister?

I didn‘t want to maintance a canister any more. Any way to delete a useless canister?
How should i do.
And can those cycles remained in the canister return back to to my cycles wallet

2 Likes

dfx canister delete is what you’re looking for
There is no management call to withdraw cycles from a canister yet. Deleting a canister will also discard all of its cycles. For now, you’ll need to install the cycles wallet wasm module onto that canister (or any other canister which supports sending cycles) and transfer them to your destination.

2 Likes

So is it like smart contract in Ethereum?
If i send Ether to a contract without “withdraw” function that can return Ether back to a Ethereum address. i will lost my Ether.

if i creat a canister that doesn’t install cycles wallet wasm module.
all cycles that others send to the canister will be stay in the canister always. and never transfer to other place? No lower-lever interface?

if i creat a canister that doesn’t install cycles wallet wasm module.
all cycles that others send to the canister will be stay in the canister always. and never transfer to other place? No lower-lever interface?

That’s right, no “lower-level interface” just yet. Eventually there should be a management canister interface to withdraw cycles very similar to deposit_cycles

For now try the workaround I mentioned above.