Restore api flags
License: MIT Signed-off-by: Jakub Sztandera <kubuxu@protocol.ai>
This commit is contained in:
@@ -14,6 +14,7 @@ import (
|
||||
"github.com/libp2p/go-libp2p-peerstore/pstoremem"
|
||||
pubsub "github.com/libp2p/go-libp2p-pubsub"
|
||||
record "github.com/libp2p/go-libp2p-record"
|
||||
"github.com/multiformats/go-multiaddr"
|
||||
"go.uber.org/fx"
|
||||
"golang.org/x/xerrors"
|
||||
|
||||
@@ -284,6 +285,14 @@ func ConfigCommon(cfg *config.Common) Option {
|
||||
return Options(
|
||||
func(s *Settings) error { s.Config = true; return nil },
|
||||
|
||||
Override(SetApiEndpointKey, func(lr repo.LockedRepo) error {
|
||||
apima, err := multiaddr.NewMultiaddr(cfg.API.ListenAddress)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
return lr.SetAPIEndpoint(apima)
|
||||
}),
|
||||
|
||||
ApplyIf(func(s *Settings) bool { return s.Online },
|
||||
Override(StartListeningKey, lp2p.StartListening(cfg.Libp2p.ListenAddresses)),
|
||||
|
||||
|
||||
+3
-1
@@ -75,13 +75,15 @@ func DefaultFullNode() *FullNode {
|
||||
}
|
||||
|
||||
func DefaultStorageMiner() *StorageMiner {
|
||||
return &StorageMiner{
|
||||
cfg := &StorageMiner{
|
||||
Common: defCommon(),
|
||||
|
||||
SectorBuilder: SectorBuilder{
|
||||
WorkerCount: 5,
|
||||
},
|
||||
}
|
||||
cfg.Common.API.ListenAddress = "/ip6/::1/tcp/2345/http"
|
||||
return cfg
|
||||
}
|
||||
|
||||
var _ encoding.TextMarshaler = (*Duration)(nil)
|
||||
|
||||
Reference in New Issue
Block a user