Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Newly deployed canisters from latest dfx no longer include __get_candid_interface_tmp_hack #113

Open
bodily11 opened this issue May 18, 2024 · 3 comments

Comments

@bodily11
Copy link

This is the error when you try to pull the candid directly using the tmp_hack method.

Exception: Canister reject the call: IC0536: Error from Canister rdmx6-jaaaa-aaaaa-aaadq-cai: Canister has no query method '__get_candid_interface_tmp_hack'

If you check on the dashboard, https://dashboard.internetcomputer.org/canister/rdmx6-jaaaa-aaaaa-aaadq-cai, they are still able to pull the candid for the canister. I believe they are doing a raw state call and then parsing the candid from the return object.

I use the Canister(agent=agent, canister_id=canister_id) syntax all the time (super easy/helpful). It would be fantastic if we could automatically try the "__get_candid_interface_tmp_hack", if that doesn't work, do the raw state call and try to parse for the candid, and then if that fails, then we can display an error.

Thoughts?

@Myse1f
Copy link
Contributor

Myse1f commented May 18, 2024

If the __get_candid_interface_tmp_hack cannot work anymore, caller should provide the candid.

It would be fantastic if we could automatically try the "__get_candid_interface_tmp_hack", if that doesn't work, do the raw state call and try to parse for the candid, and then if that fails, then we can display an error.

I thought there no way we can encode the argument without the structure defination. ic-py uses the candid to parse it to python defination and then it know how to encode the argument.

@bodily11
Copy link
Author

I believe there is a new way for canisters to provide their candid (some kind of raw state call, and then parsing it to get the provided candid). I think this is what the dashboard.internetcomputer.org is doing with the II canister.

See more info here: https://forum.dfinity.org/t/get-candid-interface-tmp-hack-gives-ic503-error/24992/4?u=bob11

@bodily11
Copy link
Author

Ah yep. I'd like to do something like this: https://github.com/dfinity/agent-js/blob/21e8d2b/packages/agent/src/fetch_candid.ts#L14

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants