1
0
mirror of https://github.com/ipfs/kubo.git synced 2025-06-28 17:03:58 +08:00

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
This commit is contained in:
Brian Tiger Chow
2014-09-15 04:24:03 -07:00
parent b17bc2d54c
commit dde6ad495e
2 changed files with 4 additions and 0 deletions

View File

@ -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

View File

@ -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