[0.7.0-beta.2+] Can't access Candid Interface

Since 0.7.0-beta.2+

I can’t access the Candid interface

http://localhost:8000/candid?canisterId=rrkah-fqaaa-aaaaa-aaaaq-cai

Bring me to

Details: ReplicaError { reject_code: 3, reject_message: "IC0302: Canister rrkah-fqaaa-aaaaa-aaaaq-cai has no query method \'http_request\'" }

I’ve read the article from Hans

So I tried

http://localhost:8000/_/candid?canisterId=rrkah-fqaaa-aaaaa-aaaaq-cai

And it just gives me the raw DIDL without any Swagger-like interface :thinking:

2 Likes

I was getting that on 0.7.0-beta.2 but it seems on 0.7.0-beta.3 is working now.
I’m also using @dfinity/agent": "0.8.3", but not sure if that matters tbh.

I’m having the same problem on 0.7.0, how do i know if i am on beta 2 or 3? i only reinstalled today so i am pretty sure the problem still persists in the latest version.

1 Like

You can check the version of dfx you have installed by running the following command:
dfx —version

You get to the Candid UI a little differently in the latest release:

Test functions in a browser

The canister interface description language—often referred to as Candid or more generally as the IDL—provides a common language for specifying the signature of a canister service. Candid provides a unified way for you to interact with canisters that are written in different languages or accessed using different tools. For example, Candid provides a consistent view of a service whether the underlying program is native Rust, JavaScript, or Motoko. Candid also enables different tools—such as the dfx command-line interface and the Network Nervous System application—to share a common description for a service.

Based on the type signature of the actor, Candid also provides a web interface that allows you to call canister functions for testing and debugging.

After you have deployed your project locally using the dfx deploy or dfx canister install command, you can access the Candid web interface endpoint in a browser. This web interface—the Candid UI—exposes the service description in a form, enabling you to quickly view and test functions and experiment with entering different data types without writing any front-end code.

To use the Candid web interface to test canister functions:

  1. Copy the Candid UI canister identifier for your application.
  2. Open a browser and navigate to the address and port number specified in the dfx.json configuration file.

By default, the local network binds to the 127.0.0.1:8000 address and port number.

  1. Add the required canisterId and UI canister identifier to the URL.

For example, the full URL should look similar to the following but with the canister_identifier that was returned by the dfx deploy or dfx canister install command:

http://127.0.0.1:8000/?canisterId=

In the form displayed, you can provide a canister identifier or choose a Candid description ( .did ) file to display.

  1. Paste the <project-name>_assets canister identifier for your application into the Provide a canister ID field, then click Go .
  2. Review the list of function calls and types defined in the program.
  3. Type a value of the appropriate type for a function or click Random to generate a value, then click Call or Query to see the result.

Note that depending on the data type, the Candid interface might display additional configuration settings for testing functions. For example, if a function takes an array, you might need to specify the number of items in the array before entering values.

In this example, each function accepts an array of text strings. Therefore, you first select the length of the array, then set values for each item before clicking Call .

This doesn’t seem to be the case. The __Candid_UI cid isn’t printed out on deploy. But it can be found in .dfx/local/canister_ids.json.

The URL scheme to take you directly to the Candid UI is now:

http://127.0.0.1:8000/candid?canisterId=[__Candid_UI cid]&id=[cid of the canister to investigate]

i.e. you now need to enter two canister ids into the URL (or into the form on the page if you left out the second id) to be able to see the Candid UI.