Select Git revision
Hans Moog
authored and
GitHub
committed
* Feat: started to merge changes * Refactor: moved parameter package to be a plugin (same with logger) * Feat: first compiling version of new ontologoies merge * Feat: ported additional plugins * Feat: transaction get solid now * Refactor: reverted some previous changes from debugging * Feat: added a banner module for the cli interface * Feat: added a plugin for the port checks * Feat: fixed some bugs * Refactor: reverted some changes * Feat: reworked TransactionParser to use Errors * Feat: TransactionParser uses Peer * Feat: started to rework broadCastData webapi call * Feat: refactored some plugins * Fix: fixed test of tangle * Refactor: changed tangle package in graph plugin * Refactor: uncommented broken code * Fix: fixed broken method signature in gossip test * Feat: started adding value tangle * Feat: adjusted to new hive.go * Feat: upgraded hive.go * Clean up PortCheck plugin and make it standalone #259 (#271) Co-authored-by:Hans Moog <hm@mkjc.net> Co-authored-by:
Jonas Theis <mail@jonastheis.de>
plugin.go 790 B
package cli
import (
"fmt"
"os"
"github.com/iotaledger/hive.go/events"
"github.com/iotaledger/hive.go/node"
flag "github.com/spf13/pflag"
"github.com/iotaledger/goshimmer/plugins/banner"
)
var PLUGIN = node.NewPlugin("CLI", node.Enabled)
var version = flag.BoolP("version", "v", false, "Prints the GoShimmer version")
func init() {
for name, status := range node.GetPlugins() {
onAddPlugin(name, status)
}
node.Events.AddPlugin.Attach(events.NewClosure(onAddPlugin))
flag.Usage = printUsage
PLUGIN.Events.Init.Attach(events.NewClosure(onInit))
}
func onAddPlugin(name string, status int) {
AddPluginStatus(node.GetPluginIdentifier(name), status)
}
func onInit(*node.Plugin) {
if *version {
fmt.Println(banner.AppName + " " + banner.AppVersion)
os.Exit(0)
}
}