在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称:gkbrk/rust-ipfs-api开源软件地址:https://github.com/gkbrk/rust-ipfs-api开源编程语言:Rust 100.0%开源软件介绍:Rust IPFS API ClientA client library for the IPFS API. This library allows you to use the local IPFS daemon from Rust. Usage[dependencies]
ipfsapi = "0.2" ExamplesReading a file from IPFSHere's an example that gets the contents of a file from IPFS and displays it. let api = IpfsApi::new("127.0.0.1", 5001);
let bytes = api.cat("QmWATWQ7fVPP2EFGu71UkfnqhYXDYH566qy47CnJDgvs8u").unwrap();
let data = String::from_utf8(bytes.collect()).unwrap();
println!("{}", data); The code gets the content of the IPFS hash and displays "Hello World". Subsribing to messages on IPFS Pubsublet api = IpfsApi::new("127.0.0.1", 5001);
let messages = api.pubsub_subscribe("chat").unwrap();
for message in messages {
println!("{:?}", message);
} Implemented Functionality
|
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论