Skip to content
This repository has been archived by the owner on Aug 8, 2018. It is now read-only.

Code Walkthrough

heikoheiko edited this page Aug 6, 2015 · 9 revisions

Code Walkthrough - Following a block from the network socket to the hard drive

Note: All links to the code are based on a fixed revision, so we can link line numbers. Code might have changed by now, nonetheless use these revisions when doing updates to this document.

Preconditons

  • the app was configured and started
  • all services registered
  • the discovery protocol discovered some nodes
  • the peermanager successfully connected a node
  • established an encrypted multiplexed session
  • and created a ETHProtocol instance for this peer
  • we are waiting for ingress data in the peer connection

Some data arrives

We are waiting for data on the socket: https://github.com/ethereum/pydevp2p/blob/6577016a6f50ce220e20f66c2c8c1eb6dc271b9c/devp2p/peer.py#L208

We add the (partitial) message to the MultiplexedSession: https://github.com/ethereum/pydevp2p/blob/6577016a6f50ce220e20f66c2c8c1eb6dc271b9c/devp2p/peer.py#L223