I am having problems installing the ledger locally using the instructions provided on the website. I am using the DFX_VERSION=0.14.3
, and I am on a mac. I followed the instructions using a fresh install of IC.
When I get to the instructions to deploy the canister, I get the following error message:
Error: Cannot find canister id. Please issue 'dfx canister create ledger'
I then run the dfx
command to create the ledger canister, and attempt to install the ledger canister again. This time around, I get the following error message:
Error: Failed to install wasm module to canister 'ledger'.
Caused by: Failed to install wasm module to canister 'ledger'.
Failed to read /Users/hilljh/Projects/onehilltech/ic/ledger/.dfx/local/canisters/ledger/ledger.wasm.gz.
No such file or directory (os error 2)
It seems like dfx
is not downloading the wasm file. As a workaround, I manually download both the candid file and wasm file and place them in my local directory and update dfx.json
accordingly. When I do that, and run the following command as listed on the website:
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)\"}; }})"
I get a completely different set of errors.
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_000453594d42c0843d00011d874f3ca3e65851a5177a4d36545b4677a5990406ea2618d6270ba5d60200c0843dc0843d011d4d3680e97f160e3afd56233417c2583293492eb97b646f118f9896a502044e414d45
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
Any assistance in installing the ledger locally using the instructions provided on the website would be greatly appreciated.