mirror of
https://github.com/nspcc-dev/neo-go.git
synced 2025-01-09 11:19:06 +00:00
31 lines
618 B
Go
31 lines
618 B
Go
package main
|
|
|
|
import (
|
|
"flag"
|
|
"strings"
|
|
|
|
"github.com/anthdm/neo-go/pkg/network"
|
|
)
|
|
|
|
var (
|
|
port = flag.String("port", ":3000", "port the TCP listener will listen on.")
|
|
seed = flag.String("seed", "", "initial seed servers.")
|
|
)
|
|
|
|
// Simple dirty and quick bootstrapping for the sake of development.
|
|
// e.g run 2 nodes:
|
|
// neoserver -port :4000
|
|
// neoserver -port :3000 -seed 127.0.0.1:4000
|
|
func main() {
|
|
flag.Parse()
|
|
|
|
s := network.NewServer(network.ModeTestNet)
|
|
seeds := strings.Split(*seed, ",")
|
|
if len(seeds) == 0 {
|
|
seeds = []string{*seed}
|
|
}
|
|
if *seed == "" {
|
|
seeds = []string{}
|
|
}
|
|
s.Start(*port, seeds)
|
|
}
|