I just created a canister with dfx ledger create-canister
; it has principal 6b4pv-sqaaa-aaaah-qaava-cai
. But https://ic.rocks/principal/6b4pv-sqaaa-aaaah-qaava-cai says it was created three days ago, on June 11.
Any idea why, @wang?
I just created a canister with dfx ledger create-canister
; it has principal 6b4pv-sqaaa-aaaah-qaava-cai
. But https://ic.rocks/principal/6b4pv-sqaaa-aaaah-qaava-cai says it was created three days ago, on June 11.
Any idea why, @wang?
Well that creation date June 11, 2021 21:57:29 UTC seems to be a commonly shared creation date …
My strategy to detect new canisters is to maintain the generated_id_counter
for each subnet, and continuously poll /[canisterId]/query
- if error, no canister exists, else exists.
When subnets gmq5v
and pjljw
were first created, I saw a bunch of objects created, 80 and 140 respectively. Not sure if those were true canisters or just test objects (or a bug in my code, quite likely).
Those canisters no longer exist and the generated_id_counter
has been reset to 0, so the canisters being created now already exist in my database, having been created at that timestamp.
Is there a better way to detect new canisters? For now, I can manually clear the fake canisters
Good question.
You could also provide a way to get notified proactively, either on the IC or off of it, if you wanted?
I think what you do now makes sense, given that you want to get all of the canisters out there, and AFAIK, there is no public list.
How do you get the did of canisters? I looked up one of mine and you had the dummy functions that I pushed up. I was curious how you got those?
All motoko canisters expose a __get_candid_interface_tmp_hack
function which returns its candid:
Looks like this is just for Motoko? Rust canisters need to implement it on their own?
You can add this endpoint in Rust with a few lines of code: GitHub - chenyan2002/ic-repl
Hey @wang I’ve greatly enjoyed using ic.rocks to see my canister and use it, but just now, I get a failure when I visit the page for it, here: Principal | ic.rocks
Could it be due to how it queries the canister or processes its results?
dfx canister --no-wallet --network=ic call --query fzcsx-6yaaa-aaaae-aaama-cai logTail
Will produce the log that I want to view on that page, FWIW. It worked yesterday and it was great, since I kept upgrading and the log never forgot anything (stored in a stable var
). Now it doesn’t seem so stable, except that the dfx
command above still works for me.
The source for the canister is here GitHub - matthewhammer/candid-spaces: A candid data lake service for the internet computer.
Display bug, fixed now
That’s odd. Maybe during subnet start up a different error occurs, and your code mistook them as indication that a canister exists?
Not that I know of.
It’s not “just for” Motoko, but yes, Motoko generates that automatically. With rust you have to add the endpoint on your own. See the link by Yan Chen for how do to the same almost automatically from Rust.