Commit 42ef377a authored by hannahhoward's avatar hannahhoward

docs(README): remove ipldbridge reference

Remove ipldbridge reference from README & Architecture -- was already supposed to be saved
parent f22ce026
......@@ -41,7 +41,6 @@ If your existing library (i.e. `go-ipfs` or `go-filecoin`) uses these other olde
import (
graphsync "github.com/ipfs/go-graphsync/impl"
gsnet "github.com/ipfs/go-graphsync/network"
gsbridge "github.com/ipfs/go-graphsync/ipldbridge"
ipld "github.com/ipld/go-ipld-prime"
)
......@@ -51,8 +50,7 @@ var loader ipld.Loader
var storer ipld.Storer
network := gsnet.NewFromLibp2pHost(host)
ipldBridge := gsbridge.NewIPLDBridge()
exchange := graphsync.New(ctx, network, ipldBridge, loader, storer)
exchange := graphsync.New(ctx, network, loader, storer)
```
Parameter Notes:
......@@ -60,9 +58,8 @@ Parameter Notes:
1. `context` is just the parent context for all of GraphSync
2. `network` is a network abstraction provided to Graphsync on top
of libp2p. This allows graphsync to be tested without the actual network
3. `ipldBridge` is an IPLD abstraction provided to Graphsync on top of go-ipld-prime. This makes the graphsync library testable in isolation
4. `loader` is used to load blocks from content ids from the local block store. It's used when RESPONDING to requests from other clients. It should conform to the IPLD loader interface: https://github.com/ipld/go-ipld-prime/blob/master/linking.go
5. `storer` is used to store incoming blocks to the local block store. It's used when REQUESTING a graphsync query, to store blocks locally once they are validated as part of the correct response. It should conform to the IPLD storer interface: https://github.com/ipld/go-ipld-prime/blob/master/linking.go
3. `loader` is used to load blocks from content ids from the local block store. It's used when RESPONDING to requests from other clients. It should conform to the IPLD loader interface: https://github.com/ipld/go-ipld-prime/blob/master/linking.go
4. `storer` is used to store incoming blocks to the local block store. It's used when REQUESTING a graphsync query, to store blocks locally once they are validated as part of the correct response. It should conform to the IPLD storer interface: https://github.com/ipld/go-ipld-prime/blob/master/linking.go
### Using GraphSync With An IPFS BlockStore
......@@ -73,8 +70,7 @@ integrating with BlockStore's from IPFS.
import (
graphsync "github.com/ipfs/go-graphsync/impl"
gsnet "github.com/ipfs/go-graphsync/network"
gsbridge "github.com/ipfs/go-graphsync/ipldbridge"
gsbridge "github.com/ipfs/go-graphsync/storeutil"
storeutil "github.com/ipfs/go-graphsync/storeutil"
ipld "github.com/ipld/go-ipld-prime"
blockstore "github.com/ipfs/go-ipfs-blockstore"
)
......@@ -82,14 +78,12 @@ import (
var ctx context.Context
var host libp2p.Host
var bs blockstore.Blockstore
var storer ipld.Storer
network := gsnet.NewFromLibp2pHost(host)
ipldBridge := gsbridge.NewIPLDBridge()
loader := storeutil.LoaderForBlockstore(bs)
storer := storeutil.StorerForBlockstore(bs)
exchange := graphsync.New(ctx, network, ipldBridge, loader, storer)
exchange := graphsync.New(ctx, network, loader, storer)
```
### Write A Loader An IPFS BlockStore
......
......@@ -28,9 +28,7 @@ go-graphsync also depends on the following external dependencies:
1. A network implementation, which provides basic functions for sending and receiving messages on a network.
2. A bridge interface to `go-ipld-prime`, the library used to interact with IPLD data structures and perform selector queries.
3. A local blockstore implementation, expressed by a `loader` function and a `storer` function.
2. A local blockstore implementation, expressed by a `loader` function and a `storer` function.
## Request Lifecycle
......@@ -93,10 +91,6 @@ The remaining sections of this document outline internal workings of major graph
The network implementation needs to provide basic lower level utilities for sending and receiving messages. A default implementation using `libp2p` is included in the package, and a mock version is provided for testing.
### Bridge To IPLD
Rather than interact with `go-ipld-prime` directly, `go-graphsync` makes calls via a bridge interface provided as a dependency. During the initial development of `go-graphsync`, key components of `go-ipld-prime` were not finished or changing rapidly. The bridge provides a way to keep the interfaces somewhat stable from `go-graphsyncs` standpoint, and a mechanism to provide a mock version of go-ipld-prime for testing. This allowed `go-graphsync` to be written at the same time as `go-ipld-prime`. As `go-ipld-prime` stabilizes, it might make sense to remove this interface, though it is still useful for test isolation. The library provides a default bridge as well as a mock bridge.
### Local Blockstore Implementation
Interacting with a local blockstore is expressed by a `loader` function and a `storer` function. The `loader` function takes an IPLD Link and returns an `io.Reader` for corresponding block data, while the `storer` takes a Link and returns a `io.Writer` to write corresponding block data, plus a commit function to call when the data is ready to transfer to permanent storage.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment