use iota_client::{Client, Result};
#[tokio::main]
async fn main() -> Result<()> {
let iota = Client::builder()
.with_node("https://api.lb-0.h.chrysalis-devnet.iota.cafe")?
.finish()
.await?;
let message = iota
.message()
.with_index("Hello")
.with_data("Tangle".as_bytes().to_vec())
.finish()
.await?;
println!(
"Message sent https://explorer.iota.org/devnet/message/{}\n",
message.id().0
);
let fetched_message_ids = iota.get_message().index("Hello").await.unwrap();
println!("Messages with Hello index: {fetched_message_ids:?}");
Ok(())
}