Failed to deploy on mainnet

dfx deploy icrc1_ledger_canister --network ic --argument “(variant { Init =
record {
token_symbol = "BELLA";
token_name = "BELLA";
minting_account = record { owner = principal "${MINTER}" };
transfer_fee = 1;
metadata = vec {};
feature_flags = opt record{icrc2 = ${FEATURE_FLAGS}};
initial_balances = vec { record { record { owner = principal "${DEFAULT}"; }; 100_000_000_000_000; }; };
archive_options = record {
num_blocks_to_archive = 1000;
trigger_threshold = 2000;
controller_id = principal "${MINTER}";
};
}
})”

I am not experiencing any issues with deployment on my local network; the problem arises only when deploying on the IC network. It’s worth noting that I have previously deployed a ledger with the same name, which could potentially be the cause of the issue. For instance, when I deploy an ICP ledger that I haven’t deployed before, no errors occur.

The error :
Deploying: icrc1_ledger_canister
All canisters have already been created.
Building canisters…
WARN: .did file for canister ‘internet_identity’ does not exist.
WARN: .did file for canister ‘icp_index_canister’ does not exist.
Error: Failed while trying to deploy canisters.
Caused by: Failed while trying to deploy canisters.
Failed to build all canisters.
Failed while trying to build all canisters.
Failed while trying to build all canisters in the canister pool.
Failed to build dependencies graph for canister pool.
Failed to get dependencies for canister ‘mercx_frontend’.
Failed to create AssetBuilderExtra for canister ‘mercx_frontend’.
Failed to collect dependencies (canister ids) of canister mercx_frontend.
A canister with the name ‘icp_ledger_canister’ was not found in the current project.

1 Like

Can you share your dfx.json file?

1 Like

This is the dfx.json file
{
“canisters”: {
“mercx_backend”: {
“candid”: “src/mercx_backend/mercx_backend.did”,
“package”: “mercx_backend”,
“type”: “rust”,
“dependencies”: [“icrc1_ledger_canister”, “internet_identity”]
},

"xrc": {
  "type": "custom",
  "candid": "xrc/xrc.did",
  "wasm": "xrc/xrc.wasm.gz",
  "remote": {
    "candid": "xrc/xrc.did",
    "id": {
      "ic": "uf6dk-hyaaa-aaaaq-qaaaq-cai"
    }
  }
},

"icrc1_ledger_canister": {
  "type": "custom",
  "candid": "https://raw.githubusercontent.com/dfinity/ic/cacf86a2ea7e21150d106e9e4dda5973088f53c5/rs/rosetta-api/icrc1/ledger/ledger.did",
  "wasm": "https://download.dfinity.systems/ic/cacf86a2ea7e21150d106e9e4dda5973088f53c5/canisters/ic-icrc1-ledger.wasm.gz"
},
"icrc1_index_canister": {
  "type": "custom",
  "candid": "https://raw.githubusercontent.com/dfinity/ic/cacf86a2ea7e21150d106e9e4dda5973088f53c5/rs/rosetta-api/icrc1/index-ng/index-ng.did",
  "wasm": "https://download.dfinity.systems/ic/cacf86a2ea7e21150d106e9e4dda5973088f53c5/canisters/ic-icrc1-index-ng.wasm.gz"
},
"icp_ledger_canister": {
  "type": "custom",
  "candid": "https://raw.githubusercontent.com/dfinity/ic/cacf86a2ea7e21150d106e9e4dda5973088f53c5/rs/rosetta-api/icp_ledger/ledger.did",
  "wasm": "https://download.dfinity.systems/ic/cacf86a2ea7e21150d106e9e4dda5973088f53c5/canisters/ledger-canister.wasm.gz"

}
,
“icp_index_canister”: {
“type”: “custom”,
“candid”: “https://raw.githubusercontent.com/dfinity/ic/cacf86a2ea7e21150d106e9e4dda5973088f53c5/rs/rosetta-api/icp_ledger/index/index.did”,
“wasm”: “https://download.dfinity.systems/ic/cacf86a2ea7e21150d106e9e4dda5973088f53c5/canisters/ic-icp-index-canister.wasm.gz”,
“remote”: {
“id”: {
“ic”: “qhbym-qaaaa-aaaaa-aaafq-cai”
}
}
},
“internet_identity”: {
“type”: “custom”,
“candid”: “https://github.com/dfinity/internet-identity/releases/latest/download/internet_identity.did”,
“wasm”: “https://github.com/dfinity/internet-identity/releases/latest/download/internet_identity_dev.wasm.gz”,
“remote”: {
“id”: {
“ic”: “rdmx6-jaaaa-aaaaa-aaadq-cai”
}
},
“frontend”: {}
},

"mercx_frontend": {
  "dependencies": [
    "mercx_backend",
    "internet_identity",
    "icp_ledger_canister"
  ],
  "source": ["src/mercx_frontend/dist"],
  "type": "assets",
  "workspace": "mercx_frontend"
}

},
“networks”: {
“local”: {
“bind”: “127.0.0.1:4943”,
“type”: “ephemeral”
}},
“defaults”: {
“replica”: {
“subnet_type”: “system”
},
“build”: {
“args”: “”,
“packtool”: “”
}
},
“output_env_file”: “.env”,
“version”: 1
}

It never occurred to me to deploy a canister from a candid and wasm URL, but I suppose it would work.

I think your problem is that icp_ledger_canister is not defined as a remote canister. Use the same strategy you were using for Internet Identity and see if that works