Commit dde6ad49 authored by Brian Tiger Chow's avatar Brian Tiger Chow

todo(blockservice, core) add notes

* to wrap datastore for ease of use
* to pass a non-responsive bitswap mock rather than performing nil
* checks internally
parent b17bc2d5
......@@ -35,6 +35,8 @@ func (s *BlockService) AddBlock(b *blocks.Block) (u.Key, error) {
k := b.Key()
dsk := ds.NewKey(string(k))
u.DOut("storing [%s] in datastore\n", k.Pretty())
// TODO(brian): define a block datastore with a Put method which accepts a
// block parameter
err := s.Datastore.Put(dsk, b.Data)
if err != nil {
return k, err
......
......@@ -105,6 +105,8 @@ func NewIpfsNode(cfg *config.Config, online bool) (*IpfsNode, error) {
go initConnections(cfg, route)
}
// TODO(brian): when offline instantiate the BlockService with a bitswap
// session that simply doesn't return blocks
bs, err := bserv.NewBlockService(d, bitswapSession)
if err != nil {
return nil, err
......
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