@@ -66,42 +66,10 @@ You will then find the binaries inside of the project root's `/target/debug` fol
66
66
_ Note: binaries available via ` cargo install ` is coming soon._
67
67
68
68
## Getting started
69
- ``` rust,no_run
70
- use tokio::task;
71
- use futures::join;
72
- use ipfs::{make_ipld, Ipfs, IpfsPath, Ipld, Types, UninitializedIpfs};
73
-
74
- #[tokio::main]
75
- async fn main() {
76
- tracing_subscriber::fmt::init();
77
-
78
- // Start daemon and initialize repo
79
- let (ipfs, fut): (Ipfs<Types>, _) = UninitializedIpfs::default().await.start().await.unwrap();
80
- task::spawn(fut);
81
-
82
- // Create a DAG
83
- let f1 = ipfs.put_dag(make_ipld!("block1"));
84
- let f2 = ipfs.put_dag(make_ipld!("block2"));
85
- let (res1, res2) = join!(f1, f2);
86
- let root = make_ipld!([res1.unwrap(), res2.unwrap()]);
87
- let cid = ipfs.put_dag(root).await.unwrap();
88
- let path = IpfsPath::from(cid);
89
-
90
- // Query the DAG
91
- let path1 = path.sub_path("0").unwrap();
92
- let path2 = path.sub_path("1").unwrap();
93
- let f1 = ipfs.get_dag(path1);
94
- let f2 = ipfs.get_dag(path2);
95
- let (res1, res2) = join!(f1, f2);
96
- println!("Received block with contents: {:?}", res1.unwrap());
97
- println!("Received block with contents: {:?}", res2.unwrap());
98
-
99
- // Exit
100
- ipfs.exit_daemon();
101
- }
102
- ```
103
69
104
- More usage examples coming soon :+1 :
70
+ We recommend to browse the [ examples] ( https://github.com/rs-ipfs/rust-ipfs/tree/master/examples ) and
71
+ [ tests] ( https://github.com/rs-ipfs/rust-ipfs/tree/master/tests ) in order to see how to use Rust-IPFS
72
+ in different scenarios.
105
73
106
74
## Roadmap
107
75
0 commit comments