From d64cddf65226bc179b5f6f144536837501b8124b Mon Sep 17 00:00:00 2001 From: Daniil Lashin Date: Wed, 25 Jul 2018 10:19:47 +0300 Subject: [PATCH 1/2] refactor gui --- CHANGELOG.md | 7 +++++++ cmd/minter/main-packr.go | 11 ----------- cmd/minter/main.go | 13 ++----------- gui/gui-packr.go | 11 +++++++++++ gui/gui.go | 14 ++++++++++++++ gui/{ => html}/index.html | 0 version/version.go | 4 ++-- 7 files changed, 36 insertions(+), 24 deletions(-) delete mode 100644 cmd/minter/main-packr.go create mode 100644 gui/gui-packr.go create mode 100644 gui/gui.go rename gui/{ => html}/index.html (100%) diff --git a/CHANGELOG.md b/CHANGELOG.md index c69a23e7b..4587f77b0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,13 @@ - [api] Add validators rewards to block api +## 0.1.3 +*Jule 25th, 2018* + +IMPROVEMENT + +- [tendermint] Update tendermint to 0.22.5 + ## 0.1.0 *Jule 23th, 2018* diff --git a/cmd/minter/main-packr.go b/cmd/minter/main-packr.go deleted file mode 100644 index c6d7f9070..000000000 --- a/cmd/minter/main-packr.go +++ /dev/null @@ -1,11 +0,0 @@ -// Code generated by github.com/gobuffalo/packr. DO NOT EDIT - -package main - -import "github.com/gobuffalo/packr" - -// You can use the "packr clean" command to clean up this, -// and any other packr generated files. -func init() { - packr.PackJSONBytes("./../../gui", "index.html", "\"PGh0bWw+CjxoZWFkPgogICAgPG1ldGEgY2hhcnNldD0iVVRGLTgiPgogICAgPG1ldGEgbmFtZT0idmlld3BvcnQiCiAgICAgICAgICBjb250ZW50PSJ3aWR0aD1kZXZpY2Utd2lkdGgsIHVzZXItc2NhbGFibGU9bm8sIGluaXRpYWwtc2NhbGU9MS4wLCBtYXhpbXVtLXNjYWxlPTEuMCwgbWluaW11bS1zY2FsZT0xLjAiPgogICAgPG1ldGEgaHR0cC1lcXVpdj0iWC1VQS1Db21wYXRpYmxlIiBjb250ZW50PSJpZT1lZGdlIj4KICAgIDx0aX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6IDEwMCU7CiAgICAgICAgfQogICAgICAgIAogICAgICAgIC5ib2R5IHsKICAgICAgICAgICAgcGFkZGluZy10b3A6IDE1cHg7CiAgICAgICAgfQoKICAgICAgICAudGFibGUgewogICAgICAgICAgICBtYXJnaW4tYm90dG9tOiAwOwogICAgICAgICAgICB0YWJsZS1sYXlvdXQ6IGZpeGVkOwogICAgICAgIH0KCiAgICAgICAgLmNhcmQtaGVhZGVyIHsKICAgICAgICAgICAgZm9udC13ZWlnaHQ6IGJvbGQ7CiAgICAgICAgfQoKICAgICAgICAuY2FyZC1oZWFkZXIgewogICAgICAgICAgICBwYWRkaW5nLWxlZnQ6IDEycHg7CiAgICAgICAgfQoKICAgICAgICAuaCB7CiAgICAgICAgICAgIHdpZHRoOiAyMDBweDsKICAgICAgICAgICAgYmFja2dyb3VuZC1jb2xvcjogI2YzZjNmMzsKICAgICAgICAgICAgYm9yZGVyLXJpZ2h0OiAxcHggc29saWQgI2NjYzsKICAgICAgICB9CgogICAgICAgIC5iZy1zdWNjZXNzLCAuYmctZGFuZ2VyIHsKICAgICAgICAgICAgY29sb3I6IHdoaXRlOwogICAgICAgIH0KCiAgICAgICAgLmJnLWRhbmdlciB7CiAgICAgICAgICAgIGJvcmRlci1jb2xvcjogI2RjMzU0NSAhaW1wb3J0YW50OwogICAgICAgIH0KCiAgICAgICAgLmJnLXN1Y2Nlc3MgewogICAgICAgICAgICBib3JkZXItY29sb3I6ICMyOGE3NDUgIWltcG9ydGFudDsKICAgICAgICB9CgogICAgICAgIC5mYS1jaGVjayB7CiAgICAgICAgICAgIGNvbG9yOiBncmVlbjsKICAgICAgICB9CgogICAgICAgIC5mYS1leGNsYW1hdGlvbi1jaXJjbGUgewogICAgICAgICAgICBjb2xvcjogcmVkOwogICAgICAgIH0KICAgIDwvc3R5bGU+CjwvaGVhZD4KPGJvZHkgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICMzNDNhNDAxYSI+CjxkaXYgaWQ9ImFwcCI+CiAgICA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AgICAgICAgICAgICA8dHI+CiAgICAgICAgICAgICAgICAgICAgICAgICAgICA8dGQgY2xhc3M9ImgiPk1vbmlrZXI8L3RkPgogICAgICAgICAgICAgICAgICAgICAgICAgICAgPHRkPnt7IHN0YXR1cy5ub2RlX2luZm8ubW9uaWtlciB9fTwvdGQ+CiAgICAgICAgICAgICAgICAgICAgICAgIDwvdHI+CiAgICAgICAgICAgICAgICAgICAgICAgIDx0cj4KICAgICAgICAgICAgICAgICAgICAgICAgICAgIDx0ZCBjbGFzcz0iaCI+Tm9kZSBJRDwvdGQ+CiAgICAgICAgICAgICAgICAgICAgICAgICAgICA8dGQ+e3sgc3RhdHVzLm5vZGVfaW5mby5pZCB9fTwvdGQ+CiAgICAgICAgICAgICAgICAgICAgICAgIDwvdHI+CiAgICAgICAgICAgICAgICAgICAgICAgIDx0cj4KICAgICAgICAgICAgICAgICAgICAgICAgICAgIDx0ZCBjbGFzcz0iaCI+TGlzdGVuIEFkZHI8L3RkPgogICAgICAgICAgICAgICAgICAgICAgICAgICAgPHRkPnt7IHN0YXR1cy5ub2RlX2luZm8ubGlzdGVuX2FkZHIgfX08L3RkPgogICAgICAgICAgICAgICAgICAgICAgICA8L3RyPgogICAgICAgICAgICAgICAgICAgICAgICA8dHI+CiAgICAgICAgICAgICAgICAgICAgICAgICAgICA8dGQgY2xhc3M9ImgiPk5ldHdvcmsgSUQ8L3RkPgogICAgICAgICAgICAgICAgICAgICAgICAgICAgPHRkPnt7IHN0YXR1cy5ub2RlX2luZm8ubmV0d29yayB9fTwvdGQ+CiAgICAgICAgICAgICAgICAgICAgICAgIDwvdHI+CiAgICAgICAgICAgICAgICAgICAgICAgIDx0cj4KICAgICAgICAgICAgICAgICAgICAgICAgICAgIDx0ZCBjbGFzcz0iaCI+TWludGVyIFZlcnNpb248L3RkPgogICAgICAgICAgICAgICAgICAgICAgICAgICAgPHRkPnt7IHZlcnNpb24gfX08L3RkPgogICAgICAgICAgICAgICAgICAgICAgICA8L3RyPgogICAgICAgICAgICAgICAgICAgICAgICA8dHI+CiAgICAgICAgICAgICAgICAgICAgICAgICAgICA8dGQgY2xhc3M9ImgiPlRlbmRlcm1pbnQgVmVyc2lvbjwvdGQ+CiAgICAgICAgICAgICAgICAgICAgICAgICAgICA8dGQ+e3sgc3RhdHVzLm5vZGVfaW5mby52ZXJzaW9uIH19PC90ZD4KICAgICAgICAgICAgICAgICAgICAgICAgPC90cj4KICAgICAgICAgICAgICAgICAgICAgICAgPC90Ym9keT4KICAgICAgICAgICAgICAgICAgICA8L3RhYmxlPgogICAgICAgICAgICAgICAgPC9kaXY+CiAgICAgICAgICAgICAgICA8ZGl2IGNsYXNzPSJjYXJkIiB2LWlmPSJuZXRfaW5mbyI+CiAgICAgICAgICAgICAgICAgICAgPGRpdiBjbGFzcz0iY2FyZC1oZWFkZXIiPgogICAgICAgICAgICAgICAgICAgICAgICBOZXQgSW5mbwogICAgICAgICAgICAgICAgICAgIDwvZGl2PgogICAgICAgICAgICAgICAgICAgIDx0YWJsZSBjbGFzcz0idGFibGUgY2FyZC1ib2R5Ij4KICAgICAgICAgICAgICAgICAgICAgICAgPHRib2R5PgogICAgICAgICAgICAgICAgICAgICAgICA8dHI+CiAgICAgICAgICAgICAgICAgICAgICAgICAgICA8dGQgY2xhc3M9ImgiPklzIExpc3RlbmluZzwvdGQ+CiAgICAgICAgICAgICAgICAgICAgICAgICAgICA8dGQ+PGkgOmNsYXNzPSJ7J2ZhLWNoZWNrJzogbmV0X2luZm8ubGlzdGVuaW5nfSIgY2xhc3M9ImZhcyI+PC9pPjwvdGQ+CiAgICAgICAgICAgICAgICAgICAgICAgIDwvdHI+CiAgICAgICAgICAgICAgICAgICAgICAgIDx0cj4KICAgICAgICAgICAgICAgICAgICAgICAgICAgIDx0ZCBjbGFzcz0iaCI+Q29ubmVjdGVkIFBlZXJzPC90ZD4KICAgICAgICAgICAgICAgICAgICAgICAgICAgIDx0ZD57eyBuZXRfaW5mby5uX3BlZXJzIH19IDxpIDpjbGFzcz0ieydmYS1leGNsYW1hdGlvbi1jaXJjbGUnOiBuZXRfaW5mby5uX3BlZXJzIDwgMX0iIGNsYXNzPSJmYXMiPjwvaT48L3RkPgogICAgICAgICAgICAgICAgICAgICAgICA8L3RyPgogICAgICAgICAgICAgICAgICAgICAgICA8L3Rib2R5PgogICAgICAgICAgICAgICAgICAgIDwvdGFibGU+CiAgICAgICAgICAgICAgICA8L2Rpdj4KICAgICAgICAgICAgPC9kaXY+CiAgICAgICAgICAgIDxkaXYgY2xhc3M9ImNvbCI+CiAgICAgICAgICAgICAgICA8ZGl2IGNsYXNzPSJjYXJkIj4KICAgICAgICAgICAgICAgICAgICA8ZGl2IGNsYXNzPSJjYXJkLWhlYWRlciI+CiAgICAgICAgICAgICAgICAgICAgICAgIFN5bmNpbmcgSW5mbwogICAgICAgICAgICAgICAgICAgIDwvZGl2PgogICAgICAgICAgICAgICAgICAgIDx0YWJsZSBjbGFzcz0idGFibGUgY2FyZC1ib2R5Ij4KICAgICAgICAgICAgICAgICAgICAgICAgPHRib2R5PgogICAgICAgICAgICAgICAgICAgICAgICA8dHI+CiAgICAgICAgICAgICAgICAgICAgICAgICAgICA8dGQgY2xhc3M9ImgiPklzIFN5bmNlZDwvdGQ+CiAgICAgICAgICAgICAgICAgICAgICAgICAgICA8dGQ+CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPHNwYW4gdi1pZj0ic3RhdHVzLnN5bmNfaW5mby5jYXRjaGluZ191cCI+Tm88L3NwYW4+CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPHNwYW4gdi1pZj0iIXN0YXR1cy5zeW5jX2luZm8uY2F0Y2hpbmdfdXAiPlllczwvc3Bhbj4KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA8aSA6Y2xhc3M9InsnZmEtY2hlY2snOiAhc3RhdHVzLnN5bmNfaW5mby5jYXRjaGluZ191cCwgJ2ZhLWV4Y2xhbWF0aW9uLWNpcmNsZSc6IHN0YXR1cy5zeW5jX2luZm8uY2F0Y2hpbmdfdXB9IiBjbGFzcz0iZmFzIj48L2k+PC90ZD4KICAgICAgICAgICAgICAgICAgICAgICAgPC90cj4KICAgICAgICAgICAgICAgICAgICAgICAgPHRyPgogICAgICAgICAgICAgICAgICAgICAgICAgICAgPHRkIGNsYXNzPSJoIj5MYXRlc3QgQmxvY2s8L3RkPgogICAgICAgICAgICAgICAgICAgICAgICAgICAgPHRkPgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICN7eyBzdGF0dXMuc3luY19pbmZvLmxhdGVzdF9ibG9ja19oZWlnaHQgfX0gPHNwYW4KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2xhc3M9InRleHQtbXV0ZWQiPmF0IHt7IHN0YXR1cy5zeW5jX2luZm8ubGF0ZXN0X2Jsb2NrX3RpbWUgfX08L3NwYW4+CiAgICAgICAgICAgICAgICAgICAgICAgICAgICA8L3RkPgogICAgICAgICAgICAgICAgICAgICAgICA8L3RyPgogICAgICAgICAgICAgICAgICAgICAgICA8L3Rib2R5PgogICAgICAgICAgICAgICAgICAgIDwvdGFibGU+CiAgICAgICAgICAgICAgICA8L2Rpdj4KICAgICAgICAgICAgICAgIDxkaXYgY2xhc3M9ImNhcmQiPgogICAgICAgICAgICAgICAgICAgIDxkaXYgY2xhc3M9ImNhcmQtaGVhZGVyIj4KICAgICAgICAgICAgICAgICAgICAgICAgVmFsaWRhdG9yIEluZm8KICAgICAgICAgICAgICAgICAgICA8L2Rpdj4KICAgICAgICAgICAgICAgICAgICA8dGFibGUgY2xhc3M9InRhYmxlIGNhcmQtYm9keSI+CiAgICAgICAgICAgICAgICAgICAgICAgIDx0Ym9keT4KICAgICAgICAgICAgICAgICAgICAgICAgPHRyPgogICAgICAgICAgICAgICAgICAgICAgICAgICAgPHRkPlB1YmxpYyBLZXk8L3RkPgogICAgICAgICAgICAgICAgICAgICAgICAgICAgPHRkPk1we3sgYmFzZTY0VG9IZXgoc3RhdHVzLnZhbGlkYXRvcl9pbmZvLnB1Yl9rZXkudmFsdWUpIH19PC90ZD4KICAgICAgICAgICAgICAgICAgICAgICAgPC90cj4KICAgICAgICAgICAgICAgICAgICAgICAgPHRyPgogICAgICAgICAgICAgICAgICAgICAgICAgICAgPHRkPlZvdGluZyBQb3dlcjwvdGQ+CiAgICAgICAgICAgICAgICAgICAgICAgICAgICA8dGQ+e3sgbmljZU51bShzdGF0dXMudmFsaWRhdG9yX2luZm8udm90aW5nX3Bvd2VyKSB9fSA8c3BhbiBjbGFzcz0idGV4dC1tdXRlZCI+b2YgMTAwLDAwMCwwMDA8L3NwYW4+PC90ZD4KICAgICAgICAgICAgICAgICAgICAgICAgPC90cj4KICAgICAgICAgICAgICAgICAgICAgICAgPC90Ym9keT4KICAgICAgICAgICAgICAgICAgICA8L3RhYmxlPgogICAgICAgICAgICAgICAgPC9kaXY+CiAgICAgICAgICAgIDwvZGl2PgogICAgICAgIDwvZGl2PgogICAgPC9kaXY+CjwvZGl2Pgo8c2NyaXB0PgogICAgbmV3IFZ1ZSh7CiAgICAgICAgZWw6ICcjYXBwJywKICAgICAgICBkYXRhOiB7CiAgICAgICAgICAgIHN0YXR1czogbnVsbCwKICAgICAgICAgICAgdmVyc2lvbjogbnVsbCwKICAgICAgICAgICAgbmV0X2luZm86IG51bGwsCiAgICAgICAgICAgIGVycm9yOiBudWxsCiAgICAgICAgfSwKICAgICAgICBtb3VudGVkKCkgewogICAgICAgICAgICB0aGlzLnJlZnJlc2goKQoKICAgICAgICAgICAgc2V0SW50ZXJ2YWwodGhpcy5yZWZyZXNoLCAxMDAwKQogICAgICAgIH0sCiAgICAgICAgbWV0aG9kczogewogICAgICAgICAgICBuaWNlTnVtKG51bSkgewogICAgICAgICAgICAgICAgcmV0dXJuIG51bS50b1N0cmluZygpLnJlcGxhY2UoL1xCKD89KFxkezN9KSsoPyFcZCkpL2csICIsIikKICAgICAgICAgICAgfSwKICAgICAgICAgICAgYmFzZTY0VG9IZXgoYmFzZTY0KSB7CiAgICAgICAgICAgICAgICByZXR1cm4gQ3J5cHRvSlMuZW5jLkJhc2U2NC5wYXJzZShiYXNlNjQpLnRvU3RyaW5nKCkKICAgICAgICAgICAgfSwKICAgICAgICAgICAgcmVmcmVzaCgpIHsKICAgICAgICAgICAgICAgIGF4aW9zLmdldCgiLy8iICsgd2luZG93LmxvY2F0aW9uLmhvc3RuYW1lICsgJzo4ODQxL2FwaS9zdGF0dXMnKS50aGVuKGZ1bmN0aW9uIChkYXRhKSB7CiAgICAgICAgICAgICAgICAgICAgdGhpcy5zdGF0dXMgPSBkYXRhLmRhdGEucmVzdWx0LnRtX3N0YXR1cwogICAgICAgICAgICAgICAgICAgIHRoaXMudmVyc2lvbiA9IGRhdGEuZGF0YS5yZXN1bHQudmVyc2lvbgogICAgICAgICAgICAgICAgICAgIHRoaXMuZXJyb3IgPSBudWxsCiAgICAgICAgICAgICAgICB9LmJpbmQodGhpcykpLmNhdGNoKGZ1bmN0aW9uIChyZWFzb24pIHsKICAgICAgICAgICAgICAgICAgICB0aGlzLmVycm9yID0gcmVhc29uLnRvU3RyaW5nKCk7CiAgICAgICAgICAgICAgICB9LmJpbmQodGhpcykpCgogICAgICAgICAgICAgICAgYXhpb3MuZ2V0KCIvLyIgKyB3aW5kb3cubG9jYXRpb24uaG9zdG5hbWUgKyAnOjg4NDEvYXBpL25ldF9pbmZvJykudGhlbihmdW5jdGlvbiAoZGF0YSkgewogICAgICAgICAgICAgICAgICAgIHRoaXMubmV0X2luZm8gPSBkYXRhLmRhdGEucmVzdWx0CiAgICAgICAgICAgICAgICAgICAgdGhpcy5lcnJvciA9IG51bGwKICAgICAgICAgICAgICAgIH0uYmluZCh0aGlzKSkuY2F0Y2goZnVuY3Rpb24gKHJlYXNvbikgewogICAgICAgICAgICAgICAgICAgIHRoaXMuZXJyb3IgPSByZWFzb24udG9TdHJpbmcoKTsKICAgICAgICAgICAgICAgIH0uYmluZCh0aGlzKSkKICAgICAgICAgICAgfQogICAgICAgIH0KICAgIH0pCjwvc2NyaXB0Pgo8L2JvZHk+CjwvaHRtbD4=\"") -} diff --git a/cmd/minter/main.go b/cmd/minter/main.go index 7cc957245..041b1a92d 100644 --- a/cmd/minter/main.go +++ b/cmd/minter/main.go @@ -7,14 +7,13 @@ import ( "github.com/MinterTeam/minter-go-node/config" "github.com/MinterTeam/minter-go-node/core/minter" "github.com/MinterTeam/minter-go-node/genesis" + "github.com/MinterTeam/minter-go-node/gui" "github.com/MinterTeam/minter-go-node/log" - "github.com/gobuffalo/packr" "github.com/tendermint/tendermint/libs/common" tmNode "github.com/tendermint/tendermint/node" "github.com/tendermint/tendermint/privval" "github.com/tendermint/tendermint/proxy" "github.com/tendermint/tendermint/types" - "net/http" "os" ) @@ -32,10 +31,9 @@ func main() { app.RunRPC(node) - go runGUI() - if !*utils.DisableApi { go api.RunApi(app, node) + go gui.Run(":3000") } // Wait forever @@ -46,13 +44,6 @@ func main() { }) } -func runGUI() { - box := packr.NewBox("./../../gui") - - http.Handle("/", http.FileServer(box)) - log.Error(http.ListenAndServe(":3000", nil).Error()) -} - func startTendermintNode(app *minter.Blockchain) *tmNode.Node { cfg := config.GetConfig() diff --git a/gui/gui-packr.go b/gui/gui-packr.go new file mode 100644 index 000000000..241652822 --- /dev/null +++ b/gui/gui-packr.go @@ -0,0 +1,11 @@ +// Code generated by github.com/gobuffalo/packr. DO NOT EDIT + +package gui + +import "github.com/gobuffalo/packr" + +// You can use the "packr clean" command to clean up this, +// and any other packr generated files. +func init() { + packr.PackJSONBytes("./html", "index.html", "\"PGh0bWw+CjxoZWFkPgogICAgPG1ldGEgY2hhcnNldD0iVVRGLTgiPgogICAgPG1ldGEgbmFtZT0idmlld3BvcnQiCiAgICAgICAgICBjb250ZW50PSJ3aWR0aD1kZXZpY2Utd2lkdGgsIHVzZXItc2NhbGFibGU9bm8sIGluaXRpYWwtc2NhbGU9MS4wLCBtYXhpbXVtLXNjYWxlPTEuMCwgbWluaW11bS1zY2FsZT0xLjAiPgogICAg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1ib3R0b206IDIwcHg7CiAgICAgICAgfQoKICAgICAgICBodG1sLGJvZHksLmJvZHkgewogICAgICAgICAgICBoZWlnaHQ6IDEwMCU7CiAgICAgICAgfQogICAgICAgIAogICAgICAgIC5ib2R5IHsKICAgICAgICAgICAgcGFkZGluZy10b3A6IDE1cHg7CiAgICAgICAgfQoKICAgICAgICAudGFibGUgewogICAgICAgICAgICBtYXJnaW4tYm90dG9tOiAwOwogICAgICAgICAgICB0YWJsZS1sYXlvdXQ6IGZpeGVkOwogICAgICAgIH0KCiAgICAgICAgLmNhcmQtaGVhZGVyIHsKICAgICAgICAgICAgZm9udC13ZWlnaHQ6IGJvbGQ7CiAgICAgICAgfQoKICAgICAgICAuY2FyZC1oZWFkZXIgewogICAgICAgICAgICBwYWRkaW5nLWxlZnQ6IDEycHg7CiAgICAgICAgfQoKICAgICAgICAuaCB7CiAgICAgICAgICAgIHdpZHRoOiAyMDBweDsKICAgICAgICAgICAgYmFja2dyb3VuZC1jb2xvcjogI2YzZjNmMzsKICAgICAgICAgICAgYm9yZGVyLXJpZ2h0OiAxcHggc29saWQgI2NjYzsKICAgICAgICB9CgogICAgICAgIC5iZy1zdWNjZXNzLCAuYmctZGFuZ2VyIHsKICAgICAgICAgICAgY29sb3I6IHdoaXRlOwogICAgICAgIH0KCiAgICAgICAgLmJnLWRhbmdlciB7CiAgICAgICAgICAgIGJvcmRlci1jb2xvcjogI2RjMzU0NSAhaW1wb3J0YW50OwogICAgICAgIH0KCiAgICAgICAgLmJnLXN1Y2Nlc3MgewogICAgICAgICAgICBib3JkZXItY29sb3I6ICMyOGE3NDUgIWltcG9ydGFudDsKICAgICAgICB9CgogICAgICAgIC5mYS1jaGVjayB7CiAgICAgICAgICAgIGNvbG9yOiBncmVlbjsKICAgICAgICB9CgogICAgICAgIC5mYS1leGNsYW1hdGlvbi1jaXJjbGUgewogICAgICAgICAgICBjb2xvcjogcmVkOwogICAgICAgIH0KICAgIDwvc3R5bGU+CjwvaGVhZD4KPG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SBjbGFzcz0idGFibGUgY2FyZC1ib2R5Ij4KICAgICAgICAgICAgICAgICAgICAgICAgPHRib2R5PgogICAgICAgICAgICAgICAgICAgICAgICA8dHI+CiAgICAgICAgICAgICAgICAgICAgICAgICAgICA8dGQgY2xhc3M9ImgiPk1vbmlrZXI8L3RkPgogICAgICAgICAgICAgICAgICAgICAgICAgICAgPHRkPnt7IHN0YXR1cy5ub2RlX2luZm8ubW9uaWtlciB9fTwvdGQ+CiAgICAgICAgICAgICAgICAgICAgICAgIDwvdHI+CiAgICAgICAgICAgICAgICAgICAgICAgIDx0cj4KICAgICAgICAgICAgICAgICAgICAgICAgICAgIDx0ZCBjbGFzcz0iaCI+Tm9kZSBJRDwvdGQ+CiAgICAgICAgICAgICAgICAgICAgICAgICAgICA8dGQ+e3sgc3RhdHVzLm5vZGVfaW5mby5pZCB9fTwvdGQ+CiAgICAgICAgICAgICAgICAgICAgICAgIDwvdHI+CiAgICAgICAgICAgICAgICAgICAgICAgIDx0cj4KICAgICAgICAgICAgICAgICAgICAgICAgICAgIDx0ZCBjbGFzcz0iaCI+TGlzdGVuIEFkZHI8L3RkPgogICAgICAgICAgICAgICAgICAgICAgICAgICAgPHRkPnt7IHN0YXR1cy5ub2RlX2luZm8ubGlzdGVuX2FkZHIgfX08L3RkPgogICAgICAgICAgICAgICAgICAgICAgICA8L3RyPgogICAgICAgICAgICAgICAgICAgICAgICA8dHI+CiAgICAgICAgICAgICAgICAgICAgICAgICAgICA8dGQgY2xhc3M9ImgiPk5ldHdvcmsgSUQ8L3RkPgogICAgICAgICAgICAgICAgICAgICAgICAgICAgPHRkPnt7IHN0YXR1cy5ub2RlX2luZm8ubmV0d29yayB9fTwvdGQ+CiAgICAgICAgICAgICAgICAgICAgICAgIDwvdHI+CiAgICAgICAgICAgICAgICAgICAgICAgIDx0cj4KICAgICAgICAgICAgICAgICAgICAgICAgICAgIDx0ZCBjbGFzcz0iaCI+TWludGVyIFZlcnNpb248L3RkPgogICAgICAgICAgICAgICAgICAgICAgICAgICAgPHRkPnt7IHZlcnNpb24gfX08L3RkPgogICAgICAgICAgICAgICAgICAgICAgICA8L3RyPgogICAgICAgICAgICAgICAgICAgICAgICA8dHI+CiAgICAgICAgICAgICAgICAgICAgICAgICAgICA8dGQgY2xhc3M9ImgiPlRlbmRlcm1pbnQgVmVyc2lvbjwvdGQ+CiAgICAgICAgICAgICAgICAgICAgICAgICAgICA8dGQ+e3sgc3RhdHVzLm5vZGVfaW5mby52ZXJzaW9uIH19PC90ZD4KICAgICAgICAgICAgICAgICAgICAgICAgPC90cj4KICAgICAgICAgICAgICAgICAgICAgICAgPC90Ym9keT4KICAgICAgICAgICAgICAgICAgICA8L3RhYmxlPgogICAgICAgICAgICAgICAgPC9kaXY+CiAgICAgICAgICAgICAgICA8ZGl2IGNsYXNzPSJjYXJkIiB2LWlmPSJuZXRfaW5mbyI+CiAgICAgICAgICAgICAgICAgICAgPGRpdiBjbGFzcz0iY2FyZC1oZWFkZXIiPgogICAgICAgICAgICAgICAgICAgICAgICBOZXQgSW5mbwogICAgICAgICAgICAgICAgICAgIDwvZGl2PgogICAgICAgICAgICAgICAgICAgIDx0YWJsZSBjbGFzcz0idGFibGUgY2FyZC1ib2R5Ij4KICAgICAgICAgICAgICAgICAgICAgICAgPHRib2R5PgogICAgICAgICAgICAgICAgICAgICAgICA8dHI+CiAgICAgICAgICAgICAgICAgICAgICAgICAgICA8dGQgY2xhc3M9ImgiPklzIExpc3RlbmluZzwvdGQ+CiAgICAgICAgICAgICAgICAgICAgICAgICAgICA8dGQ+PGkgOmNsYXNzPSJ7J2ZhLWNoZWNrJzogbmV0X2luZm8ubGlzdGVuaW5nfSIgY2xhc3M9ImZhcyI+PC9pPjwvdGQ+CiAgICAgICAgICAgICAgICAgICAgICAgIDwvdHI+CiAgICAgICAgICAgICAgICAgICAgICAgIDx0cj4KICAgICAgICAgICAgICAgICAgICAgICAgICAgIDx0ZCBjbGFzcz0iaCI+Q29ubmVjdGVkIFBlZXJzPC90ZD4KICAgICAgICAgICAgICAgICAgICAgICAgICAgIDx0ZD57eyBuZXRfaW5mby5uX3BlZXJzIH19IDxpIDpjbGFzcz0ieydmYS1leGNsYW1hdGlvbi1jaXJjbGUnOiBuZXRfaW5mby5uX3BlZXJzIDwgMX0iIGNsYXNzPSJmYXMiPjwvaT48L3RkPgogICAgICAgICAgICAgICAgICAgICAgICA8L3RyPgogICAgICAgICAgICAgICAgICAgICAgICA8L3Rib2R5PgogICAgICAgICAgICAgICAgICAgIDwvdGFibGU+CiAgICAgICAgICAgICAgICA8L2Rpdj4KICAgICAgICAgICAgPC9kaXY+CiAgICAgICAgICAgIDxkaXYgY2xhc3M9ImNvbCI+CiAgICAgICAgICAgICAgICA8ZGl2IGNsYXNzPSJjYXJkIj4KICAgICAgICAgICAgICAgICAgICA8ZGl2IGNsYXNzPSJjYXJkLWhlYWRlciI+CiAgICAgICAgICAgICAgICAgICAgICAgIFN5bmNpbmcgSW5mbwogICAgICAgICAgICAgICAgICAgIDwvZGl2PgogICAgICAgICAgICAgICAgICAgIDx0YWJsZSBjbGFzcz0idGFibGUgY2FyZC1ib2R5Ij4KICAgICAgICAgICAgICAgICAgICAgICAgPHRib2R5PgogICAgICAgICAgICAgICAgICAgICAgICA8dHI+CiAgICAgICAgICAgICAgICAgICAgICAgICAgICA8dGQgY2xhc3M9ImgiPklzIFN5bmNlZDwvdGQ+CiAgICAgICAgICAgICAgICAgICAgICAgICAgICA8dGQ+CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPHNwYW4gdi1pZj0ic3RhdHVzLnN5bmNfaW5mby5jYXRjaGluZ191cCI+Tm88L3NwYW4+CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPHNwYW4gdi1pZj0iIXN0YXR1cy5zeW5jX2luZm8uY2F0Y2hpbmdfdXAiPlllczwvc3Bhbj4KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA8aSA6Y2xhc3M9InsnZmEtY2hlY2snOiAhc3RhdHVzLnN5bmNfaW5mby5jYXRjaGluZ191cCwgJ2ZhLWV4Y2xhbWF0aW9uLWNpcmNsZSc6IHN0YXR1cy5zeW5jX2luZm8uY2F0Y2hpbmdfdXB9IiBjbGFzcz0iZmFzIj48L2k+PC90ZD4KICAgICAgICAgICAgICAgICAgICAgICAgPC90cj4KICAgICAgICAgICAgICAgICAgICAgICAgPHRyPgogICAgICAgICAgICAgICAgICAgICAgICAgICAgPHRkIGNsYXNzPSJoIj5MYXRlc3QgQmxvY2s8L3RkPgogICAgICAgICAgICAgICAgICAgICAgICAgICAgPHRkPgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICN7eyBzdGF0dXMuc3luY19pbmZvLmxhdGVzdF9ibG9ja19oZWlnaHQgfX0gPHNwYW4KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2xhc3M9InRleHQtbXV0ZWQiPmF0IHt7IHN0YXR1cy5zeW5jX2luZm8ubGF0ZXN0X2Jsb2NrX3RpbWUgfX08L3NwYW4+CiAgICAgICAgICAgICAgICAgICAgICAgICAgICA8L3RkPgogICAgICAgICAgICAgICAgICAgICAgICA8L3RyPgogICAgICAgICAgICAgICAgICAgICAgICA8L3Rib2R5PgogICAgICAgICAgICAgICAgICAgIDwvdGFibGU+CiAgICAgICAgICAgICAgICA8L2Rpdj4KICAgICAgICAgICAgICAgIDxkaXYgY2xhc3M9ImNhcmQiPgogICAgICAgICAgICAgICAgICAgIDxkaXYgY2xhc3M9ImNhcmQtaGVhZGVyIj4KICAgICAgICAgICAgICAgICAgICAgICAgVmFsaWRhdG9yIEluZm8KICAgICAgICAgICAgICAgICAgICA8L2Rpdj4KICAgICAgICAgICAgICAgICAgICA8dGFibGUgY2xhc3M9InRhYmxlIGNhcmQtYm9keSI+CiAgICAgICAgICAgICAgICAgICAgICAgIDx0Ym9keT4KICAgICAgICAgICAgICAgICAgICAgICAgPHRyPgogICAgICAgICAgICAgICAgICAgICAgICAgICAgPHRkPlB1YmxpYyBLZXk8L3RkPgogICAgICAgICAgICAgICAgICAgICAgICAgICAgPHRkPk1we3sgYmFzZTY0VG9IZXgoc3RhdHVzLnZhbGlkYXRvcl9pbmZvLnB1Yl9rZXkudmFsdWUpIH19PC90ZD4KICAgICAgICAgICAgICAgICAgICAgICAgPC90cj4KICAgICAgICAgICAgICAgICAgICAgICAgPHRyPgogICAgICAgICAgICAgICAgICAgICAgICAgICAgPHRkPlZvdGluZyBQb3dlcjwvdGQ+CiAgICAgICAgICAgICAgICAgICAgICAgICAgICA8dGQ+e3sgbmljZU51bShzdGF0dXMudmFsaWRhdG9yX2luZm8udm90aW5nX3Bvd2VyKSB9fSA8c3BhbiBjbGFzcz0idGV4dC1tdXRlZCI+b2YgMTAwLDAwMCwwMDA8L3NwYW4+PC90ZD4KICAgICAgICAgICAgICAgICAgICAgICAgPC90cj4KICAgICAgICAgICAgICAgICAgICAgICAgPC90Ym9keT4KICAgICAgICAgICAgICAgICAgICA8L3RhYmxlPgogICAgICAgICAgICAgICAgPC9kaXY+CiAgICAgICAgICAgIDwvZGl2PgogICAgICAgIDwvZGl2PgogICAgPC9kaXY+CjwvZGl2Pgo8c2NyaXB0PgogICAgbmV3IFZ1ZSh7CiAgICAgICAgZWw6ICcjYXBwJywKICAgICAgICBkYXRhOiB7CiAgICAgICAgICAgIHN0YXR1czogbnVsbCwKICAgICAgICAgICAgdmVyc2lvbjogbnVsbCwKICAgICAgICAgICAgbmV0X2luZm86IG51bGwsCiAgICAgICAgICAgIGVycm9yOiBudWxsCiAgICAgICAgfSwKICAgICAgICBtb3VudGVkKCkgewogICAgICAgICAgICB0aGlzLnJlZnJlc2goKQoKICAgICAgICAgICAgc2V0SW50ZXJ2YWwodGhpcy5yZWZyZXNoLCAxMDAwKQogICAgICAgIH0sCiAgICAgICAgbWV0aG9kczogewogICAgICAgICAgICBuaWNlTnVtKG51bSkgewogICAgICAgICAgICAgICAgcmV0dXJuIG51bS50b1N0cmluZygpLnJlcGxhY2UoL1xCKD89KFxkezN9KSsoPyFcZCkpL2csICIsIikKICAgICAgICAgICAgfSwKICAgICAgICAgICAgYmFzZTY0VG9IZXgoYmFzZTY0KSB7CiAgICAgICAgICAgICAgICByZXR1cm4gQ3J5cHRvSlMuZW5jLkJhc2U2NC5wYXJzZShiYXNlNjQpLnRvU3RyaW5nKCkKICAgICAgICAgICAgfSwKICAgICAgICAgICAgcmVmcmVzaCgpIHsKICAgICAgICAgICAgICAgIGF4aW9zLmdldCgiLy8iICsgd2luZG93LmxvY2F0aW9uLmhvc3RuYW1lICsgJzo4ODQxL2FwaS9zdGF0dXMnKS50aGVuKGZ1bmN0aW9uIChkYXRhKSB7CiAgICAgICAgICAgICAgICAgICAgdGhpcy5zdGF0dXMgPSBkYXRhLmRhdGEucmVzdWx0LnRtX3N0YXR1cwogICAgICAgICAgICAgICAgICAgIHRoaXMudmVyc2lvbiA9IGRhdGEuZGF0YS5yZXN1bHQudmVyc2lvbgogICAgICAgICAgICAgICAgICAgIHRoaXMuZXJyb3IgPSBudWxsCiAgICAgICAgICAgICAgICB9LmJpbmQodGhpcykpLmNhdGNoKGZ1bmN0aW9uIChyZWFzb24pIHsKICAgICAgICAgICAgICAgICAgICB0aGlzLmVycm9yID0gcmVhc29uLnRvU3RyaW5nKCk7CiAgICAgICAgICAgICAgICB9LmJpbmQodGhpcykpCgogICAgICAgICAgICAgICAgYXhpb3MuZ2V0KCIvLyIgKyB3aW5kb3cubG9jYXRpb24uaG9zdG5hbWUgKyAnOjg4NDEvYXBpL25ldF9pbmZvJykudGhlbihmdW5jdGlvbiAoZGF0YSkgewogICAgICAgICAgICAgICAgICAgIHRoaXMubmV0X2luZm8gPSBkYXRhLmRhdGEucmVzdWx0CiAgICAgICAgICAgICAgICAgICAgdGhpcy5lcnJvciA9IG51bGwKICAgICAgICAgICAgICAgIH0uYmluZCh0aGlzKSkuY2F0Y2goZnVuY3Rpb24gKHJlYXNvbikgewogICAgICAgICAgICAgICAgICAgIHRoaXMuZXJyb3IgPSByZWFzb24udG9TdHJpbmcoKTsKICAgICAgICAgICAgICAgIH0uYmluZCh0aGlzKSkKICAgICAgICAgICAgfQogICAgICAgIH0KICAgIH0pCjwvc2NyaXB0Pgo8L2JvZHk+CjwvaHRtbD4=\"") +} diff --git a/gui/gui.go b/gui/gui.go new file mode 100644 index 000000000..d051a4ebc --- /dev/null +++ b/gui/gui.go @@ -0,0 +1,14 @@ +package gui + +import ( + "github.com/MinterTeam/minter-go-node/log" + "github.com/gobuffalo/packr" + "net/http" +) + +func Run(addr string) { + box := packr.NewBox("./html") + + http.Handle("/", http.FileServer(box)) + log.Error(http.ListenAndServe(addr, nil).Error()) +} diff --git a/gui/index.html b/gui/html/index.html similarity index 100% rename from gui/index.html rename to gui/html/index.html diff --git a/version/version.go b/version/version.go index 530d8309c..60167ef25 100755 --- a/version/version.go +++ b/version/version.go @@ -4,12 +4,12 @@ package version const ( Maj = "0" Min = "1" - Fix = "2" + Fix = "3" ) var ( // Must be a string because scripts like dist.sh read this file. - Version = "0.1.2" + Version = "0.1.3" // GitCommit is the current HEAD set using ldflags. GitCommit string From 913b5df1ce7d46810662da81202188c52433ee68 Mon Sep 17 00:00:00 2001 From: Daniil Lashin Date: Wed, 25 Jul 2018 11:47:41 +0300 Subject: [PATCH 2/2] update tendermint version --- Gopkg.lock | 327 +++++++++++++++++++++++++++++++------------- Gopkg.toml | 12 +- api/api.go | 4 +- api/transactions.go | 1 - cmd/minter/main.go | 5 +- genesis/genesis.go | 33 +++-- 6 files changed, 264 insertions(+), 118 deletions(-) diff --git a/Gopkg.lock b/Gopkg.lock index 43a283c11..8e9c3b4db 100644 --- a/Gopkg.lock +++ b/Gopkg.lock @@ -1,6 +1,5 @@ # This file is autogenerated, do not edit; changes may be undone by the next 'dep ensure'. - [[projects]] branch = "master" name = "github.com/beorn7/perks" @@ -11,7 +10,16 @@ branch = "master" name = "github.com/btcsuite/btcd" packages = ["btcec"] - revision = "fdfc19097e7ac6b57035062056f5b7b4638b8898" + pruneopts = "UT" + revision = "f673a4b563b57b9a95832545c878669a7fa801d9" + +[[projects]] + name = "github.com/btcsuite/btcutil" + packages = [ + "base58", + "bech32" + ] + revision = "d4cc87b860166d00d6b5b9e0d3b3d71d6088d4d4" [[projects]] name = "github.com/davecgh/go-spew" @@ -24,6 +32,18 @@ packages = ["."] revision = "95f809107225be108efcf10a3509e4ea6ceef3c4" +[[projects]] + name = "github.com/fortytw2/leaktest" + packages = ["."] + revision = "a5ef70473c97b71626b9abeda80ee92ba2a7de9e" + version = "v1.2.0" + +[[projects]] + name = "github.com/fsnotify/fsnotify" + packages = ["."] + revision = "c2828203cd70a50dcccfb2761f8b1f8ceef9a8e9" + version = "v1.4.7" + [[projects]] name = "github.com/go-kit/kit" packages = [ @@ -50,12 +70,6 @@ revision = "259ab82a6cad3992b4e21ff5cac294ccb06474bc" version = "v1.7.0" -[[projects]] - name = "github.com/gobuffalo/packr" - packages = ["."] - revision = "bd47f2894846e32edcf9aa37290fef76c327883f" - version = "v1.11.1" - [[projects]] name = "github.com/gogo/protobuf" packages = [ @@ -66,8 +80,8 @@ "sortkeys", "types" ] - revision = "1adfc126b41513cc696b209667c8656ea7aac67c" - version = "v1.0.0" + revision = "7d68e886eac4f7e34d0d82241a6273d6c304c5cf" + version = "v1.1.0" [[projects]] name = "github.com/golang/protobuf" @@ -78,8 +92,8 @@ "ptypes/duration", "ptypes/timestamp" ] - revision = "925541529c1fa6821df4e44ce2723319eb2be768" - version = "v1.0.0" + revision = "b4deda0973fb4c70b50d226b1af49f3da59f5265" + version = "v1.1.0" [[projects]] branch = "master" @@ -87,18 +101,6 @@ packages = ["."] revision = "2e65f85255dbc3072edf28d6b5b8efc472979f5a" -[[projects]] - name = "github.com/gorilla/context" - packages = ["."] - revision = "08b5f424b9271eedf6f9f0ce86cb9396ed337a42" - version = "v1.1.1" - -[[projects]] - name = "github.com/gorilla/mux" - packages = ["."] - revision = "e3702bed27f0d39777b0b37b664b6280e8ef8fbf" - version = "v1.6.2" - [[projects]] name = "github.com/gorilla/websocket" packages = ["."] @@ -107,12 +109,25 @@ [[projects]] branch = "master" - name = "github.com/hashicorp/golang-lru" + name = "github.com/hashicorp/hcl" packages = [ ".", - "simplelru" + "hcl/ast", + "hcl/parser", + "hcl/scanner", + "hcl/strconv", + "hcl/token", + "json/parser", + "json/scanner", + "json/token" ] - revision = "0fb14efe8c47ae851c0034ed7a448854d3d34cf3" + revision = "ef8a98b0bbce4a65b5aa4c368430a80ddc533168" + +[[projects]] + name = "github.com/inconshreveable/mousetrap" + packages = ["."] + revision = "76626ae9c91c4f2a10f34cad8ce83ea42c93bb75" + version = "v1.0" [[projects]] branch = "master" @@ -127,16 +142,10 @@ revision = "b84e30acd515aadc4b783ad4ff83aff3299bdfe0" [[projects]] - name = "github.com/kr/pretty" - packages = ["."] - revision = "73f6ac0b30a98e433b289500d779f50c1a6f0712" - version = "v0.1.0" - -[[projects]] - name = "github.com/kr/text" + name = "github.com/magiconair/properties" packages = ["."] - revision = "e2ffdb16a802fe2bb95e2e35ff34f0e53aeef34f" - version = "v0.1.0" + revision = "c2353362d570a7bfa228149c62842019201cfb71" + version = "v1.8.0" [[projects]] name = "github.com/matttproud/golang_protobuf_extensions" @@ -144,12 +153,32 @@ revision = "c12348ce28de40eed0136aa2b644d0ee0650e56c" version = "v1.0.1" +[[projects]] + branch = "master" + digest = "1:5ab79470a1d0fb19b041a624415612f8236b3c06070161a910562f2b2d064355" + name = "github.com/mitchellh/mapstructure" + packages = ["."] + pruneopts = "UT" + revision = "f15292f7a699fcc1a38a80977f80a046874ba8ac" + +[[projects]] + name = "github.com/pelletier/go-toml" + packages = ["."] + revision = "c01d1270ff3e442a8a57cddc1c92dc1138598194" + version = "v1.2.0" + [[projects]] name = "github.com/pkg/errors" packages = ["."] revision = "645ef00459ed84a119197bfb8d8205042c6df63d" version = "v0.8.0" +[[projects]] + name = "github.com/pmezard/go-difflib" + packages = ["difflib"] + revision = "792786c7400a136282c1664665ae0a8db921c6c2" + version = "v1.0.0" + [[projects]] name = "github.com/prometheus/client_golang" packages = [ @@ -160,9 +189,11 @@ [[projects]] branch = "master" + digest = "1:0f37e09b3e92aaeda5991581311f8dbf38944b36a3edec61cc2d1991f527554a" name = "github.com/prometheus/client_model" packages = ["go"] - revision = "99fa1f4be8e564e8a6b613da7fa6f46c9edafc6c" + pruneopts = "UT" + revision = "5c3871d89910bfb32f5fcab2aa4b9ec68e65a99f" [[projects]] branch = "master" @@ -191,10 +222,52 @@ revision = "e2704e165165ec55d062f5919b4b29494e9fa790" [[projects]] - name = "github.com/rs/cors" + name = "github.com/spf13/afero" + packages = [ + ".", + "mem" + ] + revision = "787d034dfe70e44075ccc060d346146ef53270ad" + version = "v1.1.1" + +[[projects]] + name = "github.com/spf13/cast" packages = ["."] - revision = "ca016a06a5753f8ba03029c0aa5e54afb1bf713f" - version = "v1.4.0" + revision = "8965335b8c7107321228e3e3702cab9832751bac" + version = "v1.2.0" + +[[projects]] + name = "github.com/spf13/cobra" + packages = ["."] + revision = "7b2c5ac9fc04fc5efafb60700713d4fa609b777b" + version = "v0.0.1" + +[[projects]] + branch = "master" + name = "github.com/spf13/jwalterweatherman" + packages = ["."] + revision = "7c0cea34c8ece3fbeb2b27ab9b59511d360fb394" + +[[projects]] + name = "github.com/spf13/pflag" + packages = ["."] + revision = "583c0c0531f06d5278b7d917446061adc344b5cd" + version = "v1.0.1" + +[[projects]] + name = "github.com/spf13/viper" + packages = ["."] + revision = "25b30aa063fc18e48662b86996252eabdcf2f0c7" + version = "v1.0.0" + +[[projects]] + name = "github.com/stretchr/testify" + packages = [ + "assert", + "require" + ] + revision = "12b6f73e6084dad08a7c6e575284b177ecafbc71" + version = "v1.2.1" [[projects]] branch = "master" @@ -231,62 +304,16 @@ revision = "2106ca61d91029c931fd54968c2bb02dc96b1412" version = "0.10.1" -[[projects]] - name = "github.com/tendermint/tendermint" - packages = [ - "abci/client", - "abci/example/code", - "abci/example/kvstore", - "abci/types", - "blockchain", - "config", - "consensus", - "consensus/types", - "crypto", - "crypto/merkle", - "crypto/tmhash", - "evidence", - "libs/autofile", - "libs/cli/flags", - "libs/clist", - "libs/common", - "libs/db", - "libs/events", - "libs/flowrate", - "libs/log", - "libs/pubsub", - "libs/pubsub/query", - "mempool", - "node", - "p2p", - "p2p/conn", - "p2p/pex", - "p2p/upnp", - "privval", - "proxy", - "rpc/client", - "rpc/core", - "rpc/core/types", - "rpc/grpc", - "rpc/lib", - "rpc/lib/client", - "rpc/lib/server", - "rpc/lib/types", - "state", - "state/txindex", - "state/txindex/kv", - "state/txindex/null", - "types", - "version" - ] - revision = "c64a3c74c870d725ba1356f75b4afadf0928c297" - version = "v0.22.4" - [[projects]] branch = "master" name = "golang.org/x/crypto" packages = [ + "bcrypt", + "blowfish", + "chacha20poly1305", "curve25519", + "hkdf", + "internal/chacha20", "internal/subtle", "nacl/box", "nacl/secretbox", @@ -296,7 +323,7 @@ "ripemd160", "salsa20/salsa" ] - revision = "a49355c7e3f8fe157a85be2f77e6e269a0f89602" + revision = "a2144134853fc9a27a7b1e3eb4f19f1a76df13c9" [[projects]] name = "golang.org/x/net" @@ -312,6 +339,16 @@ ] revision = "292b43bbf7cb8d35ddf40f8d5100ef3837cced3f" +[[projects]] + branch = "master" + name = "golang.org/x/sys" + packages = [ + "cpu", + "unix" + ] + pruneopts = "UT" + revision = "ac767d655b305d4e9612f5f6e33120b9176c4ad4" + [[projects]] name = "golang.org/x/text" packages = [ @@ -334,7 +371,6 @@ version = "v0.3.0" [[projects]] - branch = "master" name = "google.golang.org/genproto" packages = ["googleapis/rpc/status"] revision = "7fd901a49ba6a7f87732eb344f6e3c5b19d1b200" @@ -351,9 +387,11 @@ "credentials", "encoding", "encoding/proto", - "grpclb/grpc_lb_v1/messages", "grpclog", "internal", + "internal/backoff", + "internal/channelz", + "internal/grpcrand", "keepalive", "metadata", "naming", @@ -366,8 +404,103 @@ "tap", "transport" ] - revision = "d11072e7ca9811b1100b80ca0269ac831f06d024" - version = "v1.11.3" + revision = "168a6198bcb0ef175f7dacec0b8691fc141dc9b8" + version = "v1.13.0" + +[[projects]] + name = "gopkg.in/yaml.v2" + packages = ["."] + revision = "5420a8b6744d3b0345ab293f6fcba19c978f1183" + version = "v2.2.1" + + +[[projects]] + name = "github.com/gobuffalo/packr" + packages = ["."] + revision = "bd47f2894846e32edcf9aa37290fef76c327883f" + version = "v1.11.1" + + +[[projects]] + name = "github.com/gorilla/context" + packages = ["."] + revision = "08b5f424b9271eedf6f9f0ce86cb9396ed337a42" + version = "v1.1.1" + +[[projects]] + name = "github.com/gorilla/mux" + packages = ["."] + revision = "e3702bed27f0d39777b0b37b664b6280e8ef8fbf" + version = "v1.6.2" + +[[projects]] + branch = "master" + name = "github.com/hashicorp/golang-lru" + packages = [ + ".", + "simplelru" + ] + revision = "0fb14efe8c47ae851c0034ed7a448854d3d34cf3" + +[[projects]] + name = "github.com/rs/cors" + packages = ["."] + revision = "ca016a06a5753f8ba03029c0aa5e54afb1bf713f" + version = "v1.4.0" + +[[projects]] + name = "github.com/tendermint/tendermint" + packages = [ + "abci/client", + "abci/example/code", + "abci/example/kvstore", + "abci/types", + "blockchain", + "config", + "consensus", + "consensus/types", + "crypto", + "crypto/ed25519", + "crypto/encoding/amino", + "crypto/merkle", + "crypto/secp256k1", + "crypto/tmhash", + "evidence", + "libs/autofile", + "libs/cli/flags", + "libs/clist", + "libs/common", + "libs/db", + "libs/events", + "libs/flowrate", + "libs/log", + "libs/pubsub", + "libs/pubsub/query", + "mempool", + "node", + "p2p", + "p2p/conn", + "p2p/pex", + "p2p/upnp", + "privval", + "proxy", + "rpc/client", + "rpc/core", + "rpc/core/types", + "rpc/grpc", + "rpc/lib", + "rpc/lib/client", + "rpc/lib/server", + "rpc/lib/types", + "state", + "state/txindex", + "state/txindex/kv", + "state/txindex/null", + "types", + "version" + ] + revision = "05a76fb517f50da27b4bfcdc7b4cf185fc61eff6" + version = "v0.22.5" [[projects]] branch = "v1" @@ -384,6 +517,6 @@ [solve-meta] analyzer-name = "dep" analyzer-version = 1 - inputs-digest = "23202c1428a7bc0a7a1946e1c160b380ef49332be93b6b091750e567f0bea609" + inputs-digest = "0c00c4ef3b5dae08862bdd14374399760400e46e677eb32a0c291d55eb25067d" solver-name = "gps-cdcl" solver-version = 1 diff --git a/Gopkg.toml b/Gopkg.toml index 06c0d48ad..24dcd5f45 100644 --- a/Gopkg.toml +++ b/Gopkg.toml @@ -31,15 +31,15 @@ [[constraint]] name = "github.com/gobuffalo/packr" - version = "1.11.1" + version = "=1.11.1" [[constraint]] name = "github.com/gorilla/mux" - version = "1.6.2" + version = "=1.6.2" [[constraint]] name = "github.com/gorilla/websocket" - version = "1.2.0" + version = "=1.2.0" [[constraint]] branch = "master" @@ -51,7 +51,7 @@ [[constraint]] name = "github.com/rs/cors" - version = "1.4.0" + version = "=1.4.0" [[constraint]] branch = "master" @@ -59,11 +59,11 @@ [[constraint]] name = "github.com/tendermint/go-amino" - version = "0.10.1" + version = "=v0.11.1" [[constraint]] name = "github.com/tendermint/tendermint" - version = "0.22.4" + version = "v0.22.5" [[constraint]] branch = "v1" diff --git a/api/api.go b/api/api.go index d36218b62..2fa54a553 100644 --- a/api/api.go +++ b/api/api.go @@ -11,7 +11,7 @@ import ( "github.com/MinterTeam/minter-go-node/core/minter" "github.com/MinterTeam/minter-go-node/core/state" "github.com/tendermint/go-amino" - "github.com/tendermint/tendermint/crypto" + "github.com/tendermint/tendermint/crypto/encoding/amino" "github.com/tendermint/tendermint/node" rpc "github.com/tendermint/tendermint/rpc/client" "strconv" @@ -25,7 +25,7 @@ var ( ) func init() { - crypto.RegisterAmino(cdc) + cryptoAmino.RegisterAmino(cdc) } func RunApi(b *minter.Blockchain, node *node.Node) { diff --git a/api/transactions.go b/api/transactions.go index 4dba95f76..790a1f60e 100644 --- a/api/transactions.go +++ b/api/transactions.go @@ -34,7 +34,6 @@ type ResponseDeliverTx struct { GasWanted int64 `protobuf:"varint,5,opt,name=gas_wanted,json=gas_wanted,proto3" json:"gas_wanted,omitempty"` GasUsed int64 `protobuf:"varint,6,opt,name=gas_used,json=gas_used,proto3" json:"gas_used,omitempty"` Tags []common.KVPair `protobuf:"bytes,7,rep,name=tags" json:"tags,omitempty"` - Fee common.KI64Pair `protobuf:"bytes,8,opt,name=fee" json:"fee"` } type ResultTxSearch struct { diff --git a/cmd/minter/main.go b/cmd/minter/main.go index 041b1a92d..db108a41e 100644 --- a/cmd/minter/main.go +++ b/cmd/minter/main.go @@ -13,7 +13,6 @@ import ( tmNode "github.com/tendermint/tendermint/node" "github.com/tendermint/tendermint/privval" "github.com/tendermint/tendermint/proxy" - "github.com/tendermint/tendermint/types" "os" ) @@ -52,9 +51,7 @@ func startTendermintNode(app *minter.Blockchain) *tmNode.Node { cfg, privval.LoadOrGenFilePV(cfg.PrivValidatorFile()), proxy.NewLocalClientCreator(app), - func() (*types.GenesisDoc, error) { - return genesis.GetTestnetGenesis(), nil - }, + genesis.GetTestnetGenesis, tmNode.DefaultDBProvider, tmNode.DefaultMetricsProvider, log.With("module", "tendermint"), diff --git a/genesis/genesis.go b/genesis/genesis.go index ccc8503f0..82c22a496 100644 --- a/genesis/genesis.go +++ b/genesis/genesis.go @@ -6,20 +6,29 @@ import ( "encoding/json" "github.com/MinterTeam/minter-go-node/core/types" "github.com/MinterTeam/minter-go-node/helpers" - "github.com/tendermint/tendermint/crypto" + "github.com/tendermint/tendermint/crypto/ed25519" "github.com/tendermint/tendermint/libs/common" tmtypes "github.com/tendermint/tendermint/types" "math/big" "time" ) -func GetTestnetGenesis() *tmtypes.GenesisDoc { +func GetTestnetGenesis() (*tmtypes.GenesisDoc, error) { - validatorPubKeyBytes, _ := base64.StdEncoding.DecodeString("SuHuc+YTbIWwypM6mhNHdYozSIXxCzI4OYpnrC6xU7g=") - var validatorPubKey crypto.PubKeyEd25519 + validatorPubKeyBytes, err := base64.StdEncoding.DecodeString("SuHuc+YTbIWwypM6mhNHdYozSIXxCzI4OYpnrC6xU7g=") + + if err != nil { + return nil, err + } + + var validatorPubKey ed25519.PubKeyEd25519 copy(validatorPubKey[:], validatorPubKeyBytes) - appHash, _ := hex.DecodeString("0000000000000000000000000000000000000000000000000000000000000000") + appHash, err := hex.DecodeString("0000000000000000000000000000000000000000000000000000000000000000") + + if err != nil { + return nil, err + } appState := AppState{ FirstValidatorAddress: types.HexToAddress("Mxa93163fdf10724dc4785ff5cbfb9ac0b5949409f"), @@ -39,7 +48,11 @@ func GetTestnetGenesis() *tmtypes.GenesisDoc { }, } - appStateJSON, _ := json.Marshal(appState) + appStateJSON, err := json.Marshal(appState) + + if err != nil { + return nil, err + } genesis := tmtypes.GenesisDoc{ GenesisTime: time.Date(2018, 7, 23, 0, 0, 0, 0, time.UTC), @@ -55,9 +68,13 @@ func GetTestnetGenesis() *tmtypes.GenesisDoc { AppState: json.RawMessage([]byte(appStateJSON)), } - genesis.ValidateAndComplete() + err = genesis.ValidateAndComplete() + + if err != nil { + return nil, err + } - return &genesis + return &genesis, nil } type AppState struct {