only init plugins if doing internal ipfs interface

This commit is contained in:
Ian Norden 2020-05-01 10:47:55 -05:00
parent c250235714
commit 1413533a04
2 changed files with 9 additions and 4 deletions

View File

@ -19,6 +19,7 @@ import (
log "github.com/sirupsen/logrus"
"github.com/spf13/cobra"
"github.com/spf13/viper"
"github.com/vulcanize/vulcanizedb/pkg/super_node/shared"
"github.com/vulcanize/vulcanizedb/pkg/ipfs"
"github.com/vulcanize/vulcanizedb/pkg/super_node/resync"
@ -45,8 +46,10 @@ func rsyncCmdCommand() {
logWithCommand.Fatal(err)
}
logWithCommand.Infof("resync config: %+v", rConfig)
if err := ipfs.InitIPFSPlugins(); err != nil {
logWithCommand.Fatal(err)
if rConfig.IPFSMode == shared.LocalInterface {
if err := ipfs.InitIPFSPlugins(); err != nil {
logWithCommand.Fatal(err)
}
}
logWithCommand.Debug("initializing new resync service")
rService, err := resync.NewResyncService(rConfig)

View File

@ -59,8 +59,10 @@ func superNode() {
logWithCommand.Fatal(err)
}
logWithCommand.Infof("super node config: %+v", superNodeConfig)
if err := ipfs.InitIPFSPlugins(); err != nil {
logWithCommand.Fatal(err)
if superNodeConfig.IPFSMode == shared.LocalInterface {
if err := ipfs.InitIPFSPlugins(); err != nil {
logWithCommand.Fatal(err)
}
}
wg := &sync.WaitGroup{}
logWithCommand.Debug("initializing new super node service")