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)),
|
||||
|
||||
|
||||
Reference in New Issue
Block a user