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:
@ -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
|
||||
|
Reference in New Issue
Block a user