From 3912694fb75ccab14c64af2a36a0b65b6c85e70b Mon Sep 17 00:00:00 2001 From: vyzo Date: Tue, 1 Dec 2020 17:47:14 +0200 Subject: [PATCH] fix lotus-shed build --- cmd/lotus-shed/balances.go | 27 +++++++++++++++++++++++++-- cmd/lotus-shed/export.go | 14 +++++++++++++- 2 files changed, 38 insertions(+), 3 deletions(-) diff --git a/cmd/lotus-shed/balances.go b/cmd/lotus-shed/balances.go index 8c5bfefb8..6a8551edf 100644 --- a/cmd/lotus-shed/balances.go +++ b/cmd/lotus-shed/balances.go @@ -36,6 +36,7 @@ import ( "github.com/filecoin-project/lotus/chain/state" "github.com/filecoin-project/lotus/chain/stmgr" "github.com/filecoin-project/lotus/chain/store" + "github.com/filecoin-project/lotus/chain/store/splitstore" "github.com/filecoin-project/lotus/chain/types" "github.com/filecoin-project/lotus/chain/vm" lcli "github.com/filecoin-project/lotus/cli" @@ -193,7 +194,18 @@ var chainBalanceStateCmd = &cli.Command{ return err } - cs := store.NewChainStore(bs, bs, mds, vm.Syscalls(ffiwrapper.ProofVerifier), nil) + ssPath, err := lkrepo.SplitstorePath() + if err != nil { + return err + } + + ss, err := splitstore.NewSplitStore(ssPath, mds, bs) + if err != nil { + return err + } + defer ss.Close() //nolint:errcheck + + cs := store.NewChainStore(ss, ss, mds, vm.Syscalls(ffiwrapper.ProofVerifier), nil) defer cs.Close() //nolint:errcheck cst := cbor.NewCborStore(bs) @@ -414,7 +426,18 @@ var chainPledgeCmd = &cli.Command{ return err } - cs := store.NewChainStore(bs, bs, mds, vm.Syscalls(ffiwrapper.ProofVerifier), nil) + ssPath, err := lkrepo.SplitstorePath() + if err != nil { + return err + } + + ss, err := splitstore.NewSplitStore(ssPath, mds, bs) + if err != nil { + return err + } + defer ss.Close() //nolint:errcheck + + cs := store.NewChainStore(ss, ss, mds, vm.Syscalls(ffiwrapper.ProofVerifier), nil) defer cs.Close() //nolint:errcheck cst := cbor.NewCborStore(bs) diff --git a/cmd/lotus-shed/export.go b/cmd/lotus-shed/export.go index e711ba2bb..7d1016e6c 100644 --- a/cmd/lotus-shed/export.go +++ b/cmd/lotus-shed/export.go @@ -12,6 +12,7 @@ import ( "github.com/filecoin-project/go-state-types/abi" "github.com/filecoin-project/lotus/chain/store" + "github.com/filecoin-project/lotus/chain/store/splitstore" "github.com/filecoin-project/lotus/chain/types" lcli "github.com/filecoin-project/lotus/cli" "github.com/filecoin-project/lotus/node/repo" @@ -90,7 +91,18 @@ var exportChainCmd = &cli.Command{ return err } - cs := store.NewChainStore(bs, bs, mds, nil, nil) + ssPath, err := lr.SplitstorePath() + if err != nil { + return err + } + + ss, err := splitstore.NewSplitStore(ssPath, mds, bs) + if err != nil { + return err + } + defer ss.Close() //nolint:errcheck + + cs := store.NewChainStore(ss, ss, mds, nil, nil) defer cs.Close() //nolint:errcheck if err := cs.Load(); err != nil {