@cryptotaxi247 / kubo / commits / dde6ad495

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

Brian Tiger Chow committed Sep 15, 2014 at 04:24 UTC dde6ad495eede8de77fdbe67a0e75226b3322c19
2 files changed +4
blockservice/blockservice.go
+2
@@ -35,6 +35,8 @@ func (s *BlockService) AddBlock(b *blocks.Block) (u.Key, error) {
35 k := b.Key()
36 dsk := ds.NewKey(string(k))
37 u.DOut("storing [%s] in datastore\n", k.Pretty())
38 + // TODO(brian): define a block datastore with a Put method which accepts a
39 + // block parameter
40 err := s.Datastore.Put(dsk, b.Data)
41 if err != nil {
42 return k, err
core/core.go
+2
@@ -105,6 +105,8 @@ func NewIpfsNode(cfg *config.Config, online bool) (*IpfsNode, error) {
105 go initConnections(cfg, route)
106 }
107
108 + // TODO(brian): when offline instantiate the BlockService with a bitswap
109 + // session that simply doesn't return blocks
110 bs, err := bserv.NewBlockService(d, bitswapSession)
111 if err != nil {
112 return nil, err