diff --git a/go.mod b/go.mod index 8c7479825195518b45b4cd71441542db274fef44..5b3fb068ca1873b6abd2c8679ec45d1c6b94cbb4 100644 --- a/go.mod +++ b/go.mod @@ -11,7 +11,7 @@ require ( github.com/go-zeromq/zmq4 v0.7.0 github.com/golang/protobuf v1.3.2 github.com/gorilla/websocket v1.4.1 - github.com/iotaledger/hive.go v0.0.0-20191229233341-c3732738ee20 + github.com/iotaledger/hive.go v0.0.0-20200107010340-3674684388b3 github.com/iotaledger/iota.go v1.0.0-beta.13 github.com/labstack/echo v3.3.10+incompatible github.com/labstack/gommon v0.3.0 // indirect @@ -21,15 +21,13 @@ require ( github.com/mattn/go-isatty v0.0.11 // indirect github.com/mattn/go-runewidth v0.0.7 // indirect github.com/pelletier/go-toml v1.6.0 // indirect - github.com/petermattis/goid v0.0.0-20180202154549-b0b1615b78e5 // indirect github.com/pkg/errors v0.8.1 github.com/rivo/tview v0.0.0-20191229165609-1ee8d9874dcf - github.com/sasha-s/go-deadlock v0.2.0 // indirect github.com/spf13/afero v1.2.2 // indirect github.com/spf13/cast v1.3.1 // indirect github.com/spf13/jwalterweatherman v1.1.0 // indirect github.com/spf13/pflag v1.0.5 - github.com/spf13/viper v1.6.1 // indirect + github.com/spf13/viper v1.6.1 github.com/stretchr/objx v0.2.0 // indirect github.com/stretchr/testify v1.4.0 github.com/valyala/fasttemplate v1.1.0 // indirect diff --git a/go.sum b/go.sum index 1a6b6612f4b949afe38981a2678ca0747e33f86c..4d8c9d4c12eac9a4b6969804aed8aaf6c93ffe11 100644 --- a/go.sum +++ b/go.sum @@ -4,6 +4,7 @@ github.com/AndreasBriese/bbloom v0.0.0-20190825152654-46b345b51c96 h1:cTp8I5+VIo github.com/AndreasBriese/bbloom v0.0.0-20190825152654-46b345b51c96/go.mod h1:bOvUY6CB00SOBii9/FifXqc0awNKxLFCL/+pkDPuyl8= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/DATA-DOG/go-sqlmock v1.3.3/go.mod h1:f/Ixk793poVmq4qj/V1dPUg2JEAKC73Q5eFN3EC/SaM= +github.com/DataDog/zstd v1.4.1/go.mod h1:1jcaCB/ufaK+sKp1NBhlGmpz41jOoPQ35bpF36t7BBo= github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= @@ -24,7 +25,10 @@ github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSs github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/dgraph-io/badger v1.5.4/go.mod h1:VZxzAIRPHRVNRKRo6AXrX9BJegn6il06VMTZVJYCIjQ= +github.com/dgraph-io/badger v1.6.0 h1:DshxFxZWXUcO0xX476VJC07Xsr6ZCBVRHKZ93Oh7Evo= github.com/dgraph-io/badger v1.6.0/go.mod h1:zwt7syl517jmP8s94KqSxTlM6IMsdhYy6psNgSztDR4= +github.com/dgraph-io/badger/v2 v2.0.0/go.mod h1:YoRSIp1LmAJ7zH7tZwRvjNMUYLxB4wl3ebYkaIruZ04= +github.com/dgraph-io/ristretto v0.0.0-20191025175511-c1f00be0418e/go.mod h1:edzKIzGvqUCMzhTVWbiTSe75zD9Xxq0GtSBtFmaUTZs= github.com/dgrijalva/jwt-go v3.2.0+incompatible h1:7qlOGliEKZXTDg6OTjfoBKDXWrumCAMpl/TFQ4/5kLM= github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= github.com/dgryski/go-farm v0.0.0-20190323231341-8198c7b169ec/go.mod h1:SqUrOPUnsFjfmXRMNPybcSiG0BgUW2AuFH8PAnS2iTw= @@ -32,8 +36,11 @@ github.com/dgryski/go-farm v0.0.0-20190423205320-6a90982ecee2/go.mod h1:SqUrOPUn github.com/dgryski/go-farm v0.0.0-20191112170834-c2139c5d712b h1:SeiGBzKrEtuDddnBABHkp4kq9sBGE9nuYmk6FPTg0zg= github.com/dgryski/go-farm v0.0.0-20191112170834-c2139c5d712b/go.mod h1:SqUrOPUnsFjfmXRMNPybcSiG0BgUW2AuFH8PAnS2iTw= github.com/dgryski/go-sip13 v0.0.0-20181026042036-e10d5fee7954/go.mod h1:vAd38F8PWV+bWy6jNmig1y/TA+kYO4g3RSRF0IAv0no= +github.com/dustin/go-humanize v1.0.0 h1:VSnTsYCnlFHaM2/igO1h6X3HA71jcobQuxemgkq4zYo= github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= +github.com/fsnotify/fsnotify v1.4.7 h1:IXs+QLmnXW2CcXuY+8Mzv/fWEsPGWxqefPtCP5CnV9I= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= +github.com/gdamore/encoding v1.0.0 h1:+7OoQ1Bc6eTm5niUzBa0Ctsh6JbMW6Ra+YNuAtDBdko= github.com/gdamore/encoding v1.0.0/go.mod h1:alR0ol34c49FCSBLjhosxzcPHQbf2trDkoo5dl+VrEg= github.com/gdamore/tcell v1.3.0 h1:r35w0JBADPZCVQijYebl6YMWWtHRqVEGt7kL2eBADRM= github.com/gdamore/tcell v1.3.0/go.mod h1:Hjvr+Ofd+gLglo7RYKxxnzCBmev3BzsS67MebKS4zMM= @@ -53,6 +60,7 @@ github.com/golang/groupcache v0.0.0-20190129154638-5b532d6fd5ef/go.mod h1:cIg4er github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.3.2 h1:6nsPYzhq5kReh6QImI3k5qWzO4PEbvbIW2cwSfR/6xs= github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/snappy v0.0.1/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= @@ -69,12 +77,15 @@ github.com/grpc-ecosystem/go-grpc-middleware v1.0.0/go.mod h1:FiyG127CGDf3tlThmg github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk= github.com/grpc-ecosystem/grpc-gateway v1.9.0/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= github.com/h2non/parth v0.0.0-20190131123155-b4df798d6542/go.mod h1:Ow0tF8D4Kplbc8s8sSb3V2oUCygFHVp8gC3Dn6U4MNI= +github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4= github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= github.com/hpcloud/tail v1.0.0 h1:nfCOvKYfkgYP8hkirhJocXT2+zOD8yUNjXaWfTlyFKI= github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= github.com/iotaledger/hive.go v0.0.0-20191229233341-c3732738ee20 h1:ZIJAeQSEdmVbmZNIW2198IwD23+wBteb4WE4pyjxk+c= github.com/iotaledger/hive.go v0.0.0-20191229233341-c3732738ee20/go.mod h1:7iqun29a1x0lymTrn0UJ3Z/yy0sUzUpoOZ1OYMrYN20= +github.com/iotaledger/hive.go v0.0.0-20200107010340-3674684388b3 h1:Ognd+3Z0qhQz9LAAwKA6ma8nDiDfClEIsxrUfZnvmmU= +github.com/iotaledger/hive.go v0.0.0-20200107010340-3674684388b3/go.mod h1:vrZrvGaWT1o5kz3Jj2B/PcUtqsFzZnLWrO3zEsGSuwk= github.com/iotaledger/iota.go v1.0.0-beta.9/go.mod h1:F6WBmYd98mVjAmmPVYhnxg8NNIWCjjH8VWT9qvv3Rc8= github.com/iotaledger/iota.go v1.0.0-beta.13 h1:6m6JRcKtjTflU2PbjvDA9Tv6NTEJX1PijBDOkH9weQc= github.com/iotaledger/iota.go v1.0.0-beta.13/go.mod h1:F6WBmYd98mVjAmmPVYhnxg8NNIWCjjH8VWT9qvv3Rc8= @@ -91,6 +102,7 @@ github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORN github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= +github.com/labstack/echo v3.3.10+incompatible h1:pGRcYk231ExFAyoAjAfD85kQzRJCRI8bbnE7CX5OEgg= github.com/labstack/echo v3.3.10+incompatible/go.mod h1:0INS7j/VjnFxD4E2wkz67b8cVwCLbBmJyDaka6Cmk1s= github.com/labstack/gommon v0.3.0 h1:JEeO0bvc78PKdyHxloTKiF8BD5iGrH8T6MSeGvSgob0= github.com/labstack/gommon v0.3.0/go.mod h1:MULnywXg0yavhxWKc+lOruYdAhDwPK9wf0OL7NoOu+k= @@ -98,6 +110,7 @@ github.com/lucasb-eyer/go-colorful v1.0.2/go.mod h1:0MS4r+7BZKSJ5mw4/S5MPN+qHFF1 github.com/lucasb-eyer/go-colorful v1.0.3 h1:QIbQXiugsb+q10B+MI+7DI1oQLdmnep86tWFlaaUAac= github.com/lucasb-eyer/go-colorful v1.0.3/go.mod h1:R4dSotOR9KMtayYi1e77YzuveK+i7ruzyGqttikkLy0= github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= +github.com/magiconair/properties v1.8.1 h1:ZC2Vc7/ZFkGmsVC9KvOjumD+G5lXy2RtTKyzRKO2BQ4= github.com/magiconair/properties v1.8.1/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= github.com/mattn/go-colorable v0.1.2/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= github.com/mattn/go-colorable v0.1.4 h1:snbPLB8fVfU9iwbbo30TPtbLRzwWu6aJS6Xh4eaaviA= @@ -111,6 +124,7 @@ github.com/mattn/go-runewidth v0.0.7 h1:Ei8KR0497xHyKJPAv59M1dkC+rOZCMBJ+t3fZ+tw github.com/mattn/go-runewidth v0.0.7/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI= github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= +github.com/mitchellh/mapstructure v1.1.2 h1:fmNYVwqnSfB9mZU6OS2O6GsXM+wcskZDuKQzvN1EDeE= github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= github.com/nbio/st v0.0.0-20140626010706-e9e8d9816f32/go.mod h1:9wM+0iRr9ahx58uYLpLIr5fm8diHn0JbqRycJi6w0Ms= @@ -120,12 +134,14 @@ github.com/onsi/ginkgo v1.8.0 h1:VkHVNpR4iVnU8XQR6DBm8BqYjN7CRzw+xKUbVVbbW9w= github.com/onsi/ginkgo v1.8.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/gomega v1.5.0 h1:izbySO9zDPmjJ8rDjLvkA2zJHIo+HkYXHnf7eN7SSyo= github.com/onsi/gomega v1.5.0/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= +github.com/panjf2000/ants/v2 v2.2.2/go.mod h1:1GFm8bV8nyCQvU5K4WvBCTG1/YBFOD2VzjffD8fV55A= github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= github.com/pelletier/go-toml v1.6.0 h1:aetoXYr0Tv7xRU/V4B4IZJ2QcbtMUFoNb3ORp7TzIK4= github.com/pelletier/go-toml v1.6.0/go.mod h1:5N711Q9dKgbdkxHL+MEfF31hpT7l0S0s/t2kKREewys= github.com/petermattis/goid v0.0.0-20180202154549-b0b1615b78e5 h1:q2e307iGHPdTGp0hoxKjt1H5pDo6utceo3dQVK3I5XQ= github.com/petermattis/goid v0.0.0-20180202154549-b0b1615b78e5/go.mod h1:jvVRKCrJTQWu0XVbaOlby/2lO20uSCHEMzzplHXte1o= github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pkg/errors v0.8.1 h1:iURUrRGxPUNPdy5/HRSm+Yj6okJ6UtLINN0Q9M4+h3I= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= @@ -139,6 +155,7 @@ github.com/prometheus/procfs v0.0.0-20190507164030-5867b95ac084/go.mod h1:TjEm7z github.com/prometheus/tsdb v0.7.1/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40TwIPHuXU= github.com/rivo/tview v0.0.0-20191229165609-1ee8d9874dcf h1:rh73WIukDlFIRqk1lk76or+LExEjTci2789EDvDD67U= github.com/rivo/tview v0.0.0-20191229165609-1ee8d9874dcf/go.mod h1:/rBeY22VG2QprWnEqG57IBC8biVu3i0DOIjRLc9I8H0= +github.com/rivo/uniseg v0.1.0 h1:+2KBaVoUmb9XzDsrx/Ct0W/EYOSFf/nWTauy++DprtY= github.com/rivo/uniseg v0.1.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc= github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= @@ -153,13 +170,16 @@ github.com/smartystreets/goconvey v1.6.4 h1:fv0U8FUIMPNf1L9lnHLvLhgicrIVChEkdzIK github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= github.com/soheilhy/cmux v0.1.4/go.mod h1:IM3LyeVVIOuxMH7sFAkER9+bJ4dT7Ms6E4xg4kGIyLM= github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= +github.com/spaolacci/murmur3 v1.1.0/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ= +github.com/spf13/afero v1.2.2 h1:5jhuqJyZCZf2JRofRvN/nIFgIWNzPa3/Vz8mYylgbWc= github.com/spf13/afero v1.2.2/go.mod h1:9ZxEEn6pIJ8Rxe320qSDBk6AsU0r9pR7Q4OcevTdifk= github.com/spf13/cast v1.3.0/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= github.com/spf13/cast v1.3.1 h1:nFm6S0SMdyzrzcmThSipiEubIDy8WEXKNZ0UOgiRpng= github.com/spf13/cast v1.3.1/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= github.com/spf13/cobra v0.0.5/go.mod h1:3K3wKZymM7VvHMDS9+Akkh4K60UwM26emMESw8tLCHU= github.com/spf13/jwalterweatherman v1.0.0/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb68N+wFjFa4jdeBTo= +github.com/spf13/jwalterweatherman v1.1.0 h1:ue6voC5bR5F8YxI5S67j9i582FU4Qvo2bmqnqMYADFk= github.com/spf13/jwalterweatherman v1.1.0/go.mod h1:aNWZUN0dPAAO/Ljvb5BEdw96iTZ0EXowPYD95IqWIGo= github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= @@ -181,6 +201,7 @@ github.com/tidwall/pretty v1.0.0/go.mod h1:XNkn88O1ChpSDQmQeStsy+sBenx6DDtFZJxhV github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= github.com/ugorji/go v1.1.4/go.mod h1:uQMGLiO92mf5W77hV/PUCpI3pbzQx3CRekS0kk+RGrc= github.com/ugorji/go/codec v0.0.0-20181204163529-d75b2dcb6bc8/go.mod h1:VFNgLljTbGfSG7qAOspJ7OScBnGdDN/yBr0sguwnwf0= +github.com/valyala/bytebufferpool v1.0.0 h1:GqA5TC/0021Y/b9FG4Oi9Mr3q7XYx6KllzawFIhcdPw= github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc= github.com/valyala/fasttemplate v1.0.1/go.mod h1:UQGH1tvbgY+Nz5t2n7tXsz52dQxojPUpymEIMZ47gx8= github.com/valyala/fasttemplate v1.1.0 h1:RZqt0yGBsps8NGvLSGW804QQqCUYYLsaOjTVHy1Ocw4= @@ -254,6 +275,7 @@ golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20191228213918-04cbcbbfeed8 h1:JA8d3MPx/IToSyXZG/RhwYEtfrKO1Fxrqe8KrkiLXKM= golang.org/x/sys v0.0.0-20191228213918-04cbcbbfeed8/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/text v0.3.2 h1:tW2bmiBqwgJj/UpqtC8EpXEZVYOwU0yG4iWbprSVAcs= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= @@ -279,6 +301,7 @@ gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLks gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 h1:qIbj1fsPNlZgppZ+VLlY7N33q108Sa+fhmuc+sWQYwY= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= gopkg.in/fsnotify.v1 v1.4.7 h1:xOHLXZwVvI9hhs+cLKq5+I5onOuwQLhQwiu63xxlHs4= gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= diff --git a/main.go b/main.go index 1ac904adaed929fa0c2b779e2ffd175e328890cf..e55cd40dd668b0dac385eda2882f198b9939f6a3 100644 --- a/main.go +++ b/main.go @@ -1,6 +1,9 @@ package main import ( + "net/http" + _ "net/http/pprof" + "github.com/iotaledger/goshimmer/plugins/analysis" "github.com/iotaledger/goshimmer/plugins/autopeering" "github.com/iotaledger/goshimmer/plugins/bundleprocessor" @@ -25,29 +28,34 @@ import ( ) func main() { + + go http.ListenAndServe("localhost:6060", nil) // pprof Server for Debbuging Mutexes + node.Run( - cli.PLUGIN, - autopeering.PLUGIN, - gossip.PLUGIN, - tangle.PLUGIN, - bundleprocessor.PLUGIN, - analysis.PLUGIN, - gracefulshutdown.PLUGIN, - tipselection.PLUGIN, - zeromq.PLUGIN, - dashboard.PLUGIN, - metrics.PLUGIN, + node.Plugins( + cli.PLUGIN, + autopeering.PLUGIN, + gossip.PLUGIN, + tangle.PLUGIN, + bundleprocessor.PLUGIN, + analysis.PLUGIN, + gracefulshutdown.PLUGIN, + tipselection.PLUGIN, + zeromq.PLUGIN, + dashboard.PLUGIN, + metrics.PLUGIN, - statusscreen.PLUGIN, - statusscreen_tps.PLUGIN, + statusscreen.PLUGIN, + statusscreen_tps.PLUGIN, - webapi.PLUGIN, - webapi_gtta.PLUGIN, - webapi_spammer.PLUGIN, - webapi_send_data.PLUGIN, - webapi_tx_request.PLUGIN, + webapi.PLUGIN, + webapi_gtta.PLUGIN, + webapi_spammer.PLUGIN, + webapi_send_data.PLUGIN, + webapi_tx_request.PLUGIN, - ui.PLUGIN, - webauth.PLUGIN, + ui.PLUGIN, + webauth.PLUGIN, + ), ) } diff --git a/packages/database/badger_instance.go b/packages/database/badger_instance.go index fcaae5f51ae0ae5e8fc8d075c2ce3c3c1ec85f60..3f6fd82fdc4d9efd675c6e040fc00e2da83e76e3 100644 --- a/packages/database/badger_instance.go +++ b/packages/database/badger_instance.go @@ -6,7 +6,7 @@ import ( "github.com/dgraph-io/badger" "github.com/dgraph-io/badger/options" - "github.com/iotaledger/hive.go/parameter" + "github.com/iotaledger/goshimmer/packages/parameter" "github.com/pkg/errors" ) diff --git a/packages/parameter/parameter.go b/packages/parameter/parameter.go new file mode 100644 index 0000000000000000000000000000000000000000..86cfd4503c44189455f2c44b613a5cad0ae34d70 --- /dev/null +++ b/packages/parameter/parameter.go @@ -0,0 +1,34 @@ +package parameter + +import ( + flag "github.com/spf13/pflag" + "github.com/spf13/viper" + + "github.com/iotaledger/hive.go/parameter" +) + +var ( + // flags + configName = flag.StringP("config", "c", "config", "Filename of the config file without the file extension") + configDirPath = flag.StringP("config-dir", "d", ".", "Path to the directory containing the config file") + + // Viper + NodeConfig = viper.New() +) + +// FetchConfig fetches config values from a dir defined via CLI flag --config-dir (or the current working dir if not set). +// +// It automatically reads in a single config file starting with "config" (can be changed via the --config CLI flag) +// and ending with: .json, .toml, .yaml or .yml (in this sequence). +func FetchConfig(printConfig bool, ignoreSettingsAtPrint ...[]string) error { + + err := parameter.LoadConfigFile(NodeConfig, *configDirPath, *configName, true, false) + if err != nil { + return err + } + + if printConfig { + parameter.PrintConfig(NodeConfig, ignoreSettingsAtPrint...) + } + return nil +} diff --git a/packages/timeutil/sleep.go b/packages/timeutil/sleep.go deleted file mode 100644 index 448c54d0fb46c5254706c37e4378355ed8da7be5..0000000000000000000000000000000000000000 --- a/packages/timeutil/sleep.go +++ /dev/null @@ -1,17 +0,0 @@ -package timeutil - -import ( - "time" - - "github.com/iotaledger/hive.go/daemon" -) - -func Sleep(interval time.Duration) bool { - select { - case <-daemon.ShutdownSignal: - return false - - case <-time.After(interval): - return true - } -} diff --git a/packages/timeutil/ticker.go b/packages/timeutil/ticker.go deleted file mode 100644 index 7530cd099964544b23b90739452856d5cdd44d6c..0000000000000000000000000000000000000000 --- a/packages/timeutil/ticker.go +++ /dev/null @@ -1,20 +0,0 @@ -package timeutil - -import ( - "time" - - "github.com/iotaledger/hive.go/daemon" -) - -func Ticker(handler func(), interval time.Duration) { - ticker := time.NewTicker(interval) -ticker: - for { - select { - case <-daemon.ShutdownSignal: - break ticker - case <-ticker.C: - handler() - } - } -} diff --git a/packages/transactionspammer/transactionspammer.go b/packages/transactionspammer/transactionspammer.go index aaf868830f17c8571fbaca82c170abbf7ceaf6af..8767c14a89090dd3c50e9a22645f4b9ba562d5ee 100644 --- a/packages/transactionspammer/transactionspammer.go +++ b/packages/transactionspammer/transactionspammer.go @@ -34,13 +34,13 @@ func Start(tps uint) { spamming = true spammingMutex.Unlock() - daemon.BackgroundWorker("Transaction Spammer", func() { + daemon.BackgroundWorker("Transaction Spammer", func(daemonShutdownSignal <-chan struct{}) { start := time.Now() totalSentCounter := int64(0) for { select { - case <-daemon.ShutdownSignal: + case <-daemonShutdownSignal: return case <-shutdownSignal: diff --git a/plugins/analysis/client/plugin.go b/plugins/analysis/client/plugin.go index 8a0559bde425f60ad1b71eeecd6973f5ab51e0d0..1dd3054876999f2d540c5aed9c11cc68662da274 100644 --- a/plugins/analysis/client/plugin.go +++ b/plugins/analysis/client/plugin.go @@ -5,41 +5,40 @@ import ( "net" "time" - "github.com/iotaledger/goshimmer/plugins/autopeering/local" - "github.com/iotaledger/goshimmer/packages/autopeering/discover" "github.com/iotaledger/goshimmer/packages/autopeering/selection" "github.com/iotaledger/goshimmer/packages/network" - "github.com/iotaledger/goshimmer/packages/timeutil" + "github.com/iotaledger/goshimmer/packages/parameter" "github.com/iotaledger/goshimmer/plugins/analysis/types/addnode" "github.com/iotaledger/goshimmer/plugins/analysis/types/connectnodes" "github.com/iotaledger/goshimmer/plugins/analysis/types/disconnectnodes" "github.com/iotaledger/goshimmer/plugins/analysis/types/ping" "github.com/iotaledger/goshimmer/plugins/analysis/types/removenode" "github.com/iotaledger/goshimmer/plugins/autopeering" + "github.com/iotaledger/goshimmer/plugins/autopeering/local" "github.com/iotaledger/hive.go/daemon" "github.com/iotaledger/hive.go/events" "github.com/iotaledger/hive.go/logger" "github.com/iotaledger/hive.go/node" - "github.com/iotaledger/hive.go/parameter" + "github.com/iotaledger/hive.go/timeutil" ) var log = logger.NewLogger("Analysis-Client") func Run(plugin *node.Plugin) { - daemon.BackgroundWorker("Analysis Client", func() { + daemon.BackgroundWorker("Analysis Client", func(shutdownSignal <-chan struct{}) { shuttingDown := false for !shuttingDown { select { - case <-daemon.ShutdownSignal: + case <-shutdownSignal: return default: if conn, err := net.Dial("tcp", parameter.NodeConfig.GetString(CFG_SERVER_ADDRESS)); err != nil { log.Debugf("Could not connect to reporting server: %s", err.Error()) - timeutil.Sleep(1 * time.Second) + timeutil.Sleep(1*time.Second, shutdownSignal) } else { managedConn := network.NewManagedConnection(conn) eventDispatchers := getEventDispatchers(managedConn) @@ -47,7 +46,7 @@ func Run(plugin *node.Plugin) { reportCurrentStatus(eventDispatchers) setupHooks(plugin, managedConn, eventDispatchers) - shuttingDown = keepConnectionAlive(managedConn) + shuttingDown = keepConnectionAlive(managedConn, shutdownSignal) } } } @@ -138,13 +137,13 @@ func reportChosenNeighbors(dispatchers *EventDispatchers) { } } -func keepConnectionAlive(conn *network.ManagedConnection) bool { +func keepConnectionAlive(conn *network.ManagedConnection, shutdownSignal <-chan struct{}) bool { go conn.Read(make([]byte, 1)) ticker := time.NewTicker(1 * time.Second) for { select { - case <-daemon.ShutdownSignal: + case <-shutdownSignal: return true case <-ticker.C: diff --git a/plugins/analysis/plugin.go b/plugins/analysis/plugin.go index 7721f971f8e4ca130c4e3d1fb5f22eec769d847e..f7ffdbc3d92124766afabe84db64a0b7938ba685 100644 --- a/plugins/analysis/plugin.go +++ b/plugins/analysis/plugin.go @@ -1,6 +1,7 @@ package analysis import ( + "github.com/iotaledger/goshimmer/packages/parameter" "github.com/iotaledger/goshimmer/plugins/analysis/client" "github.com/iotaledger/goshimmer/plugins/analysis/server" "github.com/iotaledger/goshimmer/plugins/analysis/webinterface" @@ -8,7 +9,6 @@ import ( "github.com/iotaledger/hive.go/events" "github.com/iotaledger/hive.go/logger" "github.com/iotaledger/hive.go/node" - "github.com/iotaledger/hive.go/parameter" ) var PLUGIN = node.NewPlugin("Analysis", node.Enabled, configure, run) @@ -35,6 +35,7 @@ func run(plugin *node.Plugin) { if parameter.NodeConfig.GetString(client.CFG_SERVER_ADDRESS) != "" { client.Run(plugin) + log.Info("Stopping Analysis-Client ... done") } else { log.Info("Starting Plugin: Analysis ... client is disabled (server-address is empty)") } diff --git a/plugins/analysis/server/plugin.go b/plugins/analysis/server/plugin.go index c5733df3fdfd91a204ca27f2c7263a6201768984..4f67de7d0ea6aa94bf0edfaee92fbe4302433b4b 100644 --- a/plugins/analysis/server/plugin.go +++ b/plugins/analysis/server/plugin.go @@ -6,6 +6,7 @@ import ( "github.com/iotaledger/goshimmer/packages/network" "github.com/iotaledger/goshimmer/packages/network/tcp" + "github.com/iotaledger/goshimmer/packages/parameter" "github.com/iotaledger/goshimmer/plugins/analysis/types/addnode" "github.com/iotaledger/goshimmer/plugins/analysis/types/connectnodes" "github.com/iotaledger/goshimmer/plugins/analysis/types/disconnectnodes" @@ -15,7 +16,6 @@ import ( "github.com/iotaledger/hive.go/events" "github.com/iotaledger/hive.go/logger" "github.com/iotaledger/hive.go/node" - "github.com/iotaledger/hive.go/parameter" "github.com/pkg/errors" ) @@ -39,7 +39,7 @@ func Configure(plugin *node.Plugin) { } func Run(plugin *node.Plugin) { - daemon.BackgroundWorker("Analysis Server", func() { + daemon.BackgroundWorker("Analysis Server", func(shutdownSignal <-chan struct{}) { log.Infof("Starting Server (port %d) ... done", parameter.NodeConfig.GetInt(CFG_SERVER_PORT)) server.Listen(parameter.NodeConfig.GetInt(CFG_SERVER_PORT)) }) diff --git a/plugins/analysis/webinterface/httpserver/plugin.go b/plugins/analysis/webinterface/httpserver/plugin.go index d02d449ed07bae3c598b3b2fa4511c285788dfec..20051f0f1aadd4ee31821880c94afe4ac6654103 100644 --- a/plugins/analysis/webinterface/httpserver/plugin.go +++ b/plugins/analysis/webinterface/httpserver/plugin.go @@ -32,7 +32,7 @@ func Configure(plugin *node.Plugin) { } func Run(plugin *node.Plugin) { - daemon.BackgroundWorker("Analysis HTTP Server", func() { + daemon.BackgroundWorker("Analysis HTTP Server", func(shutdownSignal <-chan struct{}) { httpServer.ListenAndServe() }) } diff --git a/plugins/autopeering/autopeering.go b/plugins/autopeering/autopeering.go index 9a6ccb670b4f43b64999b45ab48c2a22b40a6235..3bbbd33957760e63177e1cdc4de8e873d0cd14b4 100644 --- a/plugins/autopeering/autopeering.go +++ b/plugins/autopeering/autopeering.go @@ -13,9 +13,8 @@ import ( "github.com/iotaledger/goshimmer/packages/autopeering/selection" "github.com/iotaledger/goshimmer/packages/autopeering/server" "github.com/iotaledger/goshimmer/packages/autopeering/transport" + "github.com/iotaledger/goshimmer/packages/parameter" "github.com/iotaledger/goshimmer/plugins/autopeering/local" - "github.com/iotaledger/hive.go/daemon" - "github.com/iotaledger/hive.go/parameter" "github.com/pkg/errors" ) @@ -72,7 +71,7 @@ func configureAP() { } } -func start() { +func start(shutdownSignal <-chan struct{}) { defer log.Info("Stopping Auto Peering server ... done") addr := local.GetInstance().Services().Get(service.PeeringKey) @@ -120,7 +119,7 @@ func start() { log.Infof("Auto Peering server started: ID=%x, address=%s", local.GetInstance().ID(), srv.LocalAddr()) - <-daemon.ShutdownSignal + <-shutdownSignal log.Info("Stopping Auto Peering server ...") } diff --git a/plugins/autopeering/local/local.go b/plugins/autopeering/local/local.go index a477cd8abd7dcbce74880fa63adeef4a66fe6f0c..58381256aeb2b8ad2c1b0a1aedb03a1b4473be30 100644 --- a/plugins/autopeering/local/local.go +++ b/plugins/autopeering/local/local.go @@ -10,7 +10,7 @@ import ( "sync" "github.com/iotaledger/goshimmer/packages/autopeering/peer" - "github.com/iotaledger/hive.go/parameter" + "github.com/iotaledger/goshimmer/packages/parameter" "go.uber.org/zap" ) diff --git a/plugins/bundleprocessor/plugin.go b/plugins/bundleprocessor/plugin.go index 2344caa6c4559ae533ef6929affffd537638cdd5..d7f6dbb7bd9f2c0b9cd1d4e5f230ed3746151375 100644 --- a/plugins/bundleprocessor/plugin.go +++ b/plugins/bundleprocessor/plugin.go @@ -38,7 +38,7 @@ func configure(plugin *node.Plugin) { func run(plugin *node.Plugin) { log.Info("Starting Bundle Processor ...") - daemon.BackgroundWorker("Bundle Processor", func() { + daemon.BackgroundWorker("Bundle Processor", func(shutdownSignal <-chan struct{}) { log.Info("Starting Bundle Processor ... done") workerPool.Run() log.Info("Stopping Bundle Processor ... done") @@ -46,7 +46,7 @@ func run(plugin *node.Plugin) { log.Info("Starting Value Bundle Processor ...") - daemon.BackgroundWorker("Value Bundle Processor", func() { + daemon.BackgroundWorker("Value Bundle Processor", func(shutdownSignal <-chan struct{}) { log.Info("Starting Value Bundle Processor ... done") valueBundleProcessorWorkerPool.Run() log.Info("Stopping Value Bundle Processor ... done") diff --git a/plugins/cli/plugin.go b/plugins/cli/plugin.go index 51b86bcb26aa7f96d9bdec2680f8c7aa91174930..d4da0e2a5cc617f3bf6a55d608549774816337d3 100644 --- a/plugins/cli/plugin.go +++ b/plugins/cli/plugin.go @@ -4,9 +4,9 @@ import ( "fmt" "strings" + "github.com/iotaledger/goshimmer/packages/parameter" "github.com/iotaledger/hive.go/events" "github.com/iotaledger/hive.go/node" - "github.com/iotaledger/hive.go/parameter" flag "github.com/spf13/pflag" ) @@ -53,7 +53,9 @@ func configure(ctx *node.Plugin) { fmt.Printf(" \\____/\\_| |_/\\___/\\_| |_/\\_| |_/\\____/\\_| \\_| fullnode %s", AppVersion) fmt.Println() - parameter.FetchConfig(false) + if err := parameter.FetchConfig(true); err != nil { + panic(err) + } parseParameters() ctx.Node.Logger.Info("Loading plugins ...") diff --git a/plugins/dashboard/plugin.go b/plugins/dashboard/plugin.go index 1601f24377e582d5ee1e901722d98d50003d7c18..708a801e35f959508b21c3239c4465d9b86c1ef5 100644 --- a/plugins/dashboard/plugin.go +++ b/plugins/dashboard/plugin.go @@ -43,7 +43,7 @@ func configure(plugin *node.Plugin) { } func run(plugin *node.Plugin) { - daemon.BackgroundWorker("Dashboard Updater", func() { + daemon.BackgroundWorker("Dashboard Updater", func(shutdownSignal <-chan struct{}) { go func() { if err := server.ListenAndServe(); err != nil { log.Error(err.Error()) diff --git a/plugins/gossip/gossip.go b/plugins/gossip/gossip.go index 16433e336c482a0c6386d34a9d5fbfc917ca9b21..8b552c69f800972eea094f5da6a1b6678a3ce056 100644 --- a/plugins/gossip/gossip.go +++ b/plugins/gossip/gossip.go @@ -10,10 +10,9 @@ import ( "github.com/iotaledger/goshimmer/packages/errors" gp "github.com/iotaledger/goshimmer/packages/gossip" "github.com/iotaledger/goshimmer/packages/gossip/server" + "github.com/iotaledger/goshimmer/packages/parameter" "github.com/iotaledger/goshimmer/plugins/autopeering/local" "github.com/iotaledger/goshimmer/plugins/tangle" - "github.com/iotaledger/hive.go/daemon" - "github.com/iotaledger/hive.go/parameter" "github.com/iotaledger/hive.go/typeutils" ) @@ -61,7 +60,7 @@ func configureGossip() { mgr = gp.NewManager(lPeer, getTransaction, zLogger) } -func start() { +func start(shutdownSignal <-chan struct{}) { defer log.Info("Stopping Gossip ... done") srv, err := server.ListenTCP(local.GetInstance(), zLogger) @@ -75,7 +74,7 @@ func start() { log.Infof("Gossip started: address=%v", mgr.LocalAddr()) - <-daemon.ShutdownSignal + <-shutdownSignal log.Info("Stopping Gossip ...") } diff --git a/plugins/metrics/plugin.go b/plugins/metrics/plugin.go index 65a4418120dc7bf2dee5fe86fd1501b1ab1f8024..4774c72d3c540f57f900660502a21d33686cae84 100644 --- a/plugins/metrics/plugin.go +++ b/plugins/metrics/plugin.go @@ -4,10 +4,10 @@ import ( "time" "github.com/iotaledger/goshimmer/packages/gossip" - "github.com/iotaledger/goshimmer/packages/timeutil" "github.com/iotaledger/hive.go/daemon" "github.com/iotaledger/hive.go/events" "github.com/iotaledger/hive.go/node" + "github.com/iotaledger/hive.go/timeutil" ) var PLUGIN = node.NewPlugin("Metrics", node.Enabled, configure, run) @@ -19,5 +19,7 @@ func configure(plugin *node.Plugin) { func run(plugin *node.Plugin) { // create a background worker that "measures" the TPS value every second - daemon.BackgroundWorker("Metrics TPS Updater", func() { timeutil.Ticker(measureReceivedTPS, 1*time.Second) }) + daemon.BackgroundWorker("Metrics TPS Updater", func(shutdownSignal <-chan struct{}) { + timeutil.Ticker(measureReceivedTPS, 1*time.Second, shutdownSignal) + }) } diff --git a/plugins/statusscreen-tps/plugin.go b/plugins/statusscreen-tps/plugin.go index 7433b286a98eeeda658c6139d7060cd664abba65..c4909e45e6df63501c3deeffced361a5e36c9621 100644 --- a/plugins/statusscreen-tps/plugin.go +++ b/plugins/statusscreen-tps/plugin.go @@ -35,12 +35,12 @@ var PLUGIN = node.NewPlugin("Statusscreen TPS", node.Enabled, func(plugin *node. return "TPS", strconv.FormatUint(atomic.LoadUint64(&receivedTps), 10) + " received / " + strconv.FormatUint(atomic.LoadUint64(&solidTps), 10) + " new" }) }, func(plugin *node.Plugin) { - daemon.BackgroundWorker("Statusscreen TPS Tracker", func() { + daemon.BackgroundWorker("Statusscreen TPS Tracker", func(shutdownSignal <-chan struct{}) { ticker := time.NewTicker(time.Second) for { select { - case <-daemon.ShutdownSignal: + case <-shutdownSignal: return case <-ticker.C: diff --git a/plugins/statusscreen/statusscreen.go b/plugins/statusscreen/statusscreen.go index 575a1b3bc9e17834580139a563d7d1f0fde33236..06057fd4a6f4c6d0b095b1352b4b58153d13f446 100644 --- a/plugins/statusscreen/statusscreen.go +++ b/plugins/statusscreen/statusscreen.go @@ -136,10 +136,10 @@ func run(plugin *node.Plugin) { return false }) - daemon.BackgroundWorker("Statusscreen Refresher", func() { + daemon.BackgroundWorker("Statusscreen Refresher", func(shutdownSignal <-chan struct{}) { for { select { - case <-daemon.ShutdownSignal: + case <-shutdownSignal: return case <-time.After(1 * time.Second): app.QueueUpdateDraw(func() {}) @@ -147,7 +147,7 @@ func run(plugin *node.Plugin) { } }) - daemon.BackgroundWorker("Statusscreen App", func() { + daemon.BackgroundWorker("Statusscreen App", func(shutdownSignal <-chan struct{}) { if err := app.SetRoot(frame, true).SetFocus(frame).Run(); err != nil { panic(err) } diff --git a/plugins/tangle/solidifier.go b/plugins/tangle/solidifier.go index dddd71e960ffd1b337ab7b46ef50ad242954d9dd..de2526d6cebd4556cd2da861e4b588fb17bdb8ac 100644 --- a/plugins/tangle/solidifier.go +++ b/plugins/tangle/solidifier.go @@ -54,7 +54,7 @@ func configureSolidifier(plugin *node.Plugin) { func runSolidifier(plugin *node.Plugin) { log.Info("Starting Solidifier ...") - daemon.BackgroundWorker("Tangle Solidifier", func() { + daemon.BackgroundWorker("Tangle Solidifier", func(shutdownSignal <-chan struct{}) { log.Info("Starting Solidifier ... done") workerPool.Run() log.Info("Stopping Solidifier ... done") diff --git a/plugins/ui/ui.go b/plugins/ui/ui.go index 86add4dfcecb91e1dc6345fd359316cc6a3f7274..02e248a3f64db98bf952866213b183de52262f60 100644 --- a/plugins/ui/ui.go +++ b/plugins/ui/ui.go @@ -72,10 +72,10 @@ func staticFileServer(c echo.Context) error { func run(plugin *node.Plugin) { - daemon.BackgroundWorker("UI Refresher", func() { + daemon.BackgroundWorker("UI Refresher", func(shutdownSignal <-chan struct{}) { for { select { - case <-daemon.ShutdownSignal: + case <-shutdownSignal: return case <-time.After(1 * time.Second): wsMutex.Lock() diff --git a/plugins/webapi/plugin.go b/plugins/webapi/plugin.go index 325a0918618da76020782270b04b50c1af6b39bf..4d3177ee78215f457cc29793926d637ba2eb9ed8 100644 --- a/plugins/webapi/plugin.go +++ b/plugins/webapi/plugin.go @@ -36,7 +36,7 @@ func configure(plugin *node.Plugin) { func run(plugin *node.Plugin) { log.Info("Starting Web Server ...") - daemon.BackgroundWorker("WebAPI Server", func() { + daemon.BackgroundWorker("WebAPI Server", func(shutdownSignal <-chan struct{}) { log.Info("Starting Web Server ... done") if err := Server.Start(":8080"); err != nil { diff --git a/plugins/webauth/webauth.go b/plugins/webauth/webauth.go index b8e118147f981d1f2852d52f53c02923dec1e4dd..b2c898a873f26e9fcc87c7effe5b426c4cb914ff 100644 --- a/plugins/webauth/webauth.go +++ b/plugins/webauth/webauth.go @@ -40,7 +40,7 @@ func configure(plugin *node.Plugin) { } func run(plugin *node.Plugin) { - daemon.BackgroundWorker("webauth", func() { + daemon.BackgroundWorker("webauth", func(shutdownSignal <-chan struct{}) { webapi.AddEndpoint("login", func(c echo.Context) error { username := c.FormValue("username") password := c.FormValue("password") diff --git a/plugins/zeromq/plugin.go b/plugins/zeromq/plugin.go index 5406b9521660aae58d802b821b0815b65b2e7646..aa547901ae53806938b8fcf805744aaa70138a47 100644 --- a/plugins/zeromq/plugin.go +++ b/plugins/zeromq/plugin.go @@ -6,12 +6,12 @@ import ( "time" "github.com/iotaledger/goshimmer/packages/model/value_transaction" + "github.com/iotaledger/goshimmer/packages/parameter" "github.com/iotaledger/goshimmer/plugins/tangle" "github.com/iotaledger/hive.go/daemon" "github.com/iotaledger/hive.go/events" "github.com/iotaledger/hive.go/logger" "github.com/iotaledger/hive.go/node" - "github.com/iotaledger/hive.go/parameter" ) // zeromq logging is disabled by default @@ -48,7 +48,7 @@ func run(plugin *node.Plugin) { zeromqPort := parameter.NodeConfig.GetInt(ZEROMQ_PORT) log.Infof("Starting ZeroMQ Publisher (port %d) ...", zeromqPort) - daemon.BackgroundWorker("ZeroMQ Publisher", func() { + daemon.BackgroundWorker("ZeroMQ Publisher", func(shutdownSignal <-chan struct{}) { if err := startPublisher(plugin); err != nil { log.Errorf("Stopping ZeroMQ Publisher: %s", err.Error()) } else {