mirror of
https://github.com/logos-messaging/enr-decoder.git
synced 2026-01-02 12:53:08 +00:00
chore: include udp port
This commit is contained in:
parent
9c0afc2341
commit
7c649b72e5
14
main.go
14
main.go
@ -34,7 +34,7 @@ func main() {
|
|||||||
fmt.Println("seq:", node.Record().Seq())
|
fmt.Println("seq:", node.Record().Seq())
|
||||||
fmt.Println("signature:", "0x"+hex.EncodeToString(node.Record().Signature()))
|
fmt.Println("signature:", "0x"+hex.EncodeToString(node.Record().Signature()))
|
||||||
fmt.Println("peer-id: ", peerID)
|
fmt.Println("peer-id: ", peerID)
|
||||||
ip, err := GetValue(node.Record(), "ip-addr")
|
ip, err := GetValue(node.Record(), "ip")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
panic(err)
|
panic(err)
|
||||||
} else {
|
} else {
|
||||||
@ -54,7 +54,17 @@ func main() {
|
|||||||
if len(port) > 0 {
|
if len(port) > 0 {
|
||||||
fmt.Println("tcp-port:", binary.BigEndian.Uint16(port))
|
fmt.Println("tcp-port:", binary.BigEndian.Uint16(port))
|
||||||
} else {
|
} else {
|
||||||
fmt.Println("ipv4: field has no value")
|
fmt.Println("tcp-port:: field has no value")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
uport, err := GetValue(node.Record(), "udp")
|
||||||
|
if err != nil {
|
||||||
|
panic(err)
|
||||||
|
} else {
|
||||||
|
if len(uport) > 0 {
|
||||||
|
fmt.Println("udp-port:", binary.BigEndian.Uint16(uport))
|
||||||
|
} else {
|
||||||
|
fmt.Println("udp-port: field has no value")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user