Skip to content

Commit

Permalink
working changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Shrenuj Bansal committed Aug 9, 2023
1 parent 864e821 commit 652ee04
Show file tree
Hide file tree
Showing 8 changed files with 208 additions and 147 deletions.
9 changes: 6 additions & 3 deletions cmd/lotus-miner/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ import (
"encoding/binary"
"encoding/json"
"fmt"
"github.com/filecoin-project/lotus/lib/harmony/harmonydb"
logging "github.com/ipfs/go-log/v2"
"net/http"
"os"
"path/filepath"
Expand All @@ -18,6 +16,7 @@ import (
"github.com/google/uuid"
"github.com/ipfs/go-datastore"
"github.com/ipfs/go-datastore/namespace"
logging "github.com/ipfs/go-log/v2"
"github.com/libp2p/go-libp2p/core/crypto"
"github.com/libp2p/go-libp2p/core/peer"
"github.com/mitchellh/go-homedir"
Expand Down Expand Up @@ -49,6 +48,7 @@ import (
"github.com/filecoin-project/lotus/genesis"
"github.com/filecoin-project/lotus/journal"
"github.com/filecoin-project/lotus/journal/fsjournal"
"github.com/filecoin-project/lotus/lib/harmony/harmonydb"
storageminer "github.com/filecoin-project/lotus/miner"
"github.com/filecoin-project/lotus/node/config"
"github.com/filecoin-project/lotus/node/modules"
Expand Down Expand Up @@ -468,7 +468,10 @@ func storageMinerInit(ctx context.Context, cctx *cli.Context, api v1api.FullNode
harmonyDB, err := harmonydb.New([]string{"127.0.0.1"}, "yugabyte", "yugabyte", "yugabyte", "5433", "",
func(s string) { logging.Logger("harmonydb").Error(s) })

si := paths.NewIndex(nil, harmonyDB)
// TODO: get this bool from miner init cmd line
enableSectorIndexDB := true

si := paths.NewIndexProxy(nil, harmonyDB, enableSectorIndexDB)

lstor, err := paths.NewLocal(ctx, lr, si, nil)
if err != nil {
Expand Down
4 changes: 4 additions & 0 deletions documentation/en/default-lotus-miner-config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,10 @@
# env var: LOTUS_SUBSYSTEMS_ENABLEMARKETS
#EnableMarkets = false

# type: bool
# env var: LOTUS_SUBSYSTEMS_ENABLESECTORINDEXDB
#EnableSectorIndexDB = false

# type: string
# env var: LOTUS_SUBSYSTEMS_SEALERAPIINFO
#SealerApiInfo = ""
Expand Down
1 change: 1 addition & 0 deletions itests/path_type_filters_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import (
)

func TestPathTypeFilters(t *testing.T) {

runTest := func(t *testing.T, name string, asserts func(t *testing.T, ctx context.Context, miner *kit.TestMiner, run func())) {
t.Run(name, func(t *testing.T) {
ctx, cancel := context.WithCancel(context.Background())
Expand Down
4 changes: 2 additions & 2 deletions node/builder_miner.go
Original file line number Diff line number Diff line change
Expand Up @@ -132,8 +132,8 @@ func ConfigStorageMiner(c interface{}) Option {

If(cfg.Subsystems.EnableSectorStorage,
// Sector storage
Override(new(*paths.Index), paths.NewIndex),
Override(new(paths.SectorIndex), From(new(*paths.Index))),
Override(new(*paths.IndexProxy), paths.NewIndexProxyHelper(true)),
Override(new(paths.SectorIndex), From(new(*paths.IndexProxy))),
Override(new(*sectorstorage.Manager), modules.SectorStorage),
Override(new(sectorstorage.Unsealer), From(new(*sectorstorage.Manager))),
Override(new(sectorstorage.SectorManager), From(new(*sectorstorage.Manager))),
Expand Down
1 change: 1 addition & 0 deletions node/config/def.go
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,7 @@ func DefaultStorageMiner() *StorageMiner {
EnableSealing: true,
EnableSectorStorage: true,
EnableMarkets: false,
EnableSectorIndexDB: false,
},

Fees: MinerFeeConfig{
Expand Down
6 changes: 6 additions & 0 deletions node/config/doc_gen.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions node/config/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ type MinerSubsystemConfig struct {
EnableSealing bool
EnableSectorStorage bool
EnableMarkets bool
EnableSectorIndexDB bool

SealerApiInfo string // if EnableSealing == false
SectorIndexApiInfo string // if EnableSectorStorage == false
Expand Down
Loading

0 comments on commit 652ee04

Please sign in to comment.