# Latest nns ledger wasm/candid for local testing

**URL:** <https://forum.dfinity.org/t/latest-nns-ledger-wasm-candid-for-local-testing/21558>\
**Category:** Getting Started\
**Created:** [July 21, 2023, 12:36pm UTC](https://forum.dfinity.org/t/latest-nns-ledger-wasm-candid-for-local-testing/21558 "2023-07-21T12:36:21Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![dctech](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/dctech/32/10622_2.png) [@dctech](https://forum.dfinity.org/u/dctech)\
**Post date:** [July 21, 2023, 12:36pm UTC](https://forum.dfinity.org/t/latest-nns-ledger-wasm-candid-for-local-testing/21558/1 "2023-07-21T12:36:21Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![stopak](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/stopak/32/9896_2.png) [@stopak](https://forum.dfinity.org/u/stopak)\
**Post date:** [July 21, 2023, 3:34pm UTC](https://forum.dfinity.org/t/latest-nns-ledger-wasm-candid-for-local-testing/21558/2 "2023-07-21T15:34:29Z")

</div>

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 [https://download.dfinity.systems/ic/97df774f8cb88ca1a00e26dc3daa19735ad3599a/canisters/ledger-canister\_notify-method.wasm.gz](https://download.dfinity.systems/ic/97df774f8cb88ca1a00e26dc3daa19735ad3599a/canisters/ledger-canister_notify-method.wasm.gz)

The candid file for this ledger is here: [https://raw.githubusercontent.com/dfinity/ic/97df774f8cb88ca1a00e26dc3daa19735ad3599a/rs/rosetta-api/icrc1/ledger/ledger.did](https://raw.githubusercontent.com/dfinity/ic/97df774f8cb88ca1a00e26dc3daa19735ad3599a/rs/rosetta-api/icrc1/ledger/ledger.did)

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

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

```

The hash should match 8af216ba47d03337bfde34447cb04651031d9a2b63be97a9cf53852dddbfbcfa

---

<div class="post-metadata">

**Author:** ![dctech](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/dctech/32/10622_2.png) [@dctech](https://forum.dfinity.org/u/dctech)\
**Post date:** [July 22, 2023, 4:36pm UTC](https://forum.dfinity.org/t/latest-nns-ledger-wasm-candid-for-local-testing/21558/3 "2023-07-22T16:36:15Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![dctech](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/dctech/32/10622_2.png) [@dctech](https://forum.dfinity.org/u/dctech)\
**Post date:** [July 22, 2023, 4:56pm UTC](https://forum.dfinity.org/t/latest-nns-ledger-wasm-candid-for-local-testing/21558/4 "2023-07-22T16:56:11Z")

</div>

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

Actor.agentOf($actor).replaceIdentity(client.getIdentity());

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

---

<div class="post-metadata">

**Author:** ![dctech](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/dctech/32/10622_2.png) [@dctech](https://forum.dfinity.org/u/dctech)\
**Post date:** [July 22, 2023, 5:18pm UTC](https://forum.dfinity.org/t/latest-nns-ledger-wasm-candid-for-local-testing/21558/5 "2023-07-22T17:18:45Z")

</div>

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