@@ -43,7 +43,7 @@ Here is a basic example of how to set up `iroh-docs` with `iroh`:
4343
4444``` rust
4545use iroh :: {protocol :: Router , Endpoint };
46- use iroh_blobs :: {net_protocol :: Blobs , util :: local_pool :: LocalPool , ALPN as BLOBS_ALPN };
46+ use iroh_blobs :: {net_protocol :: Blobs , store :: mem :: MemStore , ALPN as BLOBS_ALPN };
4747use iroh_docs :: {protocol :: Docs , ALPN as DOCS_ALPN };
4848use iroh_gossip :: {net :: Gossip , ALPN as GOSSIP_ALPN };
4949
@@ -53,23 +53,25 @@ async fn main() -> anyhow::Result<()> {
5353 // we've built at number0
5454 let endpoint = Endpoint :: builder (). discovery_n0 (). bind (). await ? ;
5555
56- // create a router builder, we will add the
57- // protocols to this builder and then spawn
58- // the router
59- let builder = Router :: builder (endpoint );
60-
6156 // build the blobs protocol
62- let blobs = Blobs :: memory () . build ( builder . endpoint () );
57+ let blobs = MemStore :: default ( );
6358
6459 // build the gossip protocol
65- let gossip = Gossip :: builder (). spawn (builder . endpoint () . clone ()). await ? ;
60+ let gossip = Gossip :: builder (). spawn (endpoint . clone ());
6661
6762 // build the docs protocol
68- let docs = Docs :: memory (). spawn (& blobs , & gossip ). await ? ;
63+ let docs = Docs :: memory ()
64+ . spawn (endpoint . clone (), (* blobs ). clone (), gossip . clone ())
65+ . await ? ;
66+
67+ // create a router builder, we will add the
68+ // protocols to this builder and then spawn
69+ // the router
70+ let builder = Router :: builder (endpoint . clone ());
6971
7072 // setup router
71- let router = builder
72- . accept (BLOBS_ALPN , blobs )
73+ let _router = builder
74+ . accept (BLOBS_ALPN , Blobs :: new ( & blobs , endpoint . clone (), None ) )
7375 . accept (GOSSIP_ALPN , gossip )
7476 . accept (DOCS_ALPN , docs )
7577 . spawn ();
0 commit comments