Skip to content

Conversation

mihailjianu1
Copy link

This showcases two ways of using the http outcalls feature in rust, and adds them to the icp ninja examples:

  • A replicated http outcall to a constant, fairly deterministic service
  • a non replicated outcall to a volatile service

In the case of the replicated http outcall, we also showcase the use of transform queries and how / why they help reach consensus.

@mihailjianu1 mihailjianu1 requested a review from a team as a code owner August 28, 2025 10:25
body: None,
// No need to transform the response any longer, as it is not replicated
transform: None,
// The request is not replicated. This means that a single node will attempt the outcall. This is ideal for fast moving data (such as eg crypto prices), non idempotent operations and so on.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should mention here that one must be cautious with trusting such a response, as a malicious replica could return whatever it wanted. And maybe also that for practical purposes this usually means that one needs a way to verify the response out of band inside the canister, or to send out multiple such requests and only accept if enough responses agree.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Similarly, I'd also mention something along those lines in the readme.md.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good points, I added some more comments both in the code and in the readme doc

@fxgst
Copy link
Contributor

fxgst commented Sep 1, 2025

Is this supposed to replace the HTTP Get and HTTP Post examples? They seem quite overlapping

@letmejustputthishere
Copy link
Member

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

Successfully merging this pull request may close these issues.

4 participants