mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-26 14:46:42 +00:00
Modify UDP discovery port to port 30386
This commit is contained in:
parent
341132925f
commit
f754b3adeb
6 changed files with 9 additions and 9 deletions
|
|
@ -34,7 +34,7 @@ import (
|
|||
|
||||
func main() {
|
||||
var (
|
||||
listenAddr = flag.String("addr", ":30301", "listen address")
|
||||
listenAddr = flag.String("addr", ":30386", "listen address")
|
||||
genKey = flag.String("genkey", "", "generate a node key")
|
||||
writeAddr = flag.Bool("writeaddress", false, "write out the node's pubkey hash and quit")
|
||||
nodeKeyFile = flag.String("nodekey", "", "private key filename")
|
||||
|
|
|
|||
|
|
@ -50,9 +50,9 @@ type Enode struct {
|
|||
//
|
||||
// In the following example, the node URL describes
|
||||
// a node with IP address 10.3.58.6, TCP listening port 30388
|
||||
// and UDP discovery port 30301.
|
||||
// and UDP discovery port 30386.
|
||||
//
|
||||
// enode://<hex node id>@10.3.58.6:30388?discport=30301
|
||||
// enode://<hex node id>@10.3.58.6:30388?discport=30386
|
||||
func NewEnode(rawurl string) (enode *Enode, _ error) {
|
||||
node, err := discv5.ParseNode(rawurl)
|
||||
if err != nil {
|
||||
|
|
|
|||
|
|
@ -137,9 +137,9 @@ var incompleteNodeURL = regexp.MustCompile("(?i)^(?:enode://)?([0-9a-f]+)$")
|
|||
//
|
||||
// In the following example, the node URL describes
|
||||
// a node with IP address 10.3.58.6, TCP listening port 30388
|
||||
// and UDP discovery port 30301.
|
||||
// and UDP discovery port 30386.
|
||||
//
|
||||
// enode://<hex node id>@10.3.58.6:30388?discport=30301
|
||||
// enode://<hex node id>@10.3.58.6:30388?discport=30386
|
||||
func ParseNode(rawurl string) (*Node, error) {
|
||||
if m := incompleteNodeURL.FindStringSubmatch(rawurl); m != nil {
|
||||
id, err := HexID(m[1])
|
||||
|
|
|
|||
|
|
@ -299,7 +299,7 @@ func TestUDP_findnodeMultiReply(t *testing.T) {
|
|||
list := []*Node{
|
||||
MustParseNode("enode://ba85011c70bcc5c04d8607d3a0ed29aa6179c092cbdda10d5d32684fb33ed01bd94f588ca8f91ac48318087dcb02eaf36773a7a453f0eedd6742af668097b29c@10.0.1.16:30388?discport=30304"),
|
||||
MustParseNode("enode://81fa361d25f157cd421c60dcc28d8dac5ef6a89476633339c5df30287474520caca09627da18543d9079b5b288698b542d56167aa5c09111e55acdbbdf2ef799@10.0.1.16:30388"),
|
||||
MustParseNode("enode://9bffefd833d53fac8e652415f4973bee289e8b1a5c6c4cbe70abf817ce8a64cee11b823b66a987f51aaa9fba0d6a91b3e6bf0d5a5d1042de8e9eeea057b217f8@10.0.1.36:30301?discport=17"),
|
||||
MustParseNode("enode://9bffefd833d53fac8e652415f4973bee289e8b1a5c6c4cbe70abf817ce8a64cee11b823b66a987f51aaa9fba0d6a91b3e6bf0d5a5d1042de8e9eeea057b217f8@10.0.1.36:30386?discport=17"),
|
||||
MustParseNode("enode://1b5b4aa662d7cb44a7221bfba67302590b643028197a7d5214790f3bac7aaa4a3241be9e83c09cf1f6c69d007c634faae3dc1b1221793e8446c0b3a09de65960@10.0.1.16:30388"),
|
||||
}
|
||||
rpclist := make([]rpcNode, len(list))
|
||||
|
|
|
|||
|
|
@ -145,9 +145,9 @@ var incompleteNodeURL = regexp.MustCompile("(?i)^(?:enode://)?([0-9a-f]+)$")
|
|||
//
|
||||
// In the following example, the node URL describes
|
||||
// a node with IP address 10.3.58.6, TCP listening port 30388
|
||||
// and UDP discovery port 30301.
|
||||
// and UDP discovery port 30386.
|
||||
//
|
||||
// enode://<hex node id>@10.3.58.6:30388?discport=30301
|
||||
// enode://<hex node id>@10.3.58.6:30388?discport=30386
|
||||
func ParseNode(rawurl string) (*Node, error) {
|
||||
if m := incompleteNodeURL.FindStringSubmatch(rawurl); m != nil {
|
||||
id, err := HexID(m[1])
|
||||
|
|
|
|||
|
|
@ -191,7 +191,7 @@ var (
|
|||
// list := []*Node{
|
||||
// MustParseNode("enode://ba85011c70bcc5c04d8607d3a0ed29aa6179c092cbdda10d5d32684fb33ed01bd94f588ca8f91ac48318087dcb02eaf36773a7a453f0eedd6742af668097b29c@10.0.1.16:30388?discport=30304"),
|
||||
// MustParseNode("enode://81fa361d25f157cd421c60dcc28d8dac5ef6a89476633339c5df30287474520caca09627da18543d9079b5b288698b542d56167aa5c09111e55acdbbdf2ef799@10.0.1.16:30388"),
|
||||
// MustParseNode("enode://9bffefd833d53fac8e652415f4973bee289e8b1a5c6c4cbe70abf817ce8a64cee11b823b66a987f51aaa9fba0d6a91b3e6bf0d5a5d1042de8e9eeea057b217f8@10.0.1.36:30301?discport=17"),
|
||||
// MustParseNode("enode://9bffefd833d53fac8e652415f4973bee289e8b1a5c6c4cbe70abf817ce8a64cee11b823b66a987f51aaa9fba0d6a91b3e6bf0d5a5d1042de8e9eeea057b217f8@10.0.1.36:30386?discport=17"),
|
||||
// MustParseNode("enode://1b5b4aa662d7cb44a7221bfba67302590b643028197a7d5214790f3bac7aaa4a3241be9e83c09cf1f6c69d007c634faae3dc1b1221793e8446c0b3a09de65960@10.0.1.16:30388"),
|
||||
// }
|
||||
// rpclist := make([]rpcNode, len(list))
|
||||
|
|
|
|||
Loading…
Reference in a new issue