Commit 828077d9 authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent 3ad0b220
...@@ -208,15 +208,21 @@ const storageSummary = "run NEO storage node" ...@@ -208,15 +208,21 @@ const storageSummary = "run NEO storage node"
func storageUsage(w io.Writer) { func storageUsage(w io.Writer) {
fmt.Fprintf(w, fmt.Fprintf(w,
`neostorage runs one NEO storage server. `Usage: neo storage [options] zstor XXX
Run NEO storage node.
Usage: neostorage [options] zstor XXX
`) `)
// FIXME use w (see flags.SetOutput)
} }
func storageMain(argv []string) { func storageMain(argv []string) {
flags := flag.FlagSet{Usage: func() { storageUsage(os.Stderr) }} var bind string
flags.Init("", flag.ExitOnError)
//flags := flag.FlagSet{Usage: func() { storageUsage(os.Stderr) }}
//flags.Init("", flag.ExitOnError)
flags := flag.NewFlagSet("", flag.ExitOnError)
flags.Usage = func() { storageUsage(os.Stderr); flags.PrintDefaults() } // XXX prettify
flags.StringVar(&bind, "bind", bind, "address to serve on")
flags.Parse(argv[1:]) flags.Parse(argv[1:])
argv = flags.Args() argv = flags.Args()
...@@ -242,7 +248,7 @@ func storageMain(argv []string) { ...@@ -242,7 +248,7 @@ func storageMain(argv []string) {
*/ */
ctx := context.Background() ctx := context.Background()
err = ListenAndServe(ctx, "tcp", "localhost:1234", storsrv) // XXX hardcoded err = ListenAndServe(ctx, "tcp", bind, storsrv) // XXX hardcoded
if err != nil { if err != nil {
log.Fatal(err) log.Fatal(err)
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment