From fbc09a415eef4f453fc59b7fa81445583a4da6a4 Mon Sep 17 00:00:00 2001 From: AnnaShaleva Date: Mon, 1 Nov 2021 11:15:35 +0300 Subject: [PATCH 1/2] *: fix build errors on windows --- cli/input/input.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/cli/input/input.go b/cli/input/input.go index 7dbc4a70a..fe2fc9af9 100644 --- a/cli/input/input.go +++ b/cli/input/input.go @@ -25,11 +25,11 @@ type ReadWriter struct { func ReadLine(prompt string) (string, error) { trm := Terminal if trm == nil { - s, err := term.MakeRaw(syscall.Stdin) + s, err := term.MakeRaw(int(syscall.Stdin)) if err != nil { panic(err) } - defer func() { _ = term.Restore(syscall.Stdin, s) }() + defer func() { _ = term.Restore(int(syscall.Stdin), s) }() trm = term.NewTerminal(ReadWriter{ Reader: os.Stdin, Writer: os.Stdout, @@ -50,11 +50,11 @@ func readLine(trm *term.Terminal, prompt string) (string, error) { func ReadPassword(prompt string) (string, error) { trm := Terminal if trm == nil { - s, err := term.MakeRaw(syscall.Stdin) + s, err := term.MakeRaw(int(syscall.Stdin)) if err != nil { panic(err) } - defer func() { _ = term.Restore(syscall.Stdin, s) }() + defer func() { _ = term.Restore(int(syscall.Stdin), s) }() trm = term.NewTerminal(ReadWriter{os.Stdin, os.Stdout}, prompt) } return trm.ReadPassword(prompt) From 29552489f1b2e92696a0873e292b99884d3db93d Mon Sep 17 00:00:00 2001 From: AnnaShaleva Date: Mon, 1 Nov 2021 12:02:43 +0300 Subject: [PATCH 2/2] Makefile: build to './bin/neo-go.exe' on windows '.exe' extension is needed to automatically run the binary on win. --- Makefile | 7 ++++++- README.md | 13 +++++++++++++ 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index e84bfcafd..f32b692b5 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,12 @@ BRANCH = "master" REPONAME = "neo-go" NETMODE ?= "privnet" -BINARY = "./bin/neo-go" +GOOS ?= $(shell go env GOOS) +EXTENSION= +ifeq ($(GOOS),windows) + EXTENSION=".exe" +endif +BINARY=./bin/neo-go$(EXTENSION) DESTDIR = "" SYSCONFIGDIR = "/etc" BINDIR = "/usr/bin" diff --git a/README.md b/README.md index f91dd9983..c64aa0f6d 100644 --- a/README.md +++ b/README.md @@ -56,6 +56,19 @@ make build The resulting binary is `bin/neo-go`. +#### Building on Windows + +To build NeoGo on Windows platform we recommend you to install `make` from [MinGW +package](https://osdn.net/projects/mingw/). Then you can build NeoGo with: + +``` +make build +``` + +The resulting binary is `bin/neo-go.exe`. + +We also recommend you to switch the Windows Firewall off for further NeoGo node run. + ## Running a node A node needs to connect to some network, either local one (usually referred to