Using the build script approach (build.rs), we auto-generate an api_seed_nodes.rs file, containing a full list of existing API nodes. This generation is done at compile time. The generated api_seed_nodes.rs file is further used as a seed-list input for building an agent with discovery service.
This is how the generated api_seed_nodes.rs file looks like:
#[tokio::main]
async fn main() {
let client = Client::builder().build().expect("failed to build a client");
let agent = Agent::builder()
.with_discovery_transport(client)
.await
.build()
.expect("failed to create an agent");
// use agent for query, update calls.
}
Description
Using the build script approach (
build.rs
), we auto-generate anapi_seed_nodes.rs
file, containing a full list of existing API nodes. This generation is done at compile time. The generatedapi_seed_nodes.rs
file is further used as a seed-list input for building an agent with discovery service.This is how the generated
api_seed_nodes.rs
file looks like:How Has This Been Tested?
Tested manually by running:
Checklist: