Best way to send external data into Motoko?

I’m trying to make DApp on ICP and i have some question about sending or requesting data from outside into ICP?

From what i found inside this topic, requesting data is impossible for now!
Also did found from this topic, its possible to send data into backend canister!

The question is:

  • Am i right?
  • Can i get some working example ?
  • If i have to make node for sending data into backend canister, what’s the best way to do that? is that possible to run node inside ICP ?

Thanks in advance.

Yes you’re right.

Any canister with public function is working example. I guess you haven’t realized it, calling public function of canister is sending data to it.

What do you mean by “node”? Do you mean generic computer running generic software? Instead of “subnet node” in Internet Computer’s term, which runs dedicated software that complies to ICP? If so then would be a “no”. You don’t run this kind of “node” inside IC system/datacenter.

But you can run it elsewhere e.g. AWS, and you can always communicate with the IC through gateway.

1 Like

Personally I find that watching the movie Tenet assists the understanding of asynchronous data flow. Query the future!

1 Like

Thank you so much.

I should buy some AWS then.

Two more question:

  • is that secure if i fetch data from blockchain inside node then send them to canister?
  • How can i make a identity inside Motoko for my nodes so just they can call the function?

Well, one example is the NNS fetching the latest ICP / XDR exchange rate.

The code is here, but I don’t know who is calling this. (I’m guessing it lives off-chain.)

1 Like

Thank you, Is there any Motoko solution out there?