diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index d6bc025f0a53e73944c74d36b7533457d6b7a772..6e0cebd2111bb28823a32ac21956a1051c3aa9d5 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -15,6 +15,8 @@ jobs: steps: - name: Check out code into the Go module directory uses: actions/checkout@v2 + - name: Copy config.default.json to config.json + run: cp config.default.json config.json - name: Release GoShimmer run: goreleaser --rm-dist env: diff --git a/.gitignore b/.gitignore index b376e693d4a49e941472f91450d7dc7937651069..87725e6da2f14d20435f3bf9504e84bd09dd6903 100644 --- a/.gitignore +++ b/.gitignore @@ -26,4 +26,6 @@ objectsdb/ # OSX related files .DS_Store shimmer -goshimmer \ No newline at end of file +goshimmer + +config.json \ No newline at end of file diff --git a/README.md b/README.md index 413e2183f36dad56efd6166d5c90b69dd090a25a..d59e024d8e61a84e87dcd8c65678a07513b21412 100644 --- a/README.md +++ b/README.md @@ -148,7 +148,16 @@ If Go is installed, you should see the version that's installed. 2. Change into the `goshimmer` directory -3. Use one of the following commands to build your executable file, depending on your operating system +3. Copy and adjust `config.default.json` + + ```bash + # Linux and macOS + cp config.default.json config.json + # Windows + copy config.default.json config.json + ``` + +4. Use one of the following commands to build your executable file, depending on your operating system ```bash # Linux and macOS diff --git a/config.json b/config.default.json similarity index 100% rename from config.json rename to config.default.json diff --git a/main.go b/main.go index d8238b11190c49df9954e5c274bf769276f84ea3..7876622f2a945737628fd99a9b42f509e528d3c3 100644 --- a/main.go +++ b/main.go @@ -4,25 +4,11 @@ import ( "net/http" _ "net/http/pprof" - "github.com/iotaledger/goshimmer/plugins/analysis" - "github.com/iotaledger/goshimmer/plugins/autopeering" - "github.com/iotaledger/goshimmer/plugins/banner" - "github.com/iotaledger/goshimmer/plugins/cli" + "github.com/iotaledger/goshimmer/pluginmgr/core" + "github.com/iotaledger/goshimmer/pluginmgr/research" + "github.com/iotaledger/goshimmer/pluginmgr/ui" + "github.com/iotaledger/goshimmer/pluginmgr/webapi" "github.com/iotaledger/goshimmer/plugins/config" - "github.com/iotaledger/goshimmer/plugins/gossip" - "github.com/iotaledger/goshimmer/plugins/gracefulshutdown" - "github.com/iotaledger/goshimmer/plugins/logger" - "github.com/iotaledger/goshimmer/plugins/metrics" - "github.com/iotaledger/goshimmer/plugins/portcheck" - "github.com/iotaledger/goshimmer/plugins/remotelog" - "github.com/iotaledger/goshimmer/plugins/spa" - "github.com/iotaledger/goshimmer/plugins/tangle" - "github.com/iotaledger/goshimmer/plugins/webapi" - webapi_broadcastData "github.com/iotaledger/goshimmer/plugins/webapi/broadcastData" - webapi_gtta "github.com/iotaledger/goshimmer/plugins/webapi/gtta" - webapi_spammer "github.com/iotaledger/goshimmer/plugins/webapi/spammer" - webapi_auth "github.com/iotaledger/goshimmer/plugins/webauth" - "github.com/iotaledger/hive.go/node" ) @@ -30,38 +16,9 @@ func main() { go http.ListenAndServe("localhost:6061", nil) // pprof Server for Debbuging Mutexes node.Run( - node.Plugins( - banner.PLUGIN, - config.PLUGIN, - logger.PLUGIN, - cli.PLUGIN, - remotelog.PLUGIN, - portcheck.PLUGIN, - - autopeering.PLUGIN, - tangle.PLUGIN, - gossip.PLUGIN, - gracefulshutdown.PLUGIN, - - analysis.PLUGIN, - metrics.PLUGIN, - - webapi.PLUGIN, - webapi_auth.PLUGIN, - webapi_gtta.PLUGIN, - webapi_spammer.PLUGIN, - webapi_broadcastData.PLUGIN, - - spa.PLUGIN, - - /* - webapi_getTransactionTrytesByHash.PLUGIN, - webapi_getTransactionObjectsByHash.PLUGIN, - webapi_findTransactionHashes.PLUGIN, - webapi_getNeighbors.PLUGIN, - - //graph.PLUGIN, - */ - ), + core.PLUGINS, + research.PLUGINS, + ui.PLUGINS, + webapi.PLUGINS, ) } diff --git a/pluginmgr/core/plugins.go b/pluginmgr/core/plugins.go new file mode 100644 index 0000000000000000000000000000000000000000..6f4a510081dbf04160e1441f60b5522b706cba58 --- /dev/null +++ b/pluginmgr/core/plugins.go @@ -0,0 +1,28 @@ +package core + +import ( + "github.com/iotaledger/goshimmer/plugins/autopeering" + "github.com/iotaledger/goshimmer/plugins/banner" + "github.com/iotaledger/goshimmer/plugins/cli" + "github.com/iotaledger/goshimmer/plugins/config" + "github.com/iotaledger/goshimmer/plugins/gossip" + "github.com/iotaledger/goshimmer/plugins/gracefulshutdown" + "github.com/iotaledger/goshimmer/plugins/logger" + "github.com/iotaledger/goshimmer/plugins/metrics" + "github.com/iotaledger/goshimmer/plugins/portcheck" + "github.com/iotaledger/goshimmer/plugins/tangle" + "github.com/iotaledger/hive.go/node" +) + +var PLUGINS = node.Plugins( + banner.PLUGIN, + config.PLUGIN, + logger.PLUGIN, + cli.PLUGIN, + portcheck.PLUGIN, + autopeering.PLUGIN, + tangle.PLUGIN, + gossip.PLUGIN, + gracefulshutdown.PLUGIN, + metrics.PLUGIN, +) diff --git a/pluginmgr/research/plugins.go b/pluginmgr/research/plugins.go new file mode 100644 index 0000000000000000000000000000000000000000..04b591c975f7734ace327b2a4c4d66545e34643d --- /dev/null +++ b/pluginmgr/research/plugins.go @@ -0,0 +1,12 @@ +package research + +import ( + "github.com/iotaledger/goshimmer/plugins/analysis" + "github.com/iotaledger/goshimmer/plugins/remotelog" + "github.com/iotaledger/hive.go/node" +) + +var PLUGINS = node.Plugins( + remotelog.PLUGIN, + analysis.PLUGIN, +) diff --git a/pluginmgr/ui/plugins.go b/pluginmgr/ui/plugins.go new file mode 100644 index 0000000000000000000000000000000000000000..ddc66b11b3ce2b00a49a67095e6176dd9d3e2e68 --- /dev/null +++ b/pluginmgr/ui/plugins.go @@ -0,0 +1,12 @@ +package ui + +import ( + "github.com/iotaledger/goshimmer/plugins/graph" + "github.com/iotaledger/goshimmer/plugins/spa" + "github.com/iotaledger/hive.go/node" +) + +var PLUGINS = node.Plugins( + spa.PLUGIN, + graph.PLUGIN, +) diff --git a/pluginmgr/webapi/plugins.go b/pluginmgr/webapi/plugins.go new file mode 100644 index 0000000000000000000000000000000000000000..0caf419e0e971fb37836105f2e7d1678fa9cd281 --- /dev/null +++ b/pluginmgr/webapi/plugins.go @@ -0,0 +1,26 @@ +package webapi + +import ( + "github.com/iotaledger/goshimmer/plugins/webapi" + "github.com/iotaledger/goshimmer/plugins/webapi/broadcastData" + "github.com/iotaledger/goshimmer/plugins/webapi/findTransactionHashes" + "github.com/iotaledger/goshimmer/plugins/webapi/getNeighbors" + "github.com/iotaledger/goshimmer/plugins/webapi/getTransactionObjectsByHash" + "github.com/iotaledger/goshimmer/plugins/webapi/getTransactionTrytesByHash" + "github.com/iotaledger/goshimmer/plugins/webapi/gtta" + "github.com/iotaledger/goshimmer/plugins/webapi/spammer" + "github.com/iotaledger/goshimmer/plugins/webauth" + "github.com/iotaledger/hive.go/node" +) + +var PLUGINS = node.Plugins( + webapi.PLUGIN, + webauth.PLUGIN, + gtta.PLUGIN, + spammer.PLUGIN, + broadcastData.PLUGIN, + getTransactionTrytesByHash.PLUGIN, + getTransactionObjectsByHash.PLUGIN, + findTransactionHashes.PLUGIN, + getNeighbors.PLUGIN, +)