diff --git a/docs/developer-docs/developer-tools/off-chain/agents/rust-agent.mdx b/docs/developer-docs/developer-tools/off-chain/agents/rust-agent.mdx index 559726cf0c..4fd75aa333 100644 --- a/docs/developer-docs/developer-tools/off-chain/agents/rust-agent.mdx +++ b/docs/developer-docs/developer-tools/off-chain/agents/rust-agent.mdx @@ -8,17 +8,15 @@ import { MarkdownChipRow } from "/src/components/Chip/MarkdownChipRow"; - - The [ICP Rust agent](https://docs.rs/ic-agent/latest/ic_agent/) by DFINITY is a simple library that enables you to build applications and interact with ICP, serving as a low-level Rust backend for the IC SDK. The agent is designed to be compatible with multiple versions of the replica API, exposing both low-level APIs for communicating with components like the replica and higher-level APIs for communicating with software applications deployed as canisters. -One example of a project that uses the [ICP Rust agent](https://docs.rs/ic-agent/latest/ic_agent/) is [dfx](https://github.com/dfinity/sdk). +One example of a project that uses the ICP Rust agent is [dfx](https://github.com/dfinity/sdk). ## Adding the agent as a dependency -To add the [ICP Rust agent](https://docs.rs/ic-agent/latest/ic_agent/) crate as a dependency in your project, use the command: +To add the ICP Rust agent crate as a dependency in your project, use the command: ``` cargo add ic-agent @@ -41,6 +39,25 @@ pub async fn create_agent(url: &str, is_mainnet: bool) -> Result { } ``` +### Using dynamic routing + +The ICP Rust agent provides built-in dynamic routing functionality, allowing an application to communicate seamlessly via decentralized API boundary nodes for optimal performance. To enable dynamic routing, the agent needs to be initialized with a bootstrap URL. Using this initial URL, the agent will: + +- Fetch the list of available API boundary nodes. +- Continuously monitor the health of these nodes. +- Automatically route requests to the closest healthy node. + +Here’s an example of how to set up your agent with dynamic routing: + +```rust +let agent = Agent::builder() + .with_url(URL) + .with_background_dynamic_routing() + .await + .build() + .expect("failed to build ic-agent"); +``` + ## Authentication diff --git a/submodules/internetidentity b/submodules/internetidentity index 760f2710bb..6819061c9a 160000 --- a/submodules/internetidentity +++ b/submodules/internetidentity @@ -1 +1 @@ -Subproject commit 760f2710bb4a974b082756e845aa78825374d550 +Subproject commit 6819061c9a2ac31e3179c5d9729530d222b01696 diff --git a/submodules/motoko b/submodules/motoko index cef9238646..ac13a33066 160000 --- a/submodules/motoko +++ b/submodules/motoko @@ -1 +1 @@ -Subproject commit cef9238646a6e2237806f7c293db361dcde53da9 +Subproject commit ac13a33066cdf2a28cb301aad54c29858360b32a diff --git a/submodules/quill b/submodules/quill index 01c8e8af38..afa26b3d18 160000 --- a/submodules/quill +++ b/submodules/quill @@ -1 +1 @@ -Subproject commit 01c8e8af38b18d3103c0485850309930e14c380a +Subproject commit afa26b3d1893d4d9d56b968314c108083a86ea94 diff --git a/submodules/response-verfication b/submodules/response-verfication index e5df91286d..ede16c029b 160000 --- a/submodules/response-verfication +++ b/submodules/response-verfication @@ -1 +1 @@ -Subproject commit e5df91286d8027309f4741730107a39f9c878241 +Subproject commit ede16c029b10cfb2165e4498928ad30ab6e6f50b diff --git a/submodules/sdk b/submodules/sdk index c1d7978ca0..455cd63f20 160000 --- a/submodules/sdk +++ b/submodules/sdk @@ -1 +1 @@ -Subproject commit c1d7978ca0c39ef3ad284f7c562b3340f5ad8f25 +Subproject commit 455cd63f20fb812e065dcc6e1d75122d993b4d91