Skip to content
Snippets Groups Projects
Select Git revision
  • a7d01012bcefddeabe873bbeca3c1219ce72cd06
  • without_tipselection default
  • develop protected
  • fix/grafana-local-dashboard
  • wasp
  • fix/dashboard-explorer-freeze
  • master
  • feat/timerqueue
  • test/sync_debug_and_650
  • feat/sync_revamp_inv
  • wip/sync
  • tool/db-recovery
  • portcheck/fix
  • fix/synchronization
  • feat/new-dashboard-analysis
  • feat/refactored-analysis-dashboard
  • feat/new-analysis-dashboard
  • test/demo-prometheus-fpc
  • prometheus_metrics
  • wip/analysis-server
  • merge/fpc-test-value-transfer
  • v0.2.2
  • v0.2.1
  • v0.2.0
  • v0.1.3
  • v0.1.2
  • v0.1.1
  • v0.1.0
28 results

tipselection.go

Blame
  • plugin.go 2.96 KiB
    package info
    
    import (
    	"net/http"
    	"sort"
    	goSync "sync"
    
    	"gitlab.imt-atlantique.fr/i18colle/goshimmer_without_tipselection/plugins/autopeering/local"
    	"gitlab.imt-atlantique.fr/i18colle/goshimmer_without_tipselection/plugins/banner"
    	"gitlab.imt-atlantique.fr/i18colle/goshimmer_without_tipselection/plugins/sync"
    	"gitlab.imt-atlantique.fr/i18colle/goshimmer_without_tipselection/plugins/webapi"
    	"github.com/iotaledger/hive.go/node"
    	"github.com/labstack/echo"
    )
    
    // PluginName is the name of the web API info endpoint plugin.
    const PluginName = "WebAPI info Endpoint"
    
    var (
    	// plugin is the plugin instance of the web API info endpoint plugin.
    	plugin *node.Plugin
    	once   goSync.Once
    )
    
    // Plugin gets the plugin instance.
    func Plugin() *node.Plugin {
    	once.Do(func() {
    		plugin = node.NewPlugin(PluginName, node.Enabled, configure)
    	})
    	return plugin
    }
    
    func configure(_ *node.Plugin) {
    	webapi.Server().GET("info", getInfo)
    }
    
    // getInfo returns the info of the node
    // e.g.,
    // {
    // 	"version":"v0.2.0",
    //  "synchronized": true,
    // 	"identityID":"5bf4aa1d6c47e4ce",
    // 	"publickey":"CjUsn86jpFHWnSCx3NhWfU4Lk16mDdy1Hr7ERSTv3xn9",
    // 	"enabledplugins":[
    // 		"Config",
    // 		"Autopeering",
    // 		"Analysis",
    // 		"WebAPI data Endpoint",
    // 		"WebAPI dRNG Endpoint",
    // 		"MessageLayer",
    // 		"CLI",
    // 		"Database",
    // 		"DRNG",
    // 		"WebAPI autopeering Endpoint",
    // 		"Metrics",
    // 		"PortCheck",
    // 		"Dashboard",
    // 		"WebAPI",
    // 		"WebAPI info Endpoint",
    // 		"WebAPI message Endpoint",
    // 		"Banner",
    // 		"Gossip",
    // 		"Graceful Shutdown",
    // 		"Logger"
    // 	],
    // 	"disabledplugins":[
    // 		"RemoteLog",
    // 		"Spammer",
    // 		"WebAPI Auth"
    // 	]