@@ -27,6 +27,7 @@ import (
2727 "github.com/ethereum/go-ethereum/crypto"
2828 "github.com/ethereum/go-ethereum/logger/glog"
2929 "github.com/ethereum/go-ethereum/p2p/discover"
30+ "github.com/ethereum/go-ethereum/p2p/discv5"
3031 "github.com/ethereum/go-ethereum/p2p/nat"
3132)
3233
@@ -38,6 +39,7 @@ func main() {
3839 nodeKeyFile = flag .String ("nodekey" , "" , "private key filename" )
3940 nodeKeyHex = flag .String ("nodekeyhex" , "" , "private key as hex (for testing)" )
4041 natdesc = flag .String ("nat" , "none" , "port mapping mechanism (any|none|upnp|pmp|extip:<IP>)" )
42+ runv5 = flag .Bool ("v5" , false , "run a v5 topic discovery bootnode" )
4143
4244 nodeKey * ecdsa.PrivateKey
4345 err error
@@ -79,8 +81,15 @@ func main() {
7981 os .Exit (0 )
8082 }
8183
82- if _ , err := discover .ListenUDP (nodeKey , * listenAddr , natm , "" ); err != nil {
83- utils .Fatalf ("%v" , err )
84+ if * runv5 {
85+ if _ , err := discv5 .ListenUDP (nodeKey , * listenAddr , natm , "" ); err != nil {
86+ utils .Fatalf ("%v" , err )
87+ }
88+ } else {
89+ if _ , err := discover .ListenUDP (nodeKey , * listenAddr , natm , "" ); err != nil {
90+ utils .Fatalf ("%v" , err )
91+ }
8492 }
93+
8594 select {}
8695}
0 commit comments