Skip to content

Instantly share code, notes, and snippets.

@flyq
Created July 26, 2021 15:26
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save flyq/95419d9438381d01563b974f861905dd to your computer and use it in GitHub Desktop.
Save flyq/95419d9438381d01563b974f861905dd to your computer and use it in GitHub Desktop.

NNS subnet state export: Attempt to read the state of Ledger canister, but failed:

dfx canister --no-wallet --network ic call read_rs block '(306944)'
The Replica returned an error: code 5, message: "IC0503: Canister ywrdt-7aaaa-aaaah-qaaaa-cai trapped explicitly: Panicked at 'called `Result::unwrap()` on an `Err` value: (Some(3), "Canister ryjl3-tyaaa-aaaaa-aaaba-cai not found")', src/main.rs:112:21"

dfx canister --no-wallet --network ic call read_rs balance "(record { account=\"d3e13d4777e22367532053190b6c6ccf57444a61337e996242b1abfb52cf92c8\" })"
The Replica returned an error: code 5, message: "IC0503: Canister ywrdt-7aaaa-aaaah-qaaaa-cai trapped explicitly: Panicked at 'called `Result::unwrap()` on an `Err` value: (Some(3), "Canister ryjl3-tyaaa-aaaaa-aaaba-cai not found")', src/main.rs:92:12"

here is the source https://github.com/dfinance-tech/read_rs/blob/master/src/main.rs

But I can succeed locally:

 dfx canister --no-wallet call read_rs block '(1)'
(
  record {
    transaction = record {
      memo = 1_347_768_404 : nat64;
      created_at_time = record {
        timestamp_nanos = 1_627_311_192_165_889_000 : nat64;
      };
      transfer = variant {
        Send = record {
          to = "4f2f64bf009bb1f62e58c8979976a50b2974f0d7148b7010621e8f7aff000c1b";
          fee = record { e8s = 10_000 : nat64 };
          from = "432cfd7d1776c9b5c603590b9ab778abfb4456556d9aecc1fc20aaee0df039b5";
          amount = record { e8s = 100_000_000 : nat64 };
        }
      };
    };
    timestamp = record { timestamp_nanos = 1_627_311_192_165_889_000 : nat64 };
    parent_hash = opt record {
      inner = blob "\17\b3\8fK\1cHF\e4F|9\e5\8d\a5,K\19\c8\12Z#\93\92p\aa\98\95\e6\d0\9e\1f\05";
    };
  },
)

dfx canister --no-wallet call read_rs balance "(record { account=\"432cfd7d1776c9b5c603590b9ab778abfb4456556d9aecc1fc20aaee0df039b5\" })"
(record { e8s = 99_999_899_990_000 : nat64 })
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment