Hardcoded canister principals

I currently have a canister address hardcoded:

  let nativeIPCToken = "ryjl3-tyaaa-aaaaa-aaaba-cai"; // native NNS ICP token.

But how to debug this?

So, I have several more questions:

  • If I want to substitute a locally compiled canister in “debug mode”, how to do this (maybe, by passing debug: Bool to canister initialization? but this seems not to be a very good method). Something like C preprocessor?
  • Can I call IC canisters from the live network from my local canisters running on DFX (dfx start)? (If no, adding this would be a good feature, I think.)
  1. Relevant discussion: ENV variables for motoko builds
    TLDR; you can use actor classes if your canister doesn’t have init parameters, otherwise a bash script or using MOPS are the only way for now.

  2. No you can’t call mainnet from local environment, I remember it was discussed in the past but there were security concerns and Dfinity preferred to go with dfx pull as an alternative.