# Getting Started

**URL:** https://forum.dfinity.org/c/developers/quick-start/18.md?page=1

[Latest](https://forum.dfinity.org/latest.md) · [Categories](https://forum.dfinity.org/categories.md) · [Tags](https://forum.dfinity.org/tags.md)

**Page:** 2

---

## [Getting Error trying to interact with XRC exchange rate canister](https://forum.dfinity.org/t/getting-error-trying-to-interact-with-xrc-exchange-rate-canister/25214)

<div class="topic-metadata">

**Author:** [@BarFTW](https://forum.dfinity.org/u/BarFTW)\
**Replies:** 2\
**Last updated:** [December 3, 2023, 12:44am UTC](https://forum.dfinity.org/t/getting-error-trying-to-interact-with-xrc-exchange-rate-canister/25214 "2023-12-03T00:44:15Z")

</div>

been trying to get exchange rates from the xrc exchange rate canister (at uf6dk-hyaaa-aaaaq-qaaaq-cai) and I keep running into problems. even running the example command explicitly mentioned in the docs (at Exchange rat…

---

## [Is the cycles-burned from ic-api v2 accurate?](https://forum.dfinity.org/t/is-the-cycles-burned-from-ic-api-v2-accurate/25119)

<div class="topic-metadata">

**Author:** [@unk](https://forum.dfinity.org/u/unk)\
**Replies:** 1\
**Last updated:** [November 28, 2023, 10:41pm UTC](https://forum.dfinity.org/t/is-the-cycles-burned-from-ic-api-v2-accurate/25119 "2023-11-28T22:41:11Z")

</div>

Is the cycles-burned from the ic-api v2 accurate? This URL: https://ic-api.internetcomputer.org/api/v2/metrics/cycles-burned?step=86400&end=1698969600&start=1698796800 returns: { "cycles\_burned": \[ \[ 1698…

---

## [How to optimize this code to randomly shuffle a vector?](https://forum.dfinity.org/t/how-to-optimize-this-code-to-randomly-shuffle-a-vector/24976)

<div class="topic-metadata">

**Author:** [@ildefons](https://forum.dfinity.org/u/ildefons)\
**Replies:** 2\
**Last updated:** [November 26, 2023, 1:54pm UTC](https://forum.dfinity.org/t/how-to-optimize-this-code-to-randomly-shuffle-a-vector/24976 "2023-11-26T13:54:59Z")

</div>

The Fisher-Yates shuffle is a fast algorithm to randomly shuffle a vector. I have implemented it in Motoko but the final code is 4x the size of the pseudoceode. I ran out of ideas to reduce the SLoC. Maybe I’m missing so…

---

## [Error: Failed while waiting for agent status](https://forum.dfinity.org/t/error-failed-while-waiting-for-agent-status/24910)

<div class="topic-metadata">

**Author:** [@theoman42](https://forum.dfinity.org/u/theoman42)\
**Replies:** 1\
**Last updated:** [November 25, 2023, 6:47pm UTC](https://forum.dfinity.org/t/error-failed-while-waiting-for-agent-status/24910 "2023-11-25T18:47:56Z")

</div>

I am simply trying to dfx ping ic and keep getting this error. Caused by: Failed while waiting for agent status. An error happened during communication with the replica: error sending request for url (https://icp0.i…

---

## [Geo location block http\_request](https://forum.dfinity.org/t/geo-location-block-http-request/24913)

<div class="topic-metadata">

**Author:** [@BarFTW](https://forum.dfinity.org/u/BarFTW)\
**Replies:** 1\
**Last updated:** [November 23, 2023, 12:13pm UTC](https://forum.dfinity.org/t/geo-location-block-http-request/24913 "2023-11-23T12:13:11Z")

</div>

As I currently understand it, an http outcall will be sent multiple times from different nodes in the subnet. The issue is that if I am to query a service whose URL address is restricted by geo-location then the nodes w…

---

## [Ic\_cdk::api::instruction\_counter in Motoko?](https://forum.dfinity.org/t/ic-cdk-instruction-counter-in-motoko/24720)

<div class="topic-metadata">

**Author:** [@ildefons](https://forum.dfinity.org/u/ildefons)\
**Replies:** 4\
**Last updated:** [November 20, 2023, 12:23pm UTC](https://forum.dfinity.org/t/ic-cdk-instruction-counter-in-motoko/24720 "2023-11-20T12:23:10Z")

</div>

Does it exist ic\_cdk::api::instruction\_counter in Motoko? If not, is it somehow possible toretrieve " the number of instructions that the canister executed since the last entry point"?

---

## [Canister call with long execution time](https://forum.dfinity.org/t/canister-call-with-long-execution-time/24712)

<div class="topic-metadata">

**Author:** [@ildefons](https://forum.dfinity.org/u/ildefons)\
**Replies:** 17\
**Last updated:** [November 17, 2023, 1:31pm UTC](https://forum.dfinity.org/t/canister-call-with-long-execution-time/24712 "2023-11-17T13:31:06Z")

</div>

I’m developing a machine learning (ML) method that can take up to 10s of minutes to complete. However, canister calls can only run for few seconds due to limitations of the consensus algorithm. To overcome this limit I w…

---

## [Where is a complete app example, from DFINITY, that includes a front end?](https://forum.dfinity.org/t/where-is-a-complete-app-example-from-dfinity-that-includes-a-front-end/24722)

<div class="topic-metadata">

**Author:** [@nolma](https://forum.dfinity.org/u/nolma)\
**Replies:** 1\
**Last updated:** [November 15, 2023, 10:33pm UTC](https://forum.dfinity.org/t/where-is-a-complete-app-example-from-dfinity-that-includes-a-front-end/24722 "2023-11-15T22:33:32Z")

</div>

The examples at https://github.com/dfinity/examples/tree/master/motoko/simple-to-do have motoko code only, there isn’t a front end example. I found that repo from Overview | Internet Computer . In that repo, the develo…

---

## [Dfx Start error after upgrading to 0.14.0 and not able to install specific dfx version](https://forum.dfinity.org/t/dfx-start-error-after-upgrading-to-0-14-0-and-not-able-to-install-specific-dfx-version/24606)

<div class="topic-metadata">

**Author:** [@Myartbar](https://forum.dfinity.org/u/Myartbar)\
**Replies:** 0\
**Last updated:** [November 12, 2023, 3:03am UTC](https://forum.dfinity.org/t/dfx-start-error-after-upgrading-to-0-14-0-and-not-able-to-install-specific-dfx-version/24606 "2023-11-12T03:03:23Z")

</div>

Hello I needed help regarding embedding an ICP dapp, using a html file that is embedded on a web page that does a simple redirect to the icp dapp, I am facing an issue saying ( canister id ) Refused to connect as X-FR…

---

## [How do I add my Windows or Ubuntu Computer to my ICP Identity without a hardware key?](https://forum.dfinity.org/t/how-do-i-add-my-windows-or-ubuntu-computer-to-my-icp-identity-without-a-hardware-key/4521)

<div class="topic-metadata">

**Author:** [@knowself](https://forum.dfinity.org/u/knowself)\
**Replies:** 14\
**Last updated:** [June 14, 2021, 5:23pm UTC](https://forum.dfinity.org/t/how-do-i-add-my-windows-or-ubuntu-computer-to-my-icp-identity-without-a-hardware-key/4521 "2021-06-14T17:23:15Z")

</div>

How do I add my Windows or Ubuntu Computer to my ICP Identity without a hardware key? I have an Internet Computer Identity generated with my security protocol on my phone, but translating that into being able to access h…

---

## [Error logging icrc1 token name in frontend](https://forum.dfinity.org/t/error-logging-icrc1-token-name-in-frontend/22898)

<div class="topic-metadata">

**Author:** [@nolma](https://forum.dfinity.org/u/nolma)\
**Replies:** 5\
**Last updated:** [November 7, 2023, 8:04pm UTC](https://forum.dfinity.org/t/error-logging-icrc1-token-name-in-frontend/22898 "2023-11-07T20:04:59Z")

</div>

Why am I not seeing a response to my query here? How do I call a function on the canister from my frontend? import { token\_lobby\_backend } from "../../declarations/token\_lobby\_backend"; import { idlFactory } from "../.…

---

## [Composibility in the Internet Computer](https://forum.dfinity.org/t/composibility-in-the-internet-computer/24328)

<div class="topic-metadata">

**Author:** [@ildefons](https://forum.dfinity.org/u/ildefons)\
**Replies:** 4\
**Last updated:** [November 1, 2023, 8:24pm UTC](https://forum.dfinity.org/t/composibility-in-the-internet-computer/24328 "2023-11-01T20:24:02Z")

</div>

While having an informal discussion on X/Tweeter, I learned that more experienced developers than myself think that “composability” in the Internet Computer is an issue because every call that a container does to another…

---

## [How to create a vector containing many data types without using "Any" and without creating a new abstract type](https://forum.dfinity.org/t/how-to-create-a-vector-containing-many-data-types-without-using-any-and-without-creating-a-new-abstract-type/24283)

<div class="topic-metadata">

**Author:** [@ildefons](https://forum.dfinity.org/u/ildefons)\
**Replies:** 1\
**Last updated:** [October 31, 2023, 1:28pm UTC](https://forum.dfinity.org/t/how-to-create-a-vector-containing-many-data-types-without-using-any-and-without-creating-a-new-abstract-type/24283 "2023-10-31T13:28:00Z")

</div>

I would like to create a vector in Motoko that can contain different data types symultaneously without creating an abstract type. For instance: let v : \[Any\] = \["1",2,"3",4\]; It seems that I can do that, but I would li…

---

## [How to create a Motoko function to random sample a vector](https://forum.dfinity.org/t/how-to-create-a-motoko-function-to-random-sample-a-vector/24117)

<div class="topic-metadata">

**Author:** [@ildefons](https://forum.dfinity.org/u/ildefons)\
**Replies:** 10\
**Last updated:** [October 30, 2023, 11:25am UTC](https://forum.dfinity.org/t/how-to-create-a-motoko-function-to-random-sample-a-vector/24117 "2023-10-30T11:25:33Z")

</div>

I would like to develop a Motoko function to random sample a vector. It should look like: let v: \[Nat\] = \[1,2,3,4,5,6,8,9\]; let vv: \[Nat\] = randomSample(sample=v, num\_samples=4, with\_repetition=false, seed=12); // vv = …

---

## [How to check the type of a vector element](https://forum.dfinity.org/t/how-to-check-the-type-of-a-vector-element/23961)

<div class="topic-metadata">

**Author:** [@ildefons](https://forum.dfinity.org/u/ildefons)\
**Replies:** 3\
**Last updated:** [October 24, 2023, 8:10pm UTC](https://forum.dfinity.org/t/how-to-check-the-type-of-a-vector-element/23961 "2023-10-24T20:10:23Z")

</div>

I would like to execute a function depending of the variable type. How can I do that? For instance, it should be somethin like that: let textVec = \["1", "2", "3", "1", "2", "3", "1"\]; let aux = textVec\[0\]; switch (aux)…

---

## [Problem with Prim.nat64ToNat32](https://forum.dfinity.org/t/problem-with-prim-nat64tonat32/23976)

<div class="topic-metadata">

**Author:** [@ildefons](https://forum.dfinity.org/u/ildefons)\
**Replies:** 1\
**Last updated:** [October 24, 2023, 2:01pm UTC](https://forum.dfinity.org/t/problem-with-prim-nat64tonat32/23976 "2023-10-24T14:01:03Z")

</div>

I am trying to use a method I found in Zhenya Usenko Github: This is the method (hash function from Nat to Nat32): func hashNat(key: Nat): Nat32 { var hash = Prim.intToNat64Wrap(key); hash := hash \>\> 30 ^ hash \*%…

---

## [Lits of unique values in vector/array](https://forum.dfinity.org/t/lits-of-unique-values-in-vector-array/23913)

<div class="topic-metadata">

**Author:** [@ildefons](https://forum.dfinity.org/u/ildefons)\
**Replies:** 2\
**Last updated:** [October 23, 2023, 4:43pm UTC](https://forum.dfinity.org/t/lits-of-unique-values-in-vector-array/23913 "2023-10-23T16:43:17Z")

</div>

I would like to develope a method to extract a list of unique values from vector: let v = \["a","b","c","c"\]; unique(v) // it should return \["a","b","c"\]; Any suggestion on how I can accomplish the extraction of a list …

---

## [How to convert Nat to Float](https://forum.dfinity.org/t/how-to-convert-nat-to-float/23911)

<div class="topic-metadata">

**Author:** [@ildefons](https://forum.dfinity.org/u/ildefons)\
**Replies:** 1\
**Last updated:** [October 20, 2023, 11:49am UTC](https://forum.dfinity.org/t/how-to-convert-nat-to-float/23911 "2023-10-20T11:49:47Z")

</div>

I want to divide a Float number by the size of an array an obtain a Float. However, array.size() returns a Nat and I cannot find a way to conver a Nat into a float before dividing. How can I convert Nat to Float?

---

## [How to index a matrix to get a subset of rows and/or columns?](https://forum.dfinity.org/t/how-to-index-a-matrix-to-get-a-subset-of-rows-and-or-columns/23887)

<div class="topic-metadata">

**Author:** [@ildefons](https://forum.dfinity.org/u/ildefons)\
**Replies:** 3\
**Last updated:** [October 19, 2023, 1:45pm UTC](https://forum.dfinity.org/t/how-to-index-a-matrix-to-get-a-subset-of-rows-and-or-columns/23887 "2023-10-19T13:45:41Z")

</div>

I would like to access a subset of rows and/or columns of a 2D matrix: let matrix : \[\[Nat\]\] = \[\[1,2,3\], \[4,5,6\], \[7,8,9\],\]; How can I get a set of rows (e.g. row 1 and ro…

---

## [How to call and declare a method that needs to receive a vector of number and text values](https://forum.dfinity.org/t/how-to-call-and-declare-a-method-that-needs-to-receive-a-vector-of-number-and-text-values/23858)

<div class="topic-metadata">

**Author:** [@ildefons](https://forum.dfinity.org/u/ildefons)\
**Replies:** 12\
**Last updated:** [October 19, 2023, 11:36am UTC](https://forum.dfinity.org/t/how-to-call-and-declare-a-method-that-needs-to-receive-a-vector-of-number-and-text-values/23858 "2023-10-19T11:36:16Z")

</div>

I would like to declare a canister method that is able to receive a vector with an arbitrary number of Text and Nat values. For instance \[1;“y”;3; “x”\] or \[1;2;3,“z”\]. How should I update the following method declaration…

---

## [How to call a method with dfx passing an array](https://forum.dfinity.org/t/how-to-call-a-method-with-dfx-passing-an-array/23827)

<div class="topic-metadata">

**Author:** [@ildefons](https://forum.dfinity.org/u/ildefons)\
**Replies:** 3\
**Last updated:** [October 17, 2023, 12:58pm UTC](https://forum.dfinity.org/t/how-to-call-a-method-with-dfx-passing-an-array/23827 "2023-10-17T12:58:48Z")

</div>

I would like to call a canister method wit the following candid description: setData: (vec nat) -\> (); How should I update the following dfs call to pass the vector \[1,2,3\]? (I have the did file) dfx canister call tes…

---

## [Recursive method with access to large data object, How to?](https://forum.dfinity.org/t/recursive-method-with-access-to-large-data-object-how-to/23797)

<div class="topic-metadata">

**Author:** [@ildefons](https://forum.dfinity.org/u/ildefons)\
**Replies:** 2\
**Last updated:** [October 17, 2023, 11:39am UTC](https://forum.dfinity.org/t/recursive-method-with-access-to-large-data-object-how-to/23797 "2023-10-17T11:39:43Z")

</div>

I would like to implement a recursive function with Motoko. This method needs to access a very large data object. What is the best way to implement it? A first option is a class with a class method to implement the recu…

---

## [Reading an ICRC-1 name in JS](https://forum.dfinity.org/t/reading-an-icrc-1-name-in-js/22529)

<div class="topic-metadata">

**Author:** [@nolma](https://forum.dfinity.org/u/nolma)\
**Replies:** 3\
**Last updated:** [September 10, 2023, 7:53pm UTC](https://forum.dfinity.org/t/reading-an-icrc-1-name-in-js/22529 "2023-09-10T19:53:40Z")

</div>

Actor creates ok but I cannot call functions on it and get a result. const token\_name = await actor.icrc1\_name(); console.log(token\_name); I never see this log^ import { idlFactory } from "../../declarations/token/tok…

---

## [How to connect a Plug wallet to Candid interface?](https://forum.dfinity.org/t/how-to-connect-a-plug-wallet-to-candid-interface/22528)

<div class="topic-metadata">

**Author:** [@nolma](https://forum.dfinity.org/u/nolma)\
**Replies:** 1\
**Last updated:** [September 5, 2023, 11:08pm UTC](https://forum.dfinity.org/t/how-to-connect-a-plug-wallet-to-candid-interface/22528 "2023-09-05T23:08:27Z")

</div>

The answer here points to a 404. How do I connect my browser wallet to the Candid interface? I tried await window?.ic?.plug?.requestConnect({ \["my-canister-id"\]}); (using my actual canister id) “error: missing : af…

---

## [Image Failure on Network Deployment (502)](https://forum.dfinity.org/t/image-failure-on-network-deployment-502/22482)

<div class="topic-metadata">

**Author:** [@evanmcfarland](https://forum.dfinity.org/u/evanmcfarland)\
**Replies:** 0\
**Last updated:** [August 31, 2023, 8:23pm UTC](https://forum.dfinity.org/t/image-failure-on-network-deployment-502/22482 "2023-08-31T20:23:11Z")

</div>

I’m building a project with a structure from the quickstart framework. I got my homepage frontend set up and functional (no backend code yet), except the images. All my images/thumbnails work beautifully in the local dep…

---

## [Dragginz - a virtual world on DFinity](https://forum.dfinity.org/t/dragginz-a-virtual-world-on-dfinity/836)

<div class="topic-metadata">

**Author:** [@anon98822045](https://forum.dfinity.org/u/anon98822045)\
**Replies:** 23\
**Last updated:** [August 29, 2023, 7:40pm UTC](https://forum.dfinity.org/t/dragginz-a-virtual-world-on-dfinity/836 "2023-08-29T19:40:16Z")

</div>

Hi everybody, long time DFinity follower here. We’re a small team working on a virtual world / game and looking for advice about exactly which parts of the project we could move over to the Internet Computer. So my fir…

---

## [Stable memory and heap on canisters](https://forum.dfinity.org/t/stable-memory-and-heap-on-canisters/22014)

<div class="topic-metadata">

**Author:** [@valroxs](https://forum.dfinity.org/u/valroxs)\
**Replies:** 1\
**Last updated:** [August 9, 2023, 9:19am UTC](https://forum.dfinity.org/t/stable-memory-and-heap-on-canisters/22014 "2023-08-09T09:19:57Z")

</div>

I’m not quite sure I understand how much storage is available on canisters and how it’s managed. Here is what I don’t understand: To my understanding, I store something as a stable variable that will be stored in the c…

---

## [Latest nns ledger wasm/candid for local testing](https://forum.dfinity.org/t/latest-nns-ledger-wasm-candid-for-local-testing/21558)

<div class="topic-metadata">

**Author:** [@dctech](https://forum.dfinity.org/u/dctech)\
**Replies:** 4\
**Last updated:** [July 22, 2023, 5:18pm UTC](https://forum.dfinity.org/t/latest-nns-ledger-wasm-candid-for-local-testing/21558 "2023-07-22T17:18:45Z")

</div>

the ledger wasm/candid from online doc or sample code seems outdated, compared to the mainnet one ICP/NNS ledger archive one is (extracted from dashboard) get\_blocks: (record {start:nat64; length:nat64}) → (variant {Ok…

---

## [Edit: No bug, resolved](https://forum.dfinity.org/t/edit-no-bug-resolved/21322)

<div class="topic-metadata">

**Author:** [@justmythoughts](https://forum.dfinity.org/u/justmythoughts)\
**Replies:** 12\
**Last updated:** [July 13, 2023, 1:17pm UTC](https://forum.dfinity.org/t/edit-no-bug-resolved/21322 "2023-07-13T13:17:30Z")

</div>

Edit: this is not a bug, and is just a case of someone editing the inner HTML. My apologies for the accusations. … @diegop @bjoernek Clearly this is a bug and not a feature, right? Or is DFINITY encouraging levels of…

---

## [Error building IC in a submodule via github actions](https://forum.dfinity.org/t/error-building-ic-in-a-submodule-via-github-actions/21174)

<div class="topic-metadata">

**Author:** [@0kenx](https://forum.dfinity.org/u/0kenx)\
**Replies:** 2\
**Last updated:** [July 5, 2023, 7:50am UTC](https://forum.dfinity.org/t/error-building-ic-in-a-submodule-via-github-actions/21174 "2023-07-05T07:50:37Z")

</div>

Hello, I added the dfnity/ic repo as a submodule in my own project. In the CI pipeline I set up a github action to update the IC and build wasms periodically using cd ic && ./gitlab-ci/container/build-ic.sh -c. But I ru…

[Previous page](https://forum.dfinity.org/c/developers/quick-start/18.md)

[Next page](https://forum.dfinity.org/c/developers/quick-start/18.md?page=2)
