Latest nns ledger wasm/candid for local testing

the ledger wasm/candid from online doc or sample code seems outdated, compared to the mainnet one

ICP/NNS ledger archive one is (extracted from dashboard)
get_blocks: (record {start:nat64; length:nat64}) → (variant {Ok:record {blocks:vec record {transaction:record {memo:nat64; icrc1_memo:opt vec nat8; operation:opt variant {Approve:record {fee:record {e8s:nat64}; from:vec nat8; allowance_e8s:int; expires_at:opt record …

the local ledger i deployed is
get_blocks : (record {start:nat; length:nat}) → (record {certificate:opt vec nat8; first_index:nat; blocks:vec μrec_1.variant {Int:int; Map:vec record {0:text; 1:rec_1}; Nat:nat; Nat64:nat64; Blob:vec nat8; Text:text; Array:vec rec_1}; chain_length:nat64; archived_blocks:vec record {callback:(record {start:nat; length:nat}) → (record {blocks:vec μrec_1.variant {Int:int; Map:vec record {0:text; 1:rec_1}; Nat:nat; Nat64:nat64; Blob:vec nat8; Text:text; Array:vec rec_1}}) query; start:nat; length:nat}}) query

quite different. where i can get latest wasm/candid same as ICP/NNS ledger
i need to call get_blocks to verify transactions.

Hey, dctech

I did a lot of searching for the current code and candid files, and it looks like the current version of ledger canister is not available as artifacts ready to download.

If you want to use “latest version” of the ledger you can find it here

The candid file for this ledger is here:

If you would like to get the current deployed version of ledger canister, you need to build it yourself

git fetch
git checkout 692e4064632e6c9e6cf987c75f0690672c646384
./gitlab-ci/container/ -c
sha256sum ./artifacts/canisters/ledger-canister_notify-method.wasm.gz

The hash should match 8af216ba47d03337bfde34447cb04651031d9a2b63be97a9cf53852dddbfbcfa

1 Like

thanks. i just installed latest ledger of release ver 97df774f8cb88ca1a00e26dc3daa19735ad3599a. Weired thing: i not able to do transfer with error insufficient fund in my frontend code. it used to work with my old ledger canister.
i tried dfx transfer and it works. I suspected the new ledger canister didnt detect my local internet-identity session, so it always complain no insufficient. i confirmed the principal after login has sufficient fund.
i tried to install latest internet-identity in case compatibility issue. still not work. stuck here. seems i have to roll back the ledger version to old one. any advise?

i know why. the transfer call in my frontend always uses anonymous principal to transfer from.
For old version ledger, the anonymous principal already got some fund so it used to work.
How to change anonymous principal to my logged-in principal for transfer call? after login into local internet_identity, i already replace the idenity as below


but it didnt work. i use auth-client. need help. thanks in adv

My bad. i use more than 1 actor and forgot to replaceidentity for other actors. case closed. thx