Closed Jzow closed 2 years ago
This is not very friendly for new developers
If you actually get it working, the errors are also super unhelpful...
use http::Uri;
use ipfs_api_backend_hyper::{IpfsApi, IpfsClient, TryFromUri};
use std::io::Cursor;
#[tokio::main]
async fn main() {
let uri = "http://192.168.1.80:5001/".parse::<Uri>().unwrap();
let client = IpfsClient::build_with_base_uri(uri);
match client.version().await {
Ok(version) => eprintln!("version: {:?}", version.version),
Err(e) => eprintln!("error getting version: {}", e),
};
match client.pubsub_pub("test", Cursor::new("TEST!")).await {
Ok(_) => println!("OK!"),
Err(e) => println!("error: {}", e),
};
}
./target/debug/ipfs-mqtt
error getting version: ipfs client error `api returned an unknown error ```
error: ipfs client error `api returned an unknown error ```
When I want to get a piece of text through hash, I can't print it out
error:
I also try to use object_get method. I can't find the relevant example