Odd “created” date on ic.rocks

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?

1 Like

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

3 Likes

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.

1 Like

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:

3 Likes

Looks like this is just for Motoko? Rust canisters need to implement it on their own?

1 Like

You can add this endpoint in Rust with a few lines of code: GitHub - chenyan2002/ic-repl

3 Likes

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. :slight_smile: 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 :sweat_smile:

1 Like

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.

1 Like