This repository has been archived by the owner on Sep 22, 2022. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 2
/
index.html
250 lines (224 loc) · 8.67 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
<!doctype html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Rust IPFS</title> <meta name="description" content="The performance and efficiency of Rust, and the decentralized power of IPFS, together at last." />
<meta name="image" content="https://raw.githubusercontent.com/rs-ipfs/rustipfs.com/master/img/open-graph-preview.png">
<!-- Schema.org for Google -->
<meta itemprop="name" content="Rust IPFS">
<meta itemprop="description" content="The performance and efficiency of Rust, and the decentralized power of IPFS, together at last.">
<meta itemprop="image" content="https://raw.githubusercontent.com/rs-ipfs/rustipfs.com/master/img/open-graph-preview.png">
<!-- Twitter -->
<meta name="twitter:card" content="summary">
<meta name="twitter:title" content="Rust IPFS">
<meta name="twitter:description" content="The performance and efficiency of Rust, and the decentralized power of IPFS, together at last.">
<meta name="twitter:image:src" content="https://raw.githubusercontent.com/rs-ipfs/rustipfs.com/master/img/twitter-preview.png">
<!-- Open Graph general (Facebook, Pinterest & Google+) -->
<meta name="og:title" content="Rust IPFS">
<meta name="og:description" content="The performance and efficiency of Rust, and the decentralized power of IPFS, together at last.">
<meta name="og:image" content="https://raw.githubusercontent.com/rs-ipfs/rustipfs.com/master/img/open-graph-preview.png">
<meta name="og:url" content="https://rustipfs.com">
<meta name="og:site_name" content="Rust IPFS">
<meta name="og:locale" content="en_US">
<meta name="og:type" content="website">
<link rel="stylesheet" href="./styles.css" />
<link rel="stylesheet" href="./vendor/enlighterjs-3.0.0/enlighterjs.min.css" />
</head>
<body>
<div id="values">
<div class="value1">--value1</div>
<div class="value2">--value2</div>
<div class="value3">--value3</div>
<div class="value4">--value4</div>
<div class="value5">--value5</div>
<div class="value6">--value6</div>
<div class="accent1">--accent1</div>
<div class="accent2">--accent2</div>
<div class="accent3">--accent3</div>
<div class="accent4">--accent4</div>
<div class="accent5">--accent5</div>
<div class="accent6">--accent6</div>
<div class="logo1">--logo1</div>
<div class="logo2">--logo2</div>
<div class="logo3">--logo3</div>
<div class="logo4">--logo4</div>
<div class="logo5">--logo5</div>
<div class="logo6">--logo6</div>
</div>
<header>
<div>
<h1>
<a aria-label="home" href="#">
<img alt="Rust IPFS Logo" src="./img/rust-ipfs-logo-64w.png" />
<span>Rust IPFS</span>
</a>
</h1>
<nav>
<a target="_blank" href="https://docs.rs/ipfs">Documentation</a>
<a target="_blank" href="https://github.com/rs-ipfs/rust-ipfs">GitHub</a>
</nav>
</div>
</header>
<section id="hero">
<h2>
The performance and efficiency of <em>Rust</em>,
and the decentralized power of <em>IPFS</em>.
</h2>
<h2>Together at last.</h2>
<div class="cta">
<a class="primary" href="#getting-started">Get Started</a>
</div>
</section>
<section id="features">
<div>
<div>
<h3>UnixFS Support</h3>
<img src="./img/unixfs.svg" alt="UnixFS" />
<p>
Easily encode your content and add, get, and
cat to your heart's content
</p>
</div>
<div>
<h3>Global Swarming</h3>
<img src="./img/global-swarming.svg" alt="Swarming" />
<p>
Connect to the global IPFS network and discover content
via bootstrap peers
</p>
</div>
<div>
<h3>Canonical HTTP APIs</h3>
<img src="./img/http-apis.svg" alt="HTTP APIs" />
<p>
If your application already uses the IPFS
HTTP APIs, you can easily switch to Rust IPFS
</p>
</div>
</div>
</section>
<section id="getting-started">
<h2>Getting Started</h2>
<p>
First, add <code>ipfs</code> and <code>tokio</code>
to your <strong>Cargo.toml</strong> file:
</p>
<pre data-enlighter-language="toml">
[dependencies]
ipfs = { git = "https://github.com/rs-ipfs/rust-ipfs" }
tokio = { version = "1", features = ["full"] }
tokio-stream = "0.1"
</pre>
<p>Then, in your <strong>src/main.rs</strong>:</p>
<pre data-enlighter-language="rust">
use ipfs::{Ipfs, IpfsOptions, IpfsPath, TestTypes, UninitializedIpfs};
use std::process::exit;
use tokio::io::AsyncWriteExt;
use tokio_stream::StreamExt;
#[tokio::main]
async fn main() {
// Initialize an in-memory repo and start a daemon.
let opts = IpfsOptions::inmemory_with_generated_keys();
let (ipfs, fut): (Ipfs<TestTypes>, _) = UninitializedIpfs::new(opts).start().await.unwrap();
// Spawn the background task
tokio::task::spawn(fut);
// Restore the default bootstrappers to enable content discovery
ipfs.restore_bootstrappers().await.unwrap();
// Get the IPFS README
let path = "/ipfs/QmQPeNsJPyVWPFDVHb77w8G42Fvo15z4bG2X8D2GhfbSXc/readme"
.parse::<IpfsPath>()
.unwrap();
let stream = ipfs.cat_unixfs(path, None).await.unwrap_or_else(|e| {
eprintln!("Error: {}", e);
exit(1);
});
tokio::pin!(stream);
let mut stdout = tokio::io::stdout();
loop {
match stream.next().await {
Some(Ok(bytes)) => {
stdout.write_all(&bytes).await.unwrap();
}
Some(Err(e)) => {
eprintln!("Error: {}", e);
exit(1);
}
None => break,
}
}
}
</pre>
<a class="top" href="#">▲</a>
</section>
<section id="further-reading">
<h2>Further Reading</h2>
<p>These are some extra resources to get you started with specific use-cases of Rust IPFS:</p>
<div>
<ul>
<li><a href="https://rs-ipfs.github.io/offchain-ipfs-manual/">The offchain::ipfs manual</a>: a project integrating IPFS and Substrate.</li>
<li><a href="https://github.com/rs-ipfs/rust-ipfs/tree/master/http#getting-started">The ipfs-http tutorial</a>: learn how to run and interact with an IPFS node via the HTTP API.</li>
</ul>
</div>
<a class="top" href="#">▲</a>
</section>
<!--
<section id="examples">
<h2>See it in action</h2>
<div>
<div class="card">
<img src="./img/IPFS-Substrate.png" alt="IPFS and Substrate Logos" />
<h3>Rust IPFS with Substrate</h3>
<a role="button" href="#">Learn More</a>
</div>
<div class="card">
<h3>Rust IPFS with OrbitDB</h3>
<a role="button" href="#">Learn More</a>
</div>
</div>
<a class="top" href="#">▲</a>
</section>
-->
<section id="support">
<h2>This project is supported by</h2>
<div class="logos">
<img src="./img/logo-vertical.png" alt="Equilibrium" />
<img src="./img/logo-protocol.png" alt="Protocol Labs" />
<img src="./img/logo-web3.png" alt="Web3 Foundation" />
</div>
<div>
<p>
Rust IPFS is supported by <a href="https://equilibrium.co">Equilibrium</a>,
<a href="https://protocol.ai">Protocol Labs</a>, the
<a href="https://web3.foundation">Web3 Foundation,</a> and YOU. If you find
this work useful, please consider becoming a financial contributor on
<a href="https://opencollective.com/rs-ipfs">OpenCollective</a>.
</p>
</div>
<a class="top" href="#">▲</a>
</section>
<footer>
<div>
<small>This website copyright © 2020 Equilibrium</small>
<small>
The Rust logo and wordmark are trademarks owned and protected by the Mozilla Foundation
</small>
</div>
<div>
<small>Rust IPFS is dual licensed under the MIT / Apache License</small>
<small>
The Rust and Cargo logos (bitmap and vector) are owned by Mozilla and distributed under
the terms of the Creative Commons Attribution license (CC-BY)
</small>
</div>
</footer>
<script src="./vendor/enlighterjs-3.0.0/enlighterjs.min.js"></script>
<script type="text/javascript">
EnlighterJS.init('pre', null, {
language : 'rust',
theme: 'droide',
indent : 4
});
</script>
</body>
</html>