【问题标题】:What is the function of discport=0 and [::] in an enode address?一个enode地址中discport=0和[::]的作用是什么?
【发布时间】:2018-07-28 06:33:33
【问题描述】:

我想知道以太坊节点的 enode 地址末尾的“discport=0”的功能是什么。

另外,我发现我的 enode 地址有时填充了我的 IP 地址,但在其他时候在检查时填充了 [::];有谁知道为什么会存在这种行为?

提前谢谢你!

【问题讨论】:

  • 我认为区别仅在于您是否指定 --nodiscover 选项。关闭发现时,会省略 IP,发现端口设置为 0。

标签: ethereum web3 go-ethereum


【解决方案1】:

这是我有限的理解。 discport 是发现 UDP 端口的缩写。如果不指定 UDP 侦听端口,则默认为 TCP 侦听端口。通过将其设置为 0,您建议操作系统会为您找到合适的可用 UDP 发现端口。

Source code

【讨论】:

    猜你喜欢
    • 2018-06-21
    • 2016-03-19
    • 2020-08-16
    • 2022-01-25
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-02-18
    • 1970-01-01
    相关资源
    最近更新 更多