Can i set a canister in dfx.json to specific networks?

I added ledger to dfx.json for development but now I can’t do dfx deploy because it will deploy a ledger. Is there anyway to fix this?

I know i can do dfx deploy appName but that would mean i need to do that for every single canister and that seems unreasonable.

You can set it up as a remote canister. There’s a note in the changelog about how to do this. It just happens to use the ledger as an example.

1 Like

Is there a way to specify in the dfx.json to deploy a canister only locally instead? I have a canister that I use for tests and don’t need to deploy it to the IC.

You can declare a canister as remote

That’s what I’m doing at the moment, but since I have never deployed that canister to the IC (and I don’t want to do it), I’m arbitrarily using the Ledger canister remote id as a workaround.
I find this crappy though, is there a better way to achieve this?

No, at the moment there is no better way. If you don’t want to use an arbitrary canister ID it is common to use the virtual management canister (aaaaa-aa) as sort-of a black hole

1 Like