Commit Graph

27 Commits

Author SHA1 Message Date
Ignotus Peverell 2d81abc16c Added height as part of handshake to inform syncing. 2017-02-02 15:51:48 -08:00
Ignotus Peverell 7f029cb4c0 Added a Connection wrapper to handle timeouts when we want information from a peer in a request/response style. 2017-02-01 19:05:17 -08:00
Ignotus Peverell 572c1951e1 Introduced a higher-level connection abstraction, allowing the protocol to stay relatively simple. Deals with the lower level details of sending, receiving data, timeouts and dealing with futures. 2017-01-29 22:43:20 -08:00
Ignotus Peverell dc33ebcf39 Network block broadcasting. 2016-12-20 17:33:20 -08:00
Ignotus Peverell e688ff99e6 Started putting in place the adapter between the chain and p2p modules to forward blocks and transactions. Cleaned up chain store references. 2016-12-18 15:51:54 -08:00
Ignotus Peverell bc61c5dae7 Read block and transaction messages and forward to the adapter. 2016-12-15 14:57:04 -08:00
Ignotus Peverell d395b3d128 Added another server implementation for when the client needs to stay in control of the event loop (i.e. multiple servers for tests). Test to spin up 5 servers and connect them all together. 2016-12-14 16:10:39 -08:00
Ignotus Peverell 19a700b81e Minor fixes, testing server peer count. 2016-12-13 16:05:24 -08:00
Ignotus Peverell 7bea7341ab Various cleanup and reorganization. 2016-12-11 13:04:52 -08:00
Ignotus Peverell 4b5c010b05 Rewrote most of p2p code to use futures-rs instead of mioco. Need some cleanup and support for a few more message types. 2016-12-10 19:11:49 -08:00
Ignotus Peverell 309cb497f8 Configurable host and port for p2p server. Utility for client connection. 2016-11-29 18:49:03 -08:00
Ignotus Peverell 632e3af8ee Test for sending tx from one peer to another. Common tests module. 2016-11-07 14:02:45 -08:00
Ignotus Peverell ea425dc614 Protocol cleanup. Tests cleanup. Additional test for transaction broadcast. 2016-11-05 16:31:45 -07:00
Ignotus Peverell 28f007240e Usefuly read and write implementations to limit and count bytes. 2016-11-04 08:59:49 -07:00
Ignotus Peverell 098d17ee42 Added limited and counting readers for protocol to maintain its stats. Added primitive error count. Cleaned up protocol. 2016-11-02 14:19:40 -07:00
Ignotus Peverell edc6c62577 Fixed message serialization following changes in core. Sending of block and transaction. 2016-11-01 10:42:33 -07:00
Merope Riddle 565374bac7 p2p: fix for changes in core serialization API 2016-11-01 02:16:57 +00:00
Ignotus Peverell 3ffc2f5d8c Tests improvement. Protocol also measures bytes received (at least for pings). 2016-10-31 12:30:48 -07:00
Garrick Ollivander d7dcd6d3ae nicer processing of message types 2016-10-31 13:08:48 +01:00
Ignotus Peverell ee6fcab8db Proper server and protocol event loop. Channels for shutdown and ping/pong trivial roundtrip. Working test. 2016-10-30 18:24:19 -07:00
Ignotus Peverell a23308dd9d Added clean stop logic on server and peers. Broken unit test. 2016-10-30 08:24:19 -07:00
Ignotus Peverell 42769c373c Re-implemented the whole interaction between server, peer and protocol to be more Rust-ish. Server maintains peer references and protocol is internally mutable. 2016-10-29 12:36:45 -07:00
Ignotus Peverell fdaf2ba6af First working test with related fixes demonstrating a full peer handshake. 2016-10-27 14:28:02 -07:00
Ignotus Peverell a9dc8a05ac Preliminary impl of p2p package compiles now. Next step: basic handshake integration test. 2016-10-26 11:21:45 -07:00
Ignotus Peverell b1762cb5f4 p2p module getting close to first integration test allowing 2 peers to connect. Fleshed out handshake and protocol use. Fixed most errors, just need to make the borrow checker happy. 2016-10-25 22:06:13 -07:00
Ignotus Peverell 4657b09c4e WIP: more p2p code, mostly interaction between peer, protocol and server as well as ser/deser for first message types. 2016-10-24 21:35:10 -07:00
Ignotus Peverell c8aa8d7c18 Getting started on the p2p networking code. 2016-10-23 17:02:02 -04:00