diff --git a/packages/node/node.go b/packages/node/node.go index 9f86209f5e259cbe9e79f50efc6b057e56246eab..9ecb5776aa77541513b6014cc8aa60fe33f55faf 100644 --- a/packages/node/node.go +++ b/packages/node/node.go @@ -1,7 +1,6 @@ package node import ( - "strings" "sync" "github.com/iotaledger/goshimmer/packages/daemon" @@ -14,8 +13,9 @@ type Node struct { } var DisabledPlugins = make(map[string]bool) +var EnabledPlugins = make(map[string]bool) -func Load(plugins ...*Plugin) *Node { +func New(plugins ...*Plugin) *Node { node := &Node{ loggers: make([]*Logger, 0), wg: &sync.WaitGroup{}, @@ -23,20 +23,22 @@ func Load(plugins ...*Plugin) *Node { } node.AddLogger(DEFAULT_LOGGER) - node.Load(plugins...) + + // configure the enabled plugins + node.configure(plugins...) return node } func Start(plugins ...*Plugin) *Node { - node := Load(plugins...) + node := New(plugins...) node.Start() return node } func Run(plugins ...*Plugin) *Node { - node := Load(plugins...) + node := New(plugins...) node.Run() return node @@ -100,19 +102,33 @@ func (node *Node) LogFailure(pluginName string, message string) { } } -func (node *Node) Load(plugins ...*Plugin) { - if len(plugins) >= 1 { - for _, plugin := range plugins { - if _, exists := DisabledPlugins[strings.ToLower(strings.Replace(plugin.Name, " ", "", -1))]; !exists { - plugin.wg = node.wg - plugin.Node = node +func isDisabled(plugin *Plugin) bool { + _, exists := DisabledPlugins[GetPluginIdentifier(plugin.Name)] - plugin.Events.Configure.Trigger(plugin) + return exists +} - node.LogInfo("Node", "Loading Plugin: "+plugin.Name+" ... done") +func isEnabled(plugin *Plugin) bool { + _, exists := EnabledPlugins[GetPluginIdentifier(plugin.Name)] - node.loadedPlugins = append(node.loadedPlugins, plugin) - } + return exists +} + +func (node *Node) configure(plugins ...*Plugin) { + for _, plugin := range plugins { + status := plugin.Status + if (status == Enabled && !isDisabled(plugin)) || + (status == Disabled && isEnabled(plugin)) { + + plugin.wg = node.wg + plugin.Node = node + + plugin.Events.Configure.Trigger(plugin) + node.loadedPlugins = append(node.loadedPlugins, plugin) + + node.LogInfo("Node", "Loading Plugin: "+plugin.Name+" ... done") + } else { + node.LogInfo("Node", "Skipping Plugin: "+plugin.Name) } } } @@ -120,12 +136,10 @@ func (node *Node) Load(plugins ...*Plugin) { func (node *Node) Start() { node.LogInfo("Node", "Executing plugins ...") - if len(node.loadedPlugins) >= 1 { - for _, plugin := range node.loadedPlugins { - plugin.Events.Run.Trigger(plugin) + for _, plugin := range node.loadedPlugins { + plugin.Events.Run.Trigger(plugin) - node.LogSuccess("Node", "Starting Plugin: "+plugin.Name+" ... done") - } + node.LogSuccess("Node", "Starting Plugin: "+plugin.Name+" ... done") } node.LogSuccess("Node", "Starting background workers ...") @@ -136,12 +150,10 @@ func (node *Node) Start() { func (node *Node) Run() { node.LogInfo("Node", "Executing plugins ...") - if len(node.loadedPlugins) >= 1 { - for _, plugin := range node.loadedPlugins { - plugin.Events.Run.Trigger(plugin) + for _, plugin := range node.loadedPlugins { + plugin.Events.Run.Trigger(plugin) - node.LogSuccess("Node", "Starting Plugin: "+plugin.Name+" ... done") - } + node.LogSuccess("Node", "Starting Plugin: "+plugin.Name+" ... done") } node.LogSuccess("Node", "Starting background workers ...") diff --git a/packages/node/parameters.go b/packages/node/parameters.go index d94f31e901131a2f4bb3ddd7a6202ee691467244..ee244e3d1a91eff75854e8f3cd7abdaeab336e9d 100644 --- a/packages/node/parameters.go +++ b/packages/node/parameters.go @@ -3,6 +3,8 @@ package node import "github.com/iotaledger/goshimmer/packages/parameter" var ( - LOG_LEVEL = parameter.AddInt("NODE/LOG_LEVEL", LOG_LEVEL_INFO, "controls the log types that are shown") + LOG_LEVEL = parameter.AddInt("NODE/LOG_LEVEL", LOG_LEVEL_INFO, "controls the log types that are shown") + DISABLE_PLUGINS = parameter.AddString("NODE/DISABLE_PLUGINS", "", "a list of plugins that shall be disabled") + ENABLE_PLUGINS = parameter.AddString("NODE/ENABLE_PLUGINS", "", "a list of plugins that shall be enabled") ) diff --git a/packages/node/plugin.go b/packages/node/plugin.go index a98a22beff880d7b73b210c14e38f0f6730a1ce1..bb7efa8494c53492686f30877b9413398f33565f 100644 --- a/packages/node/plugin.go +++ b/packages/node/plugin.go @@ -1,27 +1,41 @@ package node import ( + "strings" "sync" "github.com/iotaledger/goshimmer/packages/events" + "github.com/iotaledger/goshimmer/packages/parameter" +) + +const ( + Disabled = iota + Enabled ) type Plugin struct { Node *Node Name string + Status int Events pluginEvents wg *sync.WaitGroup } -func NewPlugin(name string, callback Callback, callbacks ...Callback) *Plugin { +// Creates a new plugin with the given name, default status and callbacks. +// The last specified callback is the mandatory run callback, while all other callbacks are configure callbacks. +func NewPlugin(name string, status int, callback Callback, callbacks ...Callback) *Plugin { plugin := &Plugin{ - Name: name, + Name: name, + Status: status, Events: pluginEvents{ Configure: events.NewEvent(pluginCaller), Run: events.NewEvent(pluginCaller), }, } + // make the plugin known to the parameters + parameter.AddPlugin(name, status) + if len(callbacks) >= 1 { plugin.Events.Configure.Attach(events.NewClosure(callback)) for _, callback = range callbacks[:len(callbacks)-1] { @@ -36,6 +50,10 @@ func NewPlugin(name string, callback Callback, callbacks ...Callback) *Plugin { return plugin } +func GetPluginIdentifier(name string) string { + return strings.ToLower(strings.Replace(name, " ", "", -1)) +} + func (plugin *Plugin) LogSuccess(message string) { plugin.Node.LogSuccess(plugin.Name, message) } diff --git a/packages/parameter/events.go b/packages/parameter/events.go index ad91b734b30ca35dd8dbd169570e34f063cf96f1..b755a038485a09e01eb0c20ddd9ceaa2496dc7ab 100644 --- a/packages/parameter/events.go +++ b/packages/parameter/events.go @@ -8,10 +8,12 @@ var Events = struct { AddBool *events.Event AddInt *events.Event AddString *events.Event + AddPlugin *events.Event }{ AddBool: events.NewEvent(boolParameterCaller), AddInt: events.NewEvent(intParameterCaller), AddString: events.NewEvent(stringParameterCaller), + AddPlugin: events.NewEvent(pluginParameterCaller), } func boolParameterCaller(handler interface{}, params ...interface{}) { @@ -25,3 +27,7 @@ func intParameterCaller(handler interface{}, params ...interface{}) { func stringParameterCaller(handler interface{}, params ...interface{}) { handler.(func(*StringParameter))(params[0].(*StringParameter)) } + +func pluginParameterCaller(handler interface{}, params ...interface{}) { + handler.(func(string, int))(params[0].(string), params[1].(int)) +} diff --git a/packages/parameter/parameter.go b/packages/parameter/parameter.go index 2d1809149d1896818c58983910b14e35b4f6dd35..24e9117d815000c2c046b21e6b1e30f248291c9a 100644 --- a/packages/parameter/parameter.go +++ b/packages/parameter/parameter.go @@ -32,7 +32,7 @@ func GetBools() map[string]*BoolParameter { var intParameters = make(map[string]*IntParameter) func AddInt(name string, defaultValue int, description string) *IntParameter { - if intParameters[name] != nil { + if _, exists := intParameters[name]; exists { panic("duplicate parameter - \"" + name + "\" was defined already") } @@ -61,7 +61,7 @@ func GetInts() map[string]*IntParameter { var stringParameters = make(map[string]*StringParameter) func AddString(name string, defaultValue string, description string) *StringParameter { - if stringParameters[name] != nil { + if _, exists := stringParameters[name]; exists { panic("duplicate parameter - \"" + name + "\" was defined already") } @@ -86,3 +86,19 @@ func GetString(name string) *StringParameter { func GetStrings() map[string]*StringParameter { return stringParameters } + +var plugins = make(map[string]int) + +func AddPlugin(name string, status int) { + if _, exists := plugins[name]; exists { + panic("duplicate plugin - \"" + name + "\" was defined already") + } + + plugins[name] = status + + Events.AddPlugin.Trigger(name, status) +} + +func GetPlugins() map[string]int { + return plugins +} diff --git a/plugins/analysis/plugin.go b/plugins/analysis/plugin.go index ee40ed44c39499b3336a428f390b1d21b58d9cea..44268dd0c077025e796cea7df2c859ef74f78061 100644 --- a/plugins/analysis/plugin.go +++ b/plugins/analysis/plugin.go @@ -9,7 +9,7 @@ import ( "github.com/iotaledger/goshimmer/plugins/analysis/webinterface" ) -var PLUGIN = node.NewPlugin("Analysis", configure, run) +var PLUGIN = node.NewPlugin("Analysis", node.Enabled, configure, run) func configure(plugin *node.Plugin) { if *server.SERVER_PORT.Value != 0 { diff --git a/plugins/autopeering/plugin.go b/plugins/autopeering/plugin.go index c8633bffc4f2d02e21afd16fdc113e90be347bcc..9cac751d8815b488f2523e7141d4c0e35b0aecea 100644 --- a/plugins/autopeering/plugin.go +++ b/plugins/autopeering/plugin.go @@ -16,7 +16,7 @@ import ( "github.com/iotaledger/goshimmer/plugins/gossip" ) -var PLUGIN = node.NewPlugin("Auto Peering", configure, run) +var PLUGIN = node.NewPlugin("Auto Peering", node.Enabled, configure, run) func configure(plugin *node.Plugin) { saltmanager.Configure(plugin) diff --git a/plugins/bundleprocessor/plugin.go b/plugins/bundleprocessor/plugin.go index 02303b751f4007b8bfd24f7b8e4f3237cfa8e23a..db1e1c28cfac3fd8d13041466e6081c6b9e8ed8f 100644 --- a/plugins/bundleprocessor/plugin.go +++ b/plugins/bundleprocessor/plugin.go @@ -9,7 +9,7 @@ import ( "github.com/iotaledger/goshimmer/plugins/tangle" ) -var PLUGIN = node.NewPlugin("Bundle Processor", configure, run) +var PLUGIN = node.NewPlugin("Bundle Processor", node.Enabled, configure, run) func configure(plugin *node.Plugin) { tangle.Events.TransactionSolid.Attach(events.NewClosure(func(tx *value_transaction.ValueTransaction) { diff --git a/plugins/cli/cli.go b/plugins/cli/cli.go index dc898c984705fab9b0934a1bc1bf3d2e0e71e7f0..73aa4f190443766000142900e852467c354d20a6 100644 --- a/plugins/cli/cli.go +++ b/plugins/cli/cli.go @@ -5,6 +5,10 @@ import ( "fmt" "os" "path/filepath" + "sort" + "strings" + + "github.com/iotaledger/goshimmer/packages/node" ) func AddBoolParameter(p *bool, name string, usage string) { @@ -19,20 +23,36 @@ func AddStringParameter(p *string, name string, usage string) { flag.StringVar(p, name, *p, usage) } +var enabledPlugins []string +var disabledPlugins []string + +func AddPluginStatus(name string, status int) { + switch status { + case node.Enabled: + enabledPlugins = append(enabledPlugins, name) + case node.Disabled: + disabledPlugins = append(disabledPlugins, name) + } +} + +func getList(a []string) string { + sort.Strings(a) + return strings.Join(a, " ") +} + func printUsage() { - _, err := fmt.Fprintf( + fmt.Fprintf( os.Stderr, "\n"+ - "SHIMMER 1.0\n\n"+ + "SHIMMER\n\n"+ " A lightweight modular IOTA node.\n\n"+ "Usage:\n\n"+ " %s [OPTIONS]\n\n"+ - "Options:\n\n", + "Options:\n", filepath.Base(os.Args[0]), ) - if err != nil { - panic(err) - } - flag.PrintDefaults() + + fmt.Fprintf(os.Stderr, "\nThe following plugins are enabled by default and can be disabled with -%s:\n %s\n", getFlagName(node.DISABLE_PLUGINS.Name), getList(enabledPlugins)) + fmt.Fprintf(os.Stderr, "The following plugins are disabled by default and can be enabled with -%s:\n %s\n\n", getFlagName(node.ENABLE_PLUGINS.Name), getList(disabledPlugins)) } diff --git a/plugins/cli/plugin.go b/plugins/cli/plugin.go index 4e98e5154bcdb9258fb3b1d236797dd5c5f14159..ae97189d4520992e2d66e16eda5569afc1533042 100644 --- a/plugins/cli/plugin.go +++ b/plugins/cli/plugin.go @@ -10,50 +10,61 @@ import ( "github.com/iotaledger/goshimmer/packages/parameter" ) -func onAddBoolParameter(param *parameter.BoolParameter) { - flagName := strings.Replace(strings.Replace(strings.ToLower(param.Name), "/", "-", 1), "_", "-", -1) +func getFlagName(paramName string) string { + return strings.Replace(strings.Replace(strings.ToLower(paramName), "/", "-", 1), "_", "-", -1) +} - AddBoolParameter(param.Value, flagName, param.Description) +func onAddBoolParameter(param *parameter.BoolParameter) { + AddBoolParameter(param.Value, getFlagName(param.Name), param.Description) } func onAddIntParameter(param *parameter.IntParameter) { - flagName := strings.Replace(strings.Replace(strings.ToLower(param.Name), "/", "-", 1), "_", "-", -1) - - AddIntParameter(param.Value, flagName, param.Description) + AddIntParameter(param.Value, getFlagName(param.Name), param.Description) } func onAddStringParameter(param *parameter.StringParameter) { - flagName := strings.Replace(strings.Replace(strings.ToLower(param.Name), "/", "-", 1), "_", "-", -1) + AddStringParameter(param.Value, getFlagName(param.Name), param.Description) +} - AddStringParameter(param.Value, flagName, param.Description) +func onAddPlugin(name string, status int) { + AddPluginStatus(node.GetPluginIdentifier(name), status) } func init() { for _, param := range parameter.GetBools() { onAddBoolParameter(param) } - for _, param := range parameter.GetInts() { onAddIntParameter(param) } - for _, param := range parameter.GetStrings() { onAddStringParameter(param) } + for name, status := range parameter.GetPlugins() { + onAddPlugin(name, status) + } parameter.Events.AddBool.Attach(events.NewClosure(onAddBoolParameter)) parameter.Events.AddInt.Attach(events.NewClosure(onAddIntParameter)) parameter.Events.AddString.Attach(events.NewClosure(onAddStringParameter)) + parameter.Events.AddPlugin.Attach(events.NewClosure(onAddPlugin)) flag.Usage = printUsage } +func parseParameters() { + for _, pluginName := range strings.Fields(*node.DISABLE_PLUGINS.Value) { + node.DisabledPlugins[strings.ToLower(pluginName)] = true + } + for _, pluginName := range strings.Fields(*node.ENABLE_PLUGINS.Value) { + node.EnabledPlugins[strings.ToLower(pluginName)] = true + } +} + func configure(ctx *node.Plugin) { flag.Parse() - for _, disabledPlugin := range strings.Fields(*node.DISABLE_PLUGINS.Value) { - node.DisabledPlugins[strings.ToLower(disabledPlugin)] = true - } + parseParameters() fmt.Println(" _____ _ _ ________ ______ ___ ___________ ") fmt.Println(" / ___| | | |_ _| \\/ || \\/ || ___| ___ \\") @@ -66,6 +77,8 @@ func configure(ctx *node.Plugin) { ctx.Node.LogInfo("Node", "Loading plugins ...") } -var PLUGIN = node.NewPlugin("CLI", configure, func(plugin *node.Plugin) { +func run(ctx *node.Plugin) { + // do nothing; everything is handled in the configure step +} -}) +var PLUGIN = node.NewPlugin("CLI", node.Enabled, configure, run) diff --git a/plugins/dashboard/plugin.go b/plugins/dashboard/plugin.go index 98006c88ff47ca50a0fa67a30c1737302d520ff2..a292f80a9b21463a33e9afa21cecb68f7ef10ee6 100644 --- a/plugins/dashboard/plugin.go +++ b/plugins/dashboard/plugin.go @@ -1,10 +1,11 @@ package dashboard import ( - "golang.org/x/net/context" "net/http" "time" + "golang.org/x/net/context" + "github.com/iotaledger/goshimmer/packages/daemon" "github.com/iotaledger/goshimmer/packages/events" "github.com/iotaledger/goshimmer/packages/node" @@ -13,9 +14,9 @@ import ( var server *http.Server -var router *http.ServeMux +var router *http.ServeMux -var PLUGIN = node.NewPlugin("Dashboard", configure, run) +var PLUGIN = node.NewPlugin("Dashboard", node.Disabled, configure, run) func configure(plugin *node.Plugin) { router = http.NewServeMux() diff --git a/plugins/gossip-on-solidification/plugin.go b/plugins/gossip-on-solidification/plugin.go index 1c2268007bd1336b3643f294d3572953c38fa60a..bd040b9cae5b56a314cef22ab7c144b0c28d291a 100644 --- a/plugins/gossip-on-solidification/plugin.go +++ b/plugins/gossip-on-solidification/plugin.go @@ -8,7 +8,7 @@ import ( "github.com/iotaledger/goshimmer/plugins/tangle" ) -var PLUGIN = node.NewPlugin("Gossip On Solidification", func(plugin *node.Plugin) { +var PLUGIN = node.NewPlugin("Gossip On Solidification", node.Enabled, func(plugin *node.Plugin) { tangle.Events.TransactionSolid.Attach(events.NewClosure(func(tx *value_transaction.ValueTransaction) { gossip.SendTransaction(tx.MetaTransaction) })) diff --git a/plugins/gossip/plugin.go b/plugins/gossip/plugin.go index 0f02bd1404f577c1d265e239493aeec712e97ead..872e3caca32014e06be5a740e65461936973c06d 100644 --- a/plugins/gossip/plugin.go +++ b/plugins/gossip/plugin.go @@ -4,7 +4,7 @@ import ( "github.com/iotaledger/goshimmer/packages/node" ) -var PLUGIN = node.NewPlugin("Gossip", configure, run) +var PLUGIN = node.NewPlugin("Gossip", node.Enabled, configure, run) func configure(plugin *node.Plugin) { configureNeighbors(plugin) diff --git a/plugins/gracefulshutdown/plugin.go b/plugins/gracefulshutdown/plugin.go index ee3a074c18f7b7d078be19689b70c8192994977f..41da78c2495d915078c2029854fe527c8957c45e 100644 --- a/plugins/gracefulshutdown/plugin.go +++ b/plugins/gracefulshutdown/plugin.go @@ -15,7 +15,7 @@ import ( // maximum amount of time to wait for background processes to terminate. After that the process is killed. const WAIT_TO_KILL_TIME_IN_SECONDS = 10 -var PLUGIN = node.NewPlugin("Graceful Shutdown", func(plugin *node.Plugin) { +var PLUGIN = node.NewPlugin("Graceful Shutdown", node.Enabled, func(plugin *node.Plugin) { gracefulStop := make(chan os.Signal) signal.Notify(gracefulStop, syscall.SIGTERM) diff --git a/plugins/metrics/plugin.go b/plugins/metrics/plugin.go index bcc9310e0715c9b1ef02bdd1e64972bac1533208..290b548fee32bb014b3bcd80e8b03a7f03f8ef7c 100644 --- a/plugins/metrics/plugin.go +++ b/plugins/metrics/plugin.go @@ -11,7 +11,7 @@ import ( "github.com/iotaledger/goshimmer/plugins/gossip" ) -var PLUGIN = node.NewPlugin("Metrics", configure, run) +var PLUGIN = node.NewPlugin("Metrics", node.Enabled, configure, run) func configure(plugin *node.Plugin) { // increase received TPS counter whenever we receive a new transaction diff --git a/plugins/statusscreen-tps/plugin.go b/plugins/statusscreen-tps/plugin.go index 9b73392c93acbe5d71a52a9ab6b3b3339cd83a3a..e91121a15859989755e4e35667e166d3acc498ef 100644 --- a/plugins/statusscreen-tps/plugin.go +++ b/plugins/statusscreen-tps/plugin.go @@ -23,7 +23,7 @@ var receivedTps uint64 var solidTps uint64 -var PLUGIN = node.NewPlugin("Statusscreen TPS", func(plugin *node.Plugin) { +var PLUGIN = node.NewPlugin("Statusscreen TPS", node.Enabled, func(plugin *node.Plugin) { gossip.Events.ReceiveTransaction.Attach(events.NewClosure(func(_ *meta_transaction.MetaTransaction) { atomic.AddUint64(&receivedTpsCounter, 1) })) diff --git a/plugins/statusscreen/statusscreen.go b/plugins/statusscreen/statusscreen.go index 362cf37ea3863777837493cab56e6c53b7138bd3..13c8a283d2767c991624d12a0d228680546acfae 100644 --- a/plugins/statusscreen/statusscreen.go +++ b/plugins/statusscreen/statusscreen.go @@ -142,4 +142,4 @@ func run(plugin *node.Plugin) { }) } -var PLUGIN = node.NewPlugin("Status Screen", configure, run) +var PLUGIN = node.NewPlugin("Status Screen", node.Enabled, configure, run) diff --git a/plugins/tangle/plugin.go b/plugins/tangle/plugin.go index db5d513513b885a1e6c1a6d939c00e3bd751607d..f1efc83ac545aceb16670a933757104d83d3278a 100644 --- a/plugins/tangle/plugin.go +++ b/plugins/tangle/plugin.go @@ -6,7 +6,7 @@ import ( // region plugin module setup ////////////////////////////////////////////////////////////////////////////////////////// -var PLUGIN = node.NewPlugin("Tangle", configure, run) +var PLUGIN = node.NewPlugin("Tangle", node.Enabled, configure, run) func configure(plugin *node.Plugin) { configureTransactionDatabase(plugin) diff --git a/plugins/tipselection/plugin.go b/plugins/tipselection/plugin.go index 7980a59557a1db7c66006c1ebd8a1e582a6d9016..745c1dad4c8e2ecb8178fd2fc84c405a22357989 100644 --- a/plugins/tipselection/plugin.go +++ b/plugins/tipselection/plugin.go @@ -7,7 +7,7 @@ import ( "github.com/iotaledger/goshimmer/plugins/tangle" ) -var PLUGIN = node.NewPlugin("Tipselection", configure, run) +var PLUGIN = node.NewPlugin("Tipselection", node.Enabled, configure, run) func configure(node *node.Plugin) { tangle.Events.TransactionSolid.Attach(events.NewClosure(func(transaction *value_transaction.ValueTransaction) { diff --git a/plugins/validator/plugin.go b/plugins/validator/plugin.go index dce2129b6d57b502f65a8f1621149ce8fa7e7119..10e80653233b88f608c2dce6ac59ad163ba50420 100644 --- a/plugins/validator/plugin.go +++ b/plugins/validator/plugin.go @@ -13,7 +13,7 @@ import ( . "github.com/iotaledger/iota.go/trinary" ) -var PLUGIN = node.NewPlugin("Validator", configure, run) +var PLUGIN = node.NewPlugin("Validator", node.Enabled, configure, run) // Creates bundle signature fragments and the corresponding address to validate against. // Each signature fragment after the first must go into its own meta transaction with value = 0. diff --git a/plugins/webapi-gtta/plugin.go b/plugins/webapi-gtta/plugin.go index 0ebad67343e0fcc402ce8e82f50fc71fdbf0ec39..73ee6f22f248d84a2caba7dcc69ee33e530bb5e9 100644 --- a/plugins/webapi-gtta/plugin.go +++ b/plugins/webapi-gtta/plugin.go @@ -11,7 +11,7 @@ import ( "github.com/labstack/echo" ) -var PLUGIN = node.NewPlugin("WebAPI GTTA Endpoint", func(plugin *node.Plugin) { +var PLUGIN = node.NewPlugin("WebAPI GTTA Endpoint", node.Enabled, func(plugin *node.Plugin) { webapi.AddEndpoint("getTransactionsToApprove", Handler) }) diff --git a/plugins/webapi-spammer/plugin.go b/plugins/webapi-spammer/plugin.go index 4823ac75ce19225b142c4029003848be1bf0a307..e40b962d6b10faa75f38952a14fa6cf9d9ab5c0f 100644 --- a/plugins/webapi-spammer/plugin.go +++ b/plugins/webapi-spammer/plugin.go @@ -10,7 +10,7 @@ import ( "github.com/labstack/echo" ) -var PLUGIN = node.NewPlugin("Spammer", configure) +var PLUGIN = node.NewPlugin("Spammer", node.Disabled, configure) func configure(plugin *node.Plugin) { webapi.AddEndpoint("spammer", WebApiHandler) diff --git a/plugins/webapi/plugin.go b/plugins/webapi/plugin.go index f19c9e47b2a991a354a4cb05422b06a62b0996ba..f9de1de526423c6871d8ad02a3be310f485ecee6 100644 --- a/plugins/webapi/plugin.go +++ b/plugins/webapi/plugin.go @@ -10,7 +10,7 @@ import ( "github.com/labstack/echo" ) -var PLUGIN = node.NewPlugin("WebAPI", configure, run) +var PLUGIN = node.NewPlugin("WebAPI", node.Enabled, configure, run) var Server = echo.New() diff --git a/plugins/zeromq/plugin.go b/plugins/zeromq/plugin.go index 1b7e38af503c813ef397549098f9024964e2262e..a94a0ce9311853756f8be07b07ac7b221eec9215 100644 --- a/plugins/zeromq/plugin.go +++ b/plugins/zeromq/plugin.go @@ -12,7 +12,8 @@ import ( "github.com/iotaledger/goshimmer/plugins/tangle" ) -var PLUGIN = node.NewPlugin("ZeroMQ", configure, run) +// zeromq logging is disabled by default +var PLUGIN = node.NewPlugin("ZeroMQ", node.Disabled, configure, run) var publisher *Publisher var emptyTag = strings.Repeat("9", 27)