Implement 'storage miner' module, wire up a few bits it needs to start

This commit is contained in:
whyrusleeping
2019-07-29 17:46:56 -07:00
parent 2576853426
commit ee224e5b21
14 changed files with 181 additions and 31 deletions
+9 -1
View File
@@ -1,6 +1,7 @@
package main
import (
"github.com/ipfs/go-datastore"
"github.com/libp2p/go-libp2p-core/peer"
"golang.org/x/xerrors"
"gopkg.in/urfave/cli.v2"
@@ -166,9 +167,16 @@ var initCmd = &cli.Command{
return err
}
// TODO: persist this address in the storage-miner repo
log.Infof("New storage miners address is: %s", addr)
ds, err := lr.Datastore("/metadata")
if err != nil {
return err
}
if err := ds.Put(datastore.NewKey("miner-address"), addr.Bytes()); err != nil {
return err
}
// TODO: Point to setting storage price, maybe do it interactively or something
log.Info("Storage miner successfully created, you can now start it with 'lotus-storage-miner run'")
+1
View File
@@ -74,6 +74,7 @@ var runCmd = &cli.Command{
return lr.SetAPIEndpoint(apima)
}),
node.Override(new(*sectorbuilder.SectorBuilderConfig), modules.SectorBuilderConfig(storageRepoPath)),
node.Override(new(api.FullNode), func() api.FullNode { return nodeApi }),
)
if err != nil {
return err