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

.

parent 3ad0b220
......@@ -208,15 +208,21 @@ const storageSummary = "run NEO storage node"
func storageUsage(w io.Writer) {
fmt.Fprintf(w,
`neostorage runs one NEO storage server.
Usage: neostorage [options] zstor XXX
`Usage: neo storage [options] zstor XXX
Run NEO storage node.
`)
// FIXME use w (see flags.SetOutput)
}
func storageMain(argv []string) {
flags := flag.FlagSet{Usage: func() { storageUsage(os.Stderr) }}
flags.Init("", flag.ExitOnError)
var bind string
//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:])
argv = flags.Args()
......@@ -242,7 +248,7 @@ func storageMain(argv []string) {
*/
ctx := context.Background()
err = ListenAndServe(ctx, "tcp", "localhost:1234", storsrv) // XXX hardcoded
err = ListenAndServe(ctx, "tcp", bind, storsrv) // XXX hardcoded
if err != nil {
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