Error of deploying local ledger for the latest instruction

I have followed the deploy local ledger exactly, and the error message is here below.

autumnlqerfa@AutumndeMacBook-Pro ledger % dfx canister install ledger --argument "(variant {Init = record { token_name = \"NAME\"; token_symbol = \"SYMB\"; transfer_fee = 1000000; metadata = vec {}; minting_account = record {owner = principal \"$(dfx --identity minter identity get-principal)\";}; initial_balances = vec {}; archive_options = record {num_blocks_to_archive = 1000000; trigger_threshold = 1000000; controller_id = principal \"$(dfx identity get-principal)\"}; }})"
Error: Cannot find canister id. Please issue 'dfx canister create ledger'.
autumnlqerfa@AutumndeMacBook-Pro ledger % dfx canister create ledger

Creating a wallet canister on the local network.
The wallet canister on the "local" network for user "default" is "bnz7o-iuaaa-aaaaa-qaaaa-cai"
Error: Failed to figure out if canister 'ledger' has a remote id on network 'local': No canisters in the configuration file.

Can you try again after dfx start --clean?

(base) autumnlqerfa@AutumndeMacBook-Pro ledger % dfx canister install ledger --argument "(variant {Init = record { token_name = \"NAME\"; token_symbol = \"SYMB\"; transfer_fee = 1000000; metadata = vec {}; minting_account = record {owner = principal \"$(dfx --identity minter identity get-principal)\";}; initial_balances = vec {}; archive_options = record {num_blocks_to_archive = 1000000; trigger_threshold = 1000000; controller_id = principal \"$(dfx identity get-principal)\"}; }})"
Error: Cannot find canister id. Please issue 'dfx canister create ledger'.
(base) autumnlqerfa@AutumndeMacBook-Pro ledger % dfx start --clean                            
Running dfx start for version 0.15.0-beta.1
Using the default definition for the 'local' shared network because /Users/autumnlqerfa/.config/dfx/networks.json does not exist.
Error: dfx is already running.
(base) autumnlqerfa@AutumndeMacBook-Pro ledger % dfx canister create ledger
Creating a wallet canister on the local network.
The wallet canister on the "local" network for user "default" is "bnz7o-iuaaa-aaaaa-qaaaa-cai"
Error: Failed to figure out if canister 'ledger' has a remote id on network 'local': No canisters in the configuration file.
(base) autumnlqerfa@AutumndeMacBook-Pro ledger % dfx start --clean         
Running dfx start for version 0.15.0-beta.1
Using the default definition for the 'local' shared network because /Users/autumnlqerfa/.config/dfx/networks.json does not exist.
Error: dfx is already running.

and my dashboard has no canister at all. what is the problem?
I want to use the old version local ledger but the web has gone.

This means you are trying to install the ledger before you created the canister for it

If you want to reset the state, you first have to dfx stop or cancel the running dfx start process

Also it looks like you could have something wonky with dfx.json. If you don’t mind sharing that I’d like to have a quick look

{
  "ledger": {
    "type": "custom",
    "candid": "https://raw.githubusercontent.com/dfinity/ic/a17247bd86c7aa4e87742bf74d108614580f216d/rs/rosetta-api/icrc1/ledger/ledger.did",
    "wasm": "https://download.dfinity.systems/ic/a17247bd86c7aa4e87742bf74d108614580f216d/canisters/ic-icrc1-ledger.wasm.gz",
    "remote": {
      "id": {
        "ic": "ryjl3-tyaaa-aaaaa-aaaba-cai"
      }
    }
  },
  "defaults":{
    "replica": {
      "subnet_type":"system"
    }
  }
}

this is my dfx.json file.
I am in china with an VPN. is there problem with the net when it connect to the candid and wasom file?how can i work with these file locally

(base) autumnlqerfa@AutumndeMacBook-Pro ledger % dfx canister create ledger
Error: Failed to figure out if canister 'ledger' has a remote id on network 'local': No canisters in the configuration file.

I can’t create ledger canister…
please help!

Hmm… I can’t really reproduce your exact problem. But I noticed that the dfx.json in the tutorial is completely broken. I just replaced it with a proper one. Can you try with the new one?

And to make sure there’s no old state interfering I recommend you do dfx stop followed by dfx start --clean first. Then you should be able to run dfx canister create ledger and dfx canister install <...>

the old problem has been solved. but there is new one. when I use Step 9.command line the error is

(base) autumnlqerfa@AutumndeMacBook-Pro ledger % dfx canister install ledger --argument "(variant {Init = record { token_name = \"NAME\"; token_symbol = \"SYMB\"; transfer_fee = 1000000; metadata = vec {}; minting_account = record {owner = principal \"$(dfx --identity minter identity get-principal)\";}; initial_balances = vec {}; archive_options = record {num_blocks_to_archive = 1000000; trigger_threshold = 1000000; controller_id = principal \"$(dfx identity get-principal)\"}; }})"
Installing code for canister ledger, with canister ID bkyz2-fmaaa-aaaaa-qaaaq-cai
Error: Failed to install wasm module to canister 'ledger'.
Caused by: Failed to install wasm module to canister 'ledger'.
  Failed during wasm installation call: The replica returned a replica error: Replica Error: reject code CanisterError, reject message Canister bkyz2-fmaaa-aaaaa-qaaaq-cai trapped explicitly: failed to decode call arguments: Custom(Fail to decode argument 0 from table0 to variant {
  Upgrade : opt record {
    token_symbol : opt text;
    transfer_fee : opt nat64;
    metadata : opt vec record {
      text;
      variant { Int : int; Nat : nat; Blob : vec nat8; Text : text };
    };
    change_fee_collector : opt variant {
      SetTo : record { owner : principal; subaccount : opt vec nat8 };
      Unset;
    };
    max_memo_length : opt nat16;
    token_name : opt text;
    feature_flags : opt record { icrc2 : bool };
  };
  Init : record {
    token_symbol : text;
    transfer_fee : nat64;
    metadata : vec record {
      text;
      variant { Int : int; Nat : nat; Blob : vec nat8; Text : text };
    };
    minting_account : record { owner : principal; subaccount : opt vec nat8 };
    initial_balances : vec record {
      record { owner : principal; subaccount : opt vec nat8 };
      nat64;
    };
    fee_collector_account : opt record {
      owner : principal;
      subaccount : opt vec nat8;
    };
    archive_options : record {
      num_blocks_to_archive : nat64;
      max_transactions_per_response : opt nat64;
      trigger_threshold : nat64;
      max_message_size_bytes : opt nat64;
      cycles_for_archive_creation : opt nat64;
      node_max_memory_size_bytes : opt nat64;
      controller_id : principal;
    };
    max_memo_length : opt nat16;
    token_name : text;
    feature_flags : opt record { icrc2 : bool };
  };
}

Caused by:
    0: input: 4449444c056b01b0ced18403016c079efeb9a40371f2c794ae037cefcee7800402aecbeb880403b2a4dab20502a1e5f7a10a0491c9aafe0d716d6f6c01b3b0dac303686c039ea581d2017ca495a5e9067cdec5d8ae0e680100_000453594d42c0843d00011dc83fcebd02e452135c5c6911631ea208149477a1afe81e0a5763e81e0200c0843dc0843d011d819d3561ef06a117fa387994139e6a51d31f8a84b60988672370c33202044e414d45
       table: type table0 = variant { 815_032_112 : table1 }
       type table1 = record {
         881_753_886 : text;
         902_112_242 : int;
         1_075_439_471 : table2;
         1_092_281_774 : table3;
         1_448_514_098 : table2;
         2_755_523_233 : table4;
         3_754_599_569 : text;
       }
       type table2 = vec empty
       type table3 = record { 947_296_307 : principal }
       type table4 = record { 440_423_070 : int; 1_831_422_628 : int; 3_856_016_094 : principal }
       wire_type: table0, expect_type: variant {
         Upgrade : opt record {
           token_symbol : opt text;
           transfer_fee : opt nat64;
           metadata : opt vec record {
             text;
             variant { Int : int; Nat : nat; Blob : vec nat8; Text : text };
           };
           change_fee_collector : opt variant {
             SetTo : record { owner : principal; subaccount : opt vec nat8 };
             Unset;
           };
           max_memo_length : opt nat16;
           token_name : opt text;
           feature_flags : opt record { icrc2 : bool };
         };
         Init : record {
           token_symbol : text;
           transfer_fee : nat64;
           metadata : vec record {
             text;
             variant { Int : int; Nat : nat; Blob : vec nat8; Text : text };
           };
           minting_account : record { owner : principal; subaccount : opt vec nat8 };
           initial_balances : vec record {
             record { owner : principal; subaccount : opt vec nat8 };
             nat64;
           };
           fee_collector_account : opt record {
             owner : principal;
             subaccount : opt vec nat8;
           };
           archive_options : record {
             num_blocks_to_archive : nat64;
             max_transactions_per_response : opt nat64;
             trigger_threshold : nat64;
             max_message_size_bytes : opt nat64;
             cycles_for_archive_creation : opt nat64;
             node_max_memory_size_bytes : opt nat64;
             controller_id : principal;
           };
           max_memo_length : opt nat16;
           token_name : text;
           feature_flags : opt record { icrc2 : bool };
         };
       }
    1: table0 is not a subtype of variant {
         Upgrade : opt record {
           token_symbol : opt text;
           transfer_fee : opt nat64;
           metadata : opt vec record {
             text;
             variant { Int : int; Nat : nat; Blob : vec nat8; Text : text };
           };
           change_fee_collector : opt variant {
             SetTo : record { owner : principal; subaccount : opt vec nat8 };
             Unset;
           };
           max_memo_length : opt nat16;
           token_name : opt text;
           feature_flags : opt record { icrc2 : bool };
         };
         Init : record {
           token_symbol : text;
           transfer_fee : nat64;
           metadata : vec record {
             text;
             variant { Int : int; Nat : nat; Blob : vec nat8; Text : text };
           };
           minting_account : record { owner : principal; subaccount : opt vec nat8 };
           initial_balances : vec record {
             record { owner : principal; subaccount : opt vec nat8 };
             nat64;
           };
           fee_collector_account : opt record {
             owner : principal;
             subaccount : opt vec nat8;
           };
           archive_options : record {
             num_blocks_to_archive : nat64;
             max_transactions_per_response : opt nat64;
             trigger_threshold : nat64;
             max_message_size_bytes : opt nat64;
             cycles_for_archive_creation : opt nat64;
             node_max_memory_size_bytes : opt nat64;
             controller_id : principal;
           };
           max_memo_length : opt nat16;
           token_name : text;
           feature_flags : opt record { icrc2 : bool };
         };
       }
    2: Variant field 815_032_112: table1 is not a subtype of record {
         token_symbol : text;
         transfer_fee : nat64;
         metadata : vec record {
           text;
           variant { Int : int; Nat : nat; Blob : vec nat8; Text : text };
         };
         minting_account : record { owner : principal; subaccount : opt vec nat8 };
         initial_balances : vec record {
           record { owner : principal; subaccount : opt vec nat8 };
           nat64;
         };
         fee_collector_account : opt record {
           owner : principal;
           subaccount : opt vec nat8;
         };
         archive_options : record {
           num_blocks_to_archive : nat64;
           max_transactions_per_response : opt nat64;
           trigger_threshold : nat64;
           max_message_size_bytes : opt nat64;
           cycles_for_archive_creation : opt nat64;
           node_max_memory_size_bytes : opt nat64;
           controller_id : principal;
         };
         max_memo_length : opt nat16;
         token_name : text;
         feature_flags : opt record { icrc2 : bool };
       }
    3: Record field transfer_fee: int is not a subtype of nat64
    4: int is not a subtype of nat64), error code None

I want the init_account have args

dfx canister install ledger --argument "(variant {Init = record { token_name = \"ICPtoken\"; token_symbol = \"ICPL\"; transfer_fee = 1000000; metadata = vec {}; minting_account = record {owner = principal \"$(dfx --identity minter identity get-principal)\";}; initial_balances = vec {record { owner = principal \"$(dfx identity get-principal)\"}; 1_000_000_000_000}; archive_options = record {num_blocks_to_archive = 1000000; trigger_threshold = 1000000; controller_id = principal \"$(dfx identity get-principal)\"}; }})"

is there anything wrong? thanks for your patient!

it seems like I could not set the initial args. I don’t really get the ledger logic so the args for initiation is too difficult for me. could you write an valid command line for me with init_account . thanks a lot

Here’s an example with working init args: Internet Computer Loading

but it did not work.

(base) autumnlqerfa@AutumndeMacBook-Pro ledger % dfx canister install ledger --argument "(variant {Init = record { token_name = \"NAME\"; token_symbol = \"SYMB\"; transfer_fee = 1000000; metadata = vec {}; minting_account = record {owner = principal \"$(dfx --identity minter identity get-principal)\";}; initial_balances = vec {}; archive_options = record {num_blocks_to_archive = 1000000; trigger_threshold = 1000000; controller_id = principal \"$(dfx identity get-principal)\"}; }})"
Installing code for canister ledger, with canister ID bkyz2-fmaaa-aaaaa-qaaaq-cai
Error: Failed to install wasm module to canister 'ledger'.
Caused by: Failed to install wasm module to canister 'ledger'.
  Failed during wasm installation call: The replica returned a replica error: Replica Error: reject code CanisterError, reject message Canister bkyz2-fmaaa-aaaaa-qaaaq-cai trapped explicitly: failed to decode call arguments: Custom(Fail to decode argument 0 from table0 to variant {
  Upgrade : opt record {
    token_symbol : opt text;
    transfer_fee : opt nat64;
    metadata : opt vec record {
      text;
      variant { Int : int; Nat : nat; Blob : vec nat8; Text : text };
    };
    change_fee_collector : opt variant {
      SetTo : record { owner : principal; subaccount : opt vec nat8 };
      Unset;
    };
    max_memo_length : opt nat16;
    token_name : opt text;
    feature_flags : opt record { icrc2 : bool };
  };
  Init : record {
    token_symbol : text;
    transfer_fee : nat64;
    metadata : vec record {
      text;
      variant { Int : int; Nat : nat; Blob : vec nat8; Text : text };
    };
    minting_account : record { owner : principal; subaccount : opt vec nat8 };
    initial_balances : vec record {
      record { owner : principal; subaccount : opt vec nat8 };
      nat64;
    };
    fee_collector_account : opt record {
      owner : principal;
      subaccount : opt vec nat8;
    };
    archive_options : record {
      num_blocks_to_archive : nat64;
      max_transactions_per_response : opt nat64;
      trigger_threshold : nat64;
      max_message_size_bytes : opt nat64;
      cycles_for_archive_creation : opt nat64;
      node_max_memory_size_bytes : opt nat64;
      controller_id : principal;
    };
    max_memo_length : opt nat16;
    token_name : text;
    feature_flags : opt record { icrc2 : bool };
  };
}

Caused by:
    0: input: 4449444c056b01b0ced18403016c079efeb9a40371f2c794ae037cefcee7800402aecbeb880403b2a4dab20502a1e5f7a10a0491c9aafe0d716d6f6c01b3b0dac303686c039ea581d2017ca495a5e9067cdec5d8ae0e680100_000453594d42c0843d00011dc83fcebd02e452135c5c6911631ea208149477a1afe81e0a5763e81e0200c0843dc0843d011d819d3561ef06a117fa387994139e6a51d31f8a84b60988672370c33202044e414d45
       table: type table0 = variant { 815_032_112 : table1 }
       type table1 = record {
         881_753_886 : text;
         902_112_242 : int;
         1_075_439_471 : table2;
         1_092_281_774 : table3;
         1_448_514_098 : table2;
         2_755_523_233 : table4;
         3_754_599_569 : text;
       }
       type table2 = vec empty
       type table3 = record { 947_296_307 : principal }
       type table4 = record { 440_423_070 : int; 1_831_422_628 : int; 3_856_016_094 : principal }
       wire_type: table0, expect_type: variant {
         Upgrade : opt record {
           token_symbol : opt text;
           transfer_fee : opt nat64;
           metadata : opt vec record {
             text;
             variant { Int : int; Nat : nat; Blob : vec nat8; Text : text };
           };
           change_fee_collector : opt variant {
             SetTo : record { owner : principal; subaccount : opt vec nat8 };
             Unset;
           };
           max_memo_length : opt nat16;
           token_name : opt text;
           feature_flags : opt record { icrc2 : bool };
         };
         Init : record {
           token_symbol : text;
           transfer_fee : nat64;
           metadata : vec record {
             text;
             variant { Int : int; Nat : nat; Blob : vec nat8; Text : text };
           };
           minting_account : record { owner : principal; subaccount : opt vec nat8 };
           initial_balances : vec record {
             record { owner : principal; subaccount : opt vec nat8 };
             nat64;
           };
           fee_collector_account : opt record {
             owner : principal;
             subaccount : opt vec nat8;
           };
           archive_options : record {
             num_blocks_to_archive : nat64;
             max_transactions_per_response : opt nat64;
             trigger_threshold : nat64;
             max_message_size_bytes : opt nat64;
             cycles_for_archive_creation : opt nat64;
             node_max_memory_size_bytes : opt nat64;
             controller_id : principal;
           };
           max_memo_length : opt nat16;
           token_name : text;
           feature_flags : opt record { icrc2 : bool };
         };
       }
    1: table0 is not a subtype of variant {
         Upgrade : opt record {
           token_symbol : opt text;
           transfer_fee : opt nat64;
           metadata : opt vec record {
             text;
             variant { Int : int; Nat : nat; Blob : vec nat8; Text : text };
           };
           change_fee_collector : opt variant {
             SetTo : record { owner : principal; subaccount : opt vec nat8 };
             Unset;
           };
           max_memo_length : opt nat16;
           token_name : opt text;
           feature_flags : opt record { icrc2 : bool };
         };
         Init : record {
           token_symbol : text;
           transfer_fee : nat64;
           metadata : vec record {
             text;
             variant { Int : int; Nat : nat; Blob : vec nat8; Text : text };
           };
           minting_account : record { owner : principal; subaccount : opt vec nat8 };
           initial_balances : vec record {
             record { owner : principal; subaccount : opt vec nat8 };
             nat64;
           };
           fee_collector_account : opt record {
             owner : principal;
             subaccount : opt vec nat8;
           };
           archive_options : record {
             num_blocks_to_archive : nat64;
             max_transactions_per_response : opt nat64;
             trigger_threshold : nat64;
             max_message_size_bytes : opt nat64;
             cycles_for_archive_creation : opt nat64;
             node_max_memory_size_bytes : opt nat64;
             controller_id : principal;
           };
           max_memo_length : opt nat16;
           token_name : text;
           feature_flags : opt record { icrc2 : bool };
         };
       }
    2: Variant field 815_032_112: table1 is not a subtype of record {
         token_symbol : text;
         transfer_fee : nat64;
         metadata : vec record {
           text;
           variant { Int : int; Nat : nat; Blob : vec nat8; Text : text };
         };
         minting_account : record { owner : principal; subaccount : opt vec nat8 };
         initial_balances : vec record {
           record { owner : principal; subaccount : opt vec nat8 };
           nat64;
         };
         fee_collector_account : opt record {
           owner : principal;
           subaccount : opt vec nat8;
         };
         archive_options : record {
           num_blocks_to_archive : nat64;
           max_transactions_per_response : opt nat64;
           trigger_threshold : nat64;
           max_message_size_bytes : opt nat64;
           cycles_for_archive_creation : opt nat64;
           node_max_memory_size_bytes : opt nat64;
           controller_id : principal;
         };
         max_memo_length : opt nat16;
         token_name : text;
         feature_flags : opt record { icrc2 : bool };
       }
    3: Record field transfer_fee: int is not a subtype of nat64
    4: int is not a subtype of nat64), error code None
(base) autumnlqerfa@AutumndeMacBook-Pro ledger % dfx canister install ledger --argument "(variant {Init = record { token_name = \"NAME\"; token_symbol = \"SYMB\"; transfer_fee = 1000000; metadata = vec {}; minting_account = record {owner = principal \"$(dfx --identity minter identity get-principal)\";}; initial_balances = vec {}; archive_options = record {num_blocks_to_archive = 1000000; trigger_threshold = 1000000; controller_id = principal \"$(dfx identity get-principal)\"}; }})"
Installing code for canister ledger, with canister ID bkyz2-fmaaa-aaaaa-qaaaq-cai
Error: Failed to install wasm module to canister 'ledger'.
Caused by: Failed to install wasm module to canister 'ledger'.
  Failed during wasm installation call: The replica returned a replica error: Replica Error: reject code CanisterError, reject message Canister bkyz2-fmaaa-aaaaa-qaaaq-cai trapped explicitly: failed to decode call arguments: Custom(Fail to decode argument 0 from table0 to variant {
  Upgrade : opt record {
    token_symbol : opt text;
    transfer_fee : opt nat64;
    metadata : opt vec record {
      text;
      variant { Int : int; Nat : nat; Blob : vec nat8; Text : text };
    };
    change_fee_collector : opt variant {
      SetTo : record { owner : principal; subaccount : opt vec nat8 };
      Unset;
    };
    max_memo_length : opt nat16;
    token_name : opt text;
    feature_flags : opt record { icrc2 : bool };
  };
  Init : record {
    token_symbol : text;
    transfer_fee : nat64;
    metadata : vec record {
      text;
      variant { Int : int; Nat : nat; Blob : vec nat8; Text : text };
    };
    minting_account : record { owner : principal; subaccount : opt vec nat8 };
    initial_balances : vec record {
      record { owner : principal; subaccount : opt vec nat8 };
      nat64;
    };
    fee_collector_account : opt record {
      owner : principal;
      subaccount : opt vec nat8;
    };
    archive_options : record {
      num_blocks_to_archive : nat64;
      max_transactions_per_response : opt nat64;
      trigger_threshold : nat64;
      max_message_size_bytes : opt nat64;
      cycles_for_archive_creation : opt nat64;
      node_max_memory_size_bytes : opt nat64;
      controller_id : principal;
    };
    max_memo_length : opt nat16;
    token_name : text;
    feature_flags : opt record { icrc2 : bool };
  };
}

Caused by:
    0: input: 4449444c056b01b0ced18403016c079efeb9a40371f2c794ae037cefcee7800402aecbeb880403b2a4dab20502a1e5f7a10a0491c9aafe0d716d6f6c01b3b0dac303686c039ea581d2017ca495a5e9067cdec5d8ae0e680100_000453594d42c0843d00011dc83fcebd02e452135c5c6911631ea208149477a1afe81e0a5763e81e0200c0843dc0843d011d819d3561ef06a117fa387994139e6a51d31f8a84b60988672370c33202044e414d45
       table: type table0 = variant { 815_032_112 : table1 }
       type table1 = record {
         881_753_886 : text;
         902_112_242 : int;
         1_075_439_471 : table2;
         1_092_281_774 : table3;
         1_448_514_098 : table2;
         2_755_523_233 : table4;
         3_754_599_569 : text;
       }
       type table2 = vec empty
       type table3 = record { 947_296_307 : principal }
       type table4 = record { 440_423_070 : int; 1_831_422_628 : int; 3_856_016_094 : principal }
       wire_type: table0, expect_type: variant {
         Upgrade : opt record {
           token_symbol : opt text;
           transfer_fee : opt nat64;
           metadata : opt vec record {
             text;
             variant { Int : int; Nat : nat; Blob : vec nat8; Text : text };
           };
           change_fee_collector : opt variant {
             SetTo : record { owner : principal; subaccount : opt vec nat8 };
             Unset;
           };
           max_memo_length : opt nat16;
           token_name : opt text;
           feature_flags : opt record { icrc2 : bool };
         };
         Init : record {
           token_symbol : text;
           transfer_fee : nat64;
           metadata : vec record {
             text;
             variant { Int : int; Nat : nat; Blob : vec nat8; Text : text };
           };
           minting_account : record { owner : principal; subaccount : opt vec nat8 };
           initial_balances : vec record {
             record { owner : principal; subaccount : opt vec nat8 };
             nat64;
           };
           fee_collector_account : opt record {
             owner : principal;
             subaccount : opt vec nat8;
           };
           archive_options : record {
             num_blocks_to_archive : nat64;
             max_transactions_per_response : opt nat64;
             trigger_threshold : nat64;
             max_message_size_bytes : opt nat64;
             cycles_for_archive_creation : opt nat64;
             node_max_memory_size_bytes : opt nat64;
             controller_id : principal;
           };
           max_memo_length : opt nat16;
           token_name : text;
           feature_flags : opt record { icrc2 : bool };
         };
       }
    1: table0 is not a subtype of variant {
         Upgrade : opt record {
           token_symbol : opt text;
           transfer_fee : opt nat64;
           metadata : opt vec record {
             text;
             variant { Int : int; Nat : nat; Blob : vec nat8; Text : text };
           };
           change_fee_collector : opt variant {
             SetTo : record { owner : principal; subaccount : opt vec nat8 };
             Unset;
           };
           max_memo_length : opt nat16;
           token_name : opt text;
           feature_flags : opt record { icrc2 : bool };
         };
         Init : record {
           token_symbol : text;
           transfer_fee : nat64;
           metadata : vec record {
             text;
             variant { Int : int; Nat : nat; Blob : vec nat8; Text : text };
           };
           minting_account : record { owner : principal; subaccount : opt vec nat8 };
           initial_balances : vec record {
             record { owner : principal; subaccount : opt vec nat8 };
             nat64;
           };
           fee_collector_account : opt record {
             owner : principal;
             subaccount : opt vec nat8;
           };
           archive_options : record {
             num_blocks_to_archive : nat64;
             max_transactions_per_response : opt nat64;
             trigger_threshold : nat64;
             max_message_size_bytes : opt nat64;
             cycles_for_archive_creation : opt nat64;
             node_max_memory_size_bytes : opt nat64;
             controller_id : principal;
           };
           max_memo_length : opt nat16;
           token_name : text;
           feature_flags : opt record { icrc2 : bool };
         };
       }
    2: Variant field 815_032_112: table1 is not a subtype of record {
         token_symbol : text;
         transfer_fee : nat64;
         metadata : vec record {
           text;
           variant { Int : int; Nat : nat; Blob : vec nat8; Text : text };
         };
         minting_account : record { owner : principal; subaccount : opt vec nat8 };
         initial_balances : vec record {
           record { owner : principal; subaccount : opt vec nat8 };
           nat64;
         };
         fee_collector_account : opt record {
           owner : principal;
           subaccount : opt vec nat8;
         };
         archive_options : record {
           num_blocks_to_archive : nat64;
           max_transactions_per_response : opt nat64;
           trigger_threshold : nat64;
           max_message_size_bytes : opt nat64;
           cycles_for_archive_creation : opt nat64;
           node_max_memory_size_bytes : opt nat64;
           controller_id : principal;
         };
         max_memo_length : opt nat16;
         token_name : text;
         feature_flags : opt record { icrc2 : bool };
       }
    3: Record field transfer_fee: int is not a subtype of nat64
    4: int is not a subtype of nat64), error code None

Which version of the ledger canister are you using? It works just fine for me with the version in the tutorial

dfx 0.15.0-beta.1
the tutorial said the latest one

that’s the dfx version. I’m looking for the ledger canister commit, the one that’s included in the wasm URL. In the tutorial it is a17247bd86c7aa4e87742bf74d108614580f216d

a17247bd86c7aa4e87742bf74d108614580f216d
the same as yours.

i have tried again from the beginning. there is my whole prossess
when comes to step9, for the first time there is the error message:

Creating UI canister on the local network.
The UI canister on the "local" network is "bd3sg-teaaa-aaaaa-qaaba-cai"
Error: Failed to install wasm module to canister 'ledger'.
Caused by: Failed to install wasm module to canister 'ledger'.
  Failed to read /Users/autumnlqerfa/workspace/IC/ledger/.dfx/local/canisters/ledger/ledger.wasm.gz.
    No such file or directory (os error 2)

and here is my dfx.json file:

{
  "canisters": {
  "ledger": {
    "type": "custom",
    "candid": "https://raw.githubusercontent.com/dfinity/ic/a17247bd86c7aa4e87742bf74d108614580f216d/rs/rosetta-api/icrc1/ledger/ledger.did",
    "wasm": "https://download.dfinity.systems/ic/a17247bd86c7aa4e87742bf74d108614580f216d/canisters/ic-icrc1-ledger.wasm.gz",
    "remote": {
      "id": {
        "ic": "ryjl3-tyaaa-aaaaa-aaaba-cai"
      }
    }
  }
  },
  "defaults":{
    "replica": {
      "subnet_type":"system"
    }
  }
}

I think there is something wrong with my network, so I download the wasm file mamully through the url:
wasm file
and change the file name from ic-icrc1-ledger.wasm.gz to ledger.wasm.gz. then put it in the file diretory path : /Users/autumnlqerfa/workspace/IC/ledger/.dfx/local/canisters/ledger/
as the error message said.
and then run step9 again. there the same error as

Installing code for canister ledger, with canister ID bkyz2-fmaaa-aaaaa-qaaaq-cai
Error: Failed to install wasm module to canister 'ledger'.
Caused by: Failed to install wasm module to canister 'ledger'.
  Failed during wasm installation call: The replica returned a replica error: Replica Error: reject code CanisterError, reject message Canister bkyz2-fmaaa-aaaaa-qaaaq-cai trapped explicitly: failed to decode call arguments: Custom(Fail to decode argument 0 from table0 to variant {
  Upgrade : opt record {
    token_symbol : opt text;
    transfer_fee : opt nat64;
    metadata : opt vec record {
      text;
      variant { Int : int; Nat : nat; Blob : vec nat8; Text : text };
    };
    change_fee_collector : opt variant {
      SetTo : record { owner : principal; subaccount : opt vec nat8 };
      Unset;
    };
    max_memo_length : opt nat16;
    token_name : opt text;
    feature_flags : opt record { icrc2 : bool };
  };
  Init : record {
    token_symbol : text;
    transfer_fee : nat64;
    metadata : vec record {
      text;
      variant { Int : int; Nat : nat; Blob : vec nat8; Text : text };
    };
    minting_account : record { owner : principal; subaccount : opt vec nat8 };
    initial_balances : vec record {
      record { owner : principal; subaccount : opt vec nat8 };
      nat64;
    };
    fee_collector_account : opt record {
      owner : principal;
      subaccount : opt vec nat8;
    };
    archive_options : record {
      num_blocks_to_archive : nat64;
      max_transactions_per_response : opt nat64;
      trigger_threshold : nat64;
      max_message_size_bytes : opt nat64;
      cycles_for_archive_creation : opt nat64;
      node_max_memory_size_bytes : opt nat64;
      controller_id : principal;
    };
    max_memo_length : opt nat16;
    token_name : text;
    feature_flags : opt record { icrc2 : bool };
  };
}

Caused by:
    0: input: 4449444c056b01b0ced18403016c079efeb9a40371f2c794ae037cefcee7800402aecbeb880403b2a4dab20502a1e5f7a10a0491c9aafe0d716d6f6c01b3b0dac303686c039ea581d2017ca495a5e9067cdec5d8ae0e680100_000453594d42c0843d00011dc83fcebd02e452135c5c6911631ea208149477a1afe81e0a5763e81e0200c0843dc0843d011d819d3561ef06a117fa387994139e6a51d31f8a84b60988672370c33202044e414d45
       table: type table0 = variant { 815_032_112 : table1 }
       type table1 = record {
         881_753_886 : text;
         902_112_242 : int;
         1_075_439_471 : table2;
         1_092_281_774 : table3;
         1_448_514_098 : table2;
         2_755_523_233 : table4;
         3_754_599_569 : text;
       }
       type table2 = vec empty
       type table3 = record { 947_296_307 : principal }
       type table4 = record { 440_423_070 : int; 1_831_422_628 : int; 3_856_016_094 : principal }
       wire_type: table0, expect_type: variant {
         Upgrade : opt record {
           token_symbol : opt text;
           transfer_fee : opt nat64;
           metadata : opt vec record {
             text;
             variant { Int : int; Nat : nat; Blob : vec nat8; Text : text };
           };
           change_fee_collector : opt variant {
             SetTo : record { owner : principal; subaccount : opt vec nat8 };
             Unset;
           };
           max_memo_length : opt nat16;
           token_name : opt text;
           feature_flags : opt record { icrc2 : bool };
         };
         Init : record {
           token_symbol : text;
           transfer_fee : nat64;
           metadata : vec record {
             text;
             variant { Int : int; Nat : nat; Blob : vec nat8; Text : text };
           };
           minting_account : record { owner : principal; subaccount : opt vec nat8 };
           initial_balances : vec record {
             record { owner : principal; subaccount : opt vec nat8 };
             nat64;
           };
           fee_collector_account : opt record {
             owner : principal;
             subaccount : opt vec nat8;
           };
           archive_options : record {
             num_blocks_to_archive : nat64;
             max_transactions_per_response : opt nat64;
             trigger_threshold : nat64;
             max_message_size_bytes : opt nat64;
             cycles_for_archive_creation : opt nat64;
             node_max_memory_size_bytes : opt nat64;
             controller_id : principal;
           };
           max_memo_length : opt nat16;
           token_name : text;
           feature_flags : opt record { icrc2 : bool };
         };
       }
    1: table0 is not a subtype of variant {
         Upgrade : opt record {
           token_symbol : opt text;
           transfer_fee : opt nat64;
           metadata : opt vec record {
             text;
             variant { Int : int; Nat : nat; Blob : vec nat8; Text : text };
           };
           change_fee_collector : opt variant {
             SetTo : record { owner : principal; subaccount : opt vec nat8 };
             Unset;
           };
           max_memo_length : opt nat16;
           token_name : opt text;
           feature_flags : opt record { icrc2 : bool };
         };
         Init : record {
           token_symbol : text;
           transfer_fee : nat64;
           metadata : vec record {
             text;
             variant { Int : int; Nat : nat; Blob : vec nat8; Text : text };
           };
           minting_account : record { owner : principal; subaccount : opt vec nat8 };
           initial_balances : vec record {
             record { owner : principal; subaccount : opt vec nat8 };
             nat64;
           };
           fee_collector_account : opt record {
             owner : principal;
             subaccount : opt vec nat8;
           };
           archive_options : record {
             num_blocks_to_archive : nat64;
             max_transactions_per_response : opt nat64;
             trigger_threshold : nat64;
             max_message_size_bytes : opt nat64;
             cycles_for_archive_creation : opt nat64;
             node_max_memory_size_bytes : opt nat64;
             controller_id : principal;
           };
           max_memo_length : opt nat16;
           token_name : text;
           feature_flags : opt record { icrc2 : bool };
         };
       }
    2: Variant field 815_032_112: table1 is not a subtype of record {
         token_symbol : text;
         transfer_fee : nat64;
         metadata : vec record {
           text;
           variant { Int : int; Nat : nat; Blob : vec nat8; Text : text };
         };
         minting_account : record { owner : principal; subaccount : opt vec nat8 };
         initial_balances : vec record {
           record { owner : principal; subaccount : opt vec nat8 };
           nat64;
         };
         fee_collector_account : opt record {
           owner : principal;
           subaccount : opt vec nat8;
         };
         archive_options : record {
           num_blocks_to_archive : nat64;
           max_transactions_per_response : opt nat64;
           trigger_threshold : nat64;
           max_message_size_bytes : opt nat64;
           cycles_for_archive_creation : opt nat64;
           node_max_memory_size_bytes : opt nat64;
           controller_id : principal;
         };
         max_memo_length : opt nat16;
         token_name : text;
         feature_flags : opt record { icrc2 : bool };
       }
    3: Record field transfer_fee: int is not a subtype of nat64
    4: int is not a subtype of nat64), error code None
(base) autumnlqerfa@AutumndeMacBook-Pro ledger %