Newer
Older
package analysis
import (
"github.com/iotaledger/hive.go/logger"
"github.com/iotaledger/hive.go/node"
"github.com/iotaledger/goshimmer/plugins/analysis/client"
"github.com/iotaledger/goshimmer/plugins/analysis/server"
"github.com/iotaledger/goshimmer/plugins/analysis/webinterface"
var pluginName = "Analysis"
// Plugin defines the analysis plugin.
var Plugin = node.NewPlugin(pluginName, node.Enabled, configure, run)
func configure(plugin *node.Plugin) {
if config.Node.GetInt(server.CfgServerPort) != 0 {
webinterface.Configure(plugin)
server.Configure(plugin)
}
}
func run(plugin *node.Plugin) {
if config.Node.GetInt(server.CfgServerPort) != 0 {
webinterface.Run(plugin)
server.Run(plugin)
} else {
log.Info("Server is disabled (server-port is 0)")
if config.Node.GetString(client.CfgServerAddress) != "" {
log.Info("Client is disabled (server-address is empty)")