@@ -15,12 +15,22 @@ rust-version = "1.76"
15
15
[dependencies ]
16
16
anyhow = { version = " 1" }
17
17
async-channel = " 2.3.1"
18
- bao-tree = { version = " 0.13" , features = [" tokio_fsm" , " validate" ], default-features = false }
18
+ bao-tree = { version = " 0.13" , features = [
19
+ " tokio_fsm" ,
20
+ " validate" ,
21
+ ], default-features = false }
19
22
bytes = { version = " 1.7" , features = [" serde" ] }
20
23
chrono = " 0.4.31"
21
24
clap = { version = " 4.5.20" , features = [" derive" ], optional = true }
22
- console = { version = " 0.15.8" , optional = true }
23
- derive_more = { version = " 1.0.0" , features = [" debug" , " display" , " deref" , " deref_mut" , " from" , " try_into" , " into" ] }
25
+ derive_more = { version = " 1.0.0" , features = [
26
+ " debug" ,
27
+ " display" ,
28
+ " deref" ,
29
+ " deref_mut" ,
30
+ " from" ,
31
+ " try_into" ,
32
+ " into" ,
33
+ ] }
24
34
futures-buffered = " 0.2.4"
25
35
futures-lite = " 2.3"
26
36
futures-util = { version = " 0.3.30" , optional = true }
@@ -38,14 +48,18 @@ num_cpus = "1.15.0"
38
48
oneshot = " 0.1.8"
39
49
parking_lot = { version = " 0.12.1" , optional = true }
40
50
portable-atomic = { version = " 1" , optional = true }
41
- postcard = { version = " 1" , default-features = false , features = [" alloc" , " use-std" , " experimental-derive" ] }
51
+ postcard = { version = " 1" , default-features = false , features = [
52
+ " alloc" ,
53
+ " use-std" ,
54
+ " experimental-derive" ,
55
+ ] }
42
56
quic-rpc = { version = " 0.15.1" , optional = true }
43
57
quic-rpc-derive = { version = " 0.15.0" , optional = true }
44
58
quinn = { package = " iroh-quinn" , version = " 0.12" , features = [" ring" ] }
45
59
rand = " 0.8"
46
60
range-collections = " 0.4.0"
47
61
redb = { version = " 2.2.0" , optional = true }
48
- redb_v1 = { package = " redb" , version = " 1.5.1" , optional = true }
62
+ redb_v1 = { package = " redb" , version = " 1.5.1" , optional = true }
49
63
ref-cast = { version = " 1.0.23" , optional = true }
50
64
reflink-copy = { version = " 0.1.8" , optional = true }
51
65
self_cell = " 1.0.1"
@@ -61,9 +75,14 @@ tracing = "0.1"
61
75
tracing-futures = " 0.2.5"
62
76
walkdir = { version = " 2.5.0" , optional = true }
63
77
78
+ # Examples
79
+ iroh = { version = " 0.28" , optional = true }
80
+ console = { version = " 0.15.8" , optional = true }
81
+
64
82
[dev-dependencies ]
65
83
http-body = " 1.0"
66
84
iroh-test = { version = " 0.28" }
85
+ iroh-net = { version = " 0.28" , features = [" test-utils" ] }
67
86
futures-buffered = " 0.2.4"
68
87
proptest = " 1.0.0"
69
88
serde_json = " 1.0.107"
@@ -78,14 +97,26 @@ futures-util = "0.3.30"
78
97
testdir = " 0.9.1"
79
98
80
99
[features ]
81
- default = [" fs-store" , " rpc" , " net_protocol" ]
100
+ default = [" fs-store" , " rpc" , " net_protocol" , " example-iroh " ]
82
101
downloader = [" dep:parking_lot" , " tokio-util/time" , " dep:hashlink" ]
83
102
net_protocol = [" downloader" ]
84
103
fs-store = [" dep:reflink-copy" , " redb" , " dep:redb_v1" , " dep:tempfile" ]
85
104
metrics = [" iroh-metrics/metrics" ]
86
105
redb = [" dep:redb" ]
87
106
cli = [" rpc" , " dep:clap" , " dep:indicatif" , " dep:console" ]
88
- rpc = [" dep:quic-rpc" , " dep:quic-rpc-derive" , " dep:nested_enum_utils" , " dep:strum" , " dep:futures-util" , " dep:ref-cast" , " dep:portable-atomic" , " dep:walkdir" , " downloader" ]
107
+ rpc = [
108
+ " dep:quic-rpc" ,
109
+ " dep:quic-rpc-derive" ,
110
+ " dep:nested_enum_utils" ,
111
+ " dep:strum" ,
112
+ " dep:futures-util" ,
113
+ " dep:ref-cast" ,
114
+ " dep:portable-atomic" ,
115
+ " dep:walkdir" ,
116
+ " downloader" ,
117
+ ]
118
+
119
+ example-iroh = [" dep:iroh" , " dep:clap" , " dep:indicatif" , " dep:console" ]
89
120
90
121
[package .metadata .docs .rs ]
91
122
all-features = true
@@ -100,6 +131,22 @@ name = "fetch-fsm"
100
131
[[example ]]
101
132
name = " fetch-stream"
102
133
134
+ [[example ]]
135
+ name = " hello-world-fetch"
136
+ required-features = [" example-iroh" ]
137
+
138
+ [[example ]]
139
+ name = " hello-world-provide"
140
+ required-features = [" example-iroh" ]
141
+
142
+ [[example ]]
143
+ name = " local-swarm-discovery"
144
+ required-features = [" example-iroh" ]
145
+
146
+ [[example ]]
147
+ name = " custom-protocol"
148
+ required-features = [" example-iroh" ]
149
+
103
150
[lints .rust ]
104
151
missing_debug_implementations = " warn"
105
152
@@ -134,4 +181,4 @@ iroh-router = { git = "https://github.com/n0-computer/iroh", branch = "main" }
134
181
iroh-net = { git = " https://github.com/n0-computer/iroh" , branch = " main" }
135
182
iroh-metrics = { git = " https://github.com/n0-computer/iroh" , branch = " main" }
136
183
iroh-base = { git = " https://github.com/n0-computer/iroh" , branch = " main" }
137
-
184
+ iroh = { git = " https://github.com/n0-computer/iroh " , branch = " main " }
0 commit comments