RLPx协议指定b=8,但是Go, Java, and Rust的以太坊客户可以设置b=1。客户单和服务端使用不同的b值是没有问题的。 5、Discovery Protocol RLPx协议遵循了Kademlia协议密切发现和维护已知节点列表的特点,但是Kademlia并不包括安全通信。 RLPx在这点上做了增强,它在第一次连接的时候增加了一个二阶段握手协议。通过公钥来交换,并且所有的通信都是加密的。 RLPx并不试图规定节点应该作为直接连接节点维护区块链的工作。这些通常是较少的,他们是根据测得的延迟或其他特性选出来的。 8、总结 使用RLPx协议的Ethereumj(以太坊java客户端),是一个网络建立的最直接的途径。RLP编码方案可以用Protocol Buffer代替,网络维护协议的其余部分会变得更简单。
= nil { srv.log.Trace("Failed RLPx handshake", "addr", c.fd.RemoteAddr(), "conn", c.flags, "err /p2p/rlpx.go]func (t *rlpx) doEncHandshake(prv *ecdsa.PrivateKey, dial *discover.Node) (discover.NodeID /p2p/rlpx.go]func (rw *rlpxFrameRW) WriteMsg(msg Msg) error { ... // write header headbuf 参 考 链 接 [1] WIKI.DH: https://en.wikipedia.org/wiki/Diffie–Hellman_key_exchange [2] Github.rlpx: https ://github.com/ethereum/devp2p/blob/master/rlpx.md [3] WIKI.RLP: https://github.com/ethereum/wiki/wiki
= nil { srv.log.Trace("Failed RLPx handshake", "addr", c.fd.RemoteAddr(), "conn", c.flags, "err", err /p2p/rlpx.go] func (t *rlpx) doEncHandshake(prv *ecdsa.PrivateKey, dial *discover.Node) (discover.NodeID /p2p/rlpx.go] func (rw *rlpxFrameRW) WriteMsg(msg Msg) error { ... // write header headbuf := make = updateMAC(rw.egressMAC, rw.macCipher, fmacseed) _, err := rw.conn.Write(mac) return err } 结合以太坊 RLPX : https://github.com/ethereum/devp2p/blob/master/rlpx.md 3 WIKI.RLP: https://github.com/ethereum/wiki
实际上在结点之间的peer连接使用的是一个完全不同的,加密的协议(RLPX)。RLPX加密的工作方式需要远程终端连接发起者的公钥作为身份识别。本质上来说,这个key链接了发现协议和RLPX。 :46:37] Starting P2P networking INFO [02-06|11:46:37] started whisper v.5.0 INFO [02-06|11:46:37] RLPx RLPx开始监控,并打印出当前enode信息 15. 交易池价格阀值更新,价格为=18000000000 16.
journal transactions=0 accounts=0INFO [01-19|17:47:06] Starting P2P networkingINFO [01-19|17:47:06] RLPx
0x0, 0x0, 0x19d4c80, 0x28, 0x11, 0x0) /home/travis/gopath/src/github.com/ethereum/go-ethereum/p2p/rlpx.go (*rlpx).ReadMsg(0xc440545da0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0) /home/travis/gopath/src /github.com/ethereum/go-ethereum/p2p/rlpx.go:95 +0x148 github.com/ethereum/go-ethereum/p2p.
journal transactions=0 accounts=0 INFO [04-01|18:38:01] Starting P2P networking INFO [04-01|18:38:01] RLPx
journal transactions=0 accounts=0 INFO [12-28|19:23:16] Starting P2P networking INFO [12-28|19:23:16] RLPx 比如: INFO [12-28|19:23:16] RLPx listener up self="enode://aa621c010c685665ef217044dac4d57f4d1d682c682a5b3f92ca23b40982383240a05b680060ce8b0ce020a96c49c9c2c3628c4ea3281845211bd4cf4f03b35c
实际上在结点之间的peer连接使用的是一个完全不同的,加密的协议(RLPX)。RLPX加密的工作方式需要远程终端连接发起者的公钥作为身份识别。本质上来说,这个key链接了发现协议和RLPX。 :46:37] Starting P2P networking INFO [02-06|11:46:37] started whisper v.5.0 INFO [02-06|11:46:37] RLPx RLPx开始监控,并打印出当前enode信息 15. 交易池价格阀值更新,价格为=18000000000 16.
|pmp|extip:<IP>) (默认: “any”) --nodiscover 禁用节点发现机制(手动添加节点) --v5disc 启用实验性的RLPx
|pmp|extip:<IP>) (默认: “any”) -–nodiscover 禁用节点发现机制(手动添加节点) -–v5disc 启用实验性的RLPx
实际上在结点之间的peer连接使用的是一个完全不同的,加密的协议(RLPX)。RLPX加密的工作方式需要远程终端连接发起者的公钥作为身份识别。本质上来说,这个key链接了发现协议和RLPX。 :46:37] Starting P2P networking INFO [02-06|11:46:37] started whisper v.5.0 INFO [02-06|11:46:37] RLPx 载入大部分最近的本地数据头 载入大部分最近的本地完整块数据 载入大部分最近的本地最高块数据 重新生成本地交易账本 开始p2p网络 开始whisper RLPx开始监控,并打印出当前enode信息 交易池价格阀值更新
13:40:48] Starting P2P networking INFO [07-08|13:40:48] started whisper v.5.0 INFO [07-08|13:40:48] RLPx
journal transactions=0 accounts=0 INFO [01-19|17:47:06] Starting P2P networking INFO [01-19|17:47:06] RLPx not empty, fast sync disabled INFO [01-20|01:41:34] Starting P2P networking INFO [01-20|01:41:34] RLPx 9f6490ffb5236f2ddc5710ae73d47c740e0a3644bbd2d67029cf4a6c4693d2f470b642fd2cc3507f7e851df60aaeb730a1270b7a477f91ec5b6b17a8a4b40527@101.232.64.12:30303 INFO [01-19|22:14:56] RLPx
protocol 对一个模拟的conn写和读,并没有真正的网络conn,为了测试用,newPeer才是真正被用到的,conn是SetupConn创建来的 server.go的conn结构其中transport是rlpx.go 也就是让外网的机器可以访问内网的机器有upnp协议pmp协议还有直接ip出去的 nat.map函数就是把内网的端口映射到外网去 p2p/metrics.go 主要是封装了一层conn 用作仪表,其实就是记录下进出流量的多少 p2p/rlpx.go
INFO [02-02|22:36:05] IPC endpoint opened: /home/neo/ethereum/data1/geth.ipc INFO [02-02|22:36:05] RLPx
Whisper - DApps相互通信的通信协议,是以太坊Web3堆栈的本机基础层服务 DEVp2p Wire Protocol -运行以太坊/ Whisper的节点之间的对等通信 Pydevp2p - RLPx
listening port --v5disc (default: false) Enables the experimental RLPx
INFO [02-02|22:36:05] IPC endpoint opened: /home/neo/ethereum/data1/geth.ipc INFO [02-02|22:36:05] RLPx
然后跟它并列的还有一些其他的,它的底层其实是包含RLPx、ÐΞVp2p的。