remove obsolete examples
client1 and client2 were a pair of two peers working together to form up an example where one client creates an ipld document and the other one downloads it, reading IPLD projections. the bitswap side is already done elsewhere and the nature of use having to run two clients, there just wasn't an easy way around without running the two nodes in the same process. if that was done, then the example would be the same as tests.
This commit is contained in:
parent
bb072f81fe
commit
65c3f48cba
@ -1 +0,0 @@
|
||||
Here is some data
|
@ -1,21 +0,0 @@
|
||||
use futures::join;
|
||||
use ipfs::{make_ipld, Ipfs, TestTypes, UninitializedIpfs};
|
||||
use tokio::task;
|
||||
|
||||
#[tokio::main]
|
||||
async fn main() {
|
||||
tracing_subscriber::fmt::init();
|
||||
|
||||
let (ipfs, fut): (Ipfs<TestTypes>, _) =
|
||||
UninitializedIpfs::default().await.start().await.unwrap();
|
||||
task::spawn(fut);
|
||||
|
||||
let f1 = ipfs.put_dag(make_ipld!("block1"));
|
||||
let f2 = ipfs.put_dag(make_ipld!("block2"));
|
||||
let (res1, res2) = join!(f1, f2);
|
||||
|
||||
let root = make_ipld!([res1.unwrap(), res2.unwrap()]);
|
||||
ipfs.put_dag(root).await.unwrap();
|
||||
|
||||
ipfs.exit_daemon().await;
|
||||
}
|
@ -1,24 +0,0 @@
|
||||
use futures::join;
|
||||
use ipfs::{Ipfs, IpfsPath, TestTypes, UninitializedIpfs};
|
||||
use std::str::FromStr;
|
||||
use tokio::task;
|
||||
|
||||
#[tokio::main]
|
||||
async fn main() {
|
||||
tracing_subscriber::fmt::init();
|
||||
|
||||
let path =
|
||||
IpfsPath::from_str("/ipfs/zdpuB1caPcm4QNXeegatVfLQ839Lmprd5zosXGwRUBJHwj66X").unwrap();
|
||||
|
||||
let (ipfs, fut): (Ipfs<TestTypes>, _) =
|
||||
UninitializedIpfs::default().await.start().await.unwrap();
|
||||
task::spawn(fut);
|
||||
|
||||
let f1 = ipfs.get_dag(path.sub_path("0").unwrap());
|
||||
let f2 = ipfs.get_dag(path.sub_path("1").unwrap());
|
||||
let (res1, res2) = join!(f1, f2);
|
||||
println!("Received block with contents: {:?}", res1.unwrap());
|
||||
println!("Received block with contents: {:?}", res2.unwrap());
|
||||
|
||||
ipfs.exit_daemon().await;
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user