1

When I try cargo build the Rust example posted on the IOTA Chrysalis documentation website Getting Started with Rust

use iota::Client;

#[tokio::main]
async fn main() {
    let iota = Client::builder() // Crate a client instance builder
        .with_node("https://api.lb-0.testnet.chrysalis2.com")
        .unwrap()
        .finish()
        .await
        .unwrap();

    let info = iota.get_info().await.unwrap();
    println!("Nodeinfo: {:?}", info);
}

I am getting the following errors:

enter image description here

I also added

[dependencies]
iota-core = { git = "https://github.com/iotaledger/iota.rs", branch = "dev" }

to Cargo.toml

Also when the example is run directly on the website the following errors occur:

enter image description here

Can someone please help me to solve the errors?

3

For this example you also have to add tokio = { version = "1.1", features = ["full"] } to your Cargo.toml like here https://github.com/iotaledger/iota.rs/blob/dev/examples/Cargo.toml

For the website it's only to be viewed there and you can't run it because play.rust-lang.org doesn't have support for the required dependencies

1

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.