lotus/chain/store/splitstore/snoop.go

27 lines
608 B
Go
Raw Normal View History

2020-11-26 14:53:16 +00:00
package splitstore
import (
"path/filepath"
2020-11-26 14:53:16 +00:00
"github.com/filecoin-project/go-state-types/abi"
cid "github.com/ipfs/go-cid"
2020-11-26 14:53:16 +00:00
)
type TrackingStore interface {
Put(cid.Cid, abi.ChainEpoch) error
PutBatch([]cid.Cid, abi.ChainEpoch) error
Get(cid.Cid) (abi.ChainEpoch, error)
Delete(cid.Cid) error
ForEach(func(cid.Cid, abi.ChainEpoch) error) error
2021-02-27 16:16:09 +00:00
Sync() error
2020-11-26 18:37:02 +00:00
Close() error
}
func NewTrackingStore(path string, useLMDB bool) (TrackingStore, error) {
if useLMDB {
return NewLMDBTrackingStore(filepath.Join(path, "snoop.lmdb"))
}
2021-02-27 11:35:57 +00:00
return NewBoltTrackingStore(filepath.Join(path, "snoop.bolt"))
}