move splitstore implementation to its own directory
This commit is contained in:
parent
2c9b58aaec
commit
17bc5fcd85
@ -1,4 +1,4 @@
|
|||||||
package store
|
package splitstore
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
@ -10,9 +10,11 @@ import (
|
|||||||
blocks "github.com/ipfs/go-block-format"
|
blocks "github.com/ipfs/go-block-format"
|
||||||
cid "github.com/ipfs/go-cid"
|
cid "github.com/ipfs/go-cid"
|
||||||
dstore "github.com/ipfs/go-datastore"
|
dstore "github.com/ipfs/go-datastore"
|
||||||
|
logging "github.com/ipfs/go-log/v2"
|
||||||
|
|
||||||
"github.com/filecoin-project/go-state-types/abi"
|
"github.com/filecoin-project/go-state-types/abi"
|
||||||
"github.com/filecoin-project/lotus/build"
|
"github.com/filecoin-project/lotus/build"
|
||||||
|
"github.com/filecoin-project/lotus/chain/store"
|
||||||
"github.com/filecoin-project/lotus/chain/types"
|
"github.com/filecoin-project/lotus/chain/types"
|
||||||
bstore "github.com/filecoin-project/lotus/lib/blockstore"
|
bstore "github.com/filecoin-project/lotus/lib/blockstore"
|
||||||
)
|
)
|
||||||
@ -21,11 +23,13 @@ const CompactionThreshold = 5 * build.Finality
|
|||||||
|
|
||||||
var baseEpochKey = dstore.NewKey("baseEpoch")
|
var baseEpochKey = dstore.NewKey("baseEpoch")
|
||||||
|
|
||||||
|
var log = logging.Logger("splitstore")
|
||||||
|
|
||||||
type SplitStore struct {
|
type SplitStore struct {
|
||||||
baseEpoch abi.ChainEpoch
|
baseEpoch abi.ChainEpoch
|
||||||
curTs *types.TipSet
|
curTs *types.TipSet
|
||||||
|
|
||||||
cs *ChainStore
|
cs *store.ChainStore
|
||||||
ds dstore.Datastore
|
ds dstore.Datastore
|
||||||
|
|
||||||
hot bstore.Blockstore
|
hot bstore.Blockstore
|
||||||
@ -180,7 +184,7 @@ func (s *SplitStore) View(cid cid.Cid, cb func([]byte) error) error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// State tracking
|
// State tracking
|
||||||
func (s *SplitStore) Start(cs *ChainStore) error {
|
func (s *SplitStore) Start(cs *store.ChainStore) error {
|
||||||
s.cs = cs
|
s.cs = cs
|
||||||
s.curTs = cs.GetHeaviestTipSet()
|
s.curTs = cs.GetHeaviestTipSet()
|
||||||
|
|
Loading…
Reference in New Issue
Block a user