diff options
author | Zsolt Felfoldi <zsfelfoldi@gmail.com> | 2016-10-19 19:04:55 +0800 |
---|---|---|
committer | Felix Lange <fjl@twurst.com> | 2016-11-09 09:12:53 +0800 |
commit | 49da42983af7a775695166689e5bf701bcec4f81 (patch) | |
tree | 2c325a4852695697cc9616a3eac99a432711abdb /cmd/bootnode/main.go | |
parent | 7db7109a5b53c339f00e9c05ac826b3dbd1f98e1 (diff) | |
download | go-tangerine-49da42983af7a775695166689e5bf701bcec4f81.tar.gz go-tangerine-49da42983af7a775695166689e5bf701bcec4f81.tar.zst go-tangerine-49da42983af7a775695166689e5bf701bcec4f81.zip |
p2p/discv5: added new topic discovery package
Diffstat (limited to 'cmd/bootnode/main.go')
-rw-r--r-- | cmd/bootnode/main.go | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/cmd/bootnode/main.go b/cmd/bootnode/main.go index 40d3cdc17..abecac3d8 100644 --- a/cmd/bootnode/main.go +++ b/cmd/bootnode/main.go @@ -27,6 +27,7 @@ import ( "github.com/ethereum/go-ethereum/crypto" "github.com/ethereum/go-ethereum/logger/glog" "github.com/ethereum/go-ethereum/p2p/discover" + "github.com/ethereum/go-ethereum/p2p/discv5" "github.com/ethereum/go-ethereum/p2p/nat" ) @@ -38,6 +39,7 @@ func main() { nodeKeyFile = flag.String("nodekey", "", "private key filename") nodeKeyHex = flag.String("nodekeyhex", "", "private key as hex (for testing)") natdesc = flag.String("nat", "none", "port mapping mechanism (any|none|upnp|pmp|extip:<IP>)") + runv5 = flag.Bool("v5", false, "run a v5 topic discovery bootnode") nodeKey *ecdsa.PrivateKey err error @@ -79,8 +81,15 @@ func main() { os.Exit(0) } - if _, err := discover.ListenUDP(nodeKey, *listenAddr, natm, ""); err != nil { - utils.Fatalf("%v", err) + if *runv5 { + if _, err := discv5.ListenUDP(nodeKey, *listenAddr, natm, ""); err != nil { + utils.Fatalf("%v", err) + } + } else { + if _, err := discover.ListenUDP(nodeKey, *listenAddr, natm, ""); err != nil { + utils.Fatalf("%v", err) + } } + select {} } |