Getting Different hash for rust canister on local and mainnet

Hi alI,
I had deployed a canister on mainnet and now was trying to verify the build using hash, but I’m getting different hashes for local and mainnet build for same rust canistet and also getting different hashes for different machines. Can someone help with this.

Here’s a bunch of guidelines about creating reproducible builds: Reproducible builds | Internet Computer

I suspect the difference between local and mainnet comes from different canister ids that get baked into the wasm. Is this possible?

1 Like

Yes, I have different canister IDs for local and mainnet builds, maybe that’s the issue, how can I get same hash for verifying the canisters then ?

If canister ids are the only difference then using "specified_id": "<id>" in dfx.json should fix that. Otherwise I can only recommend the link I posted above