Skip to content

Commit

Permalink
Merge pull request #3 from spectrum-finance/pch-#2yyyqbh
Browse files Browse the repository at this point in the history
Peer Connection Handler
  • Loading branch information
oskin1 authored Oct 27, 2022
2 parents 21debd7 + 1744d06 commit 3270fab
Show file tree
Hide file tree
Showing 21 changed files with 1,421 additions and 58 deletions.
8 changes: 8 additions & 0 deletions docs/Networking.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Spectrum Networking Layer

## Peer Connection Handler

Peer Connection Handler (PCH) is responsible for handling protocol substreams for a particulal peer. PCH keeps track of the
protocol state at each point of upgrade flow.

![Protocol States](./assets/ProtocolState.svg)
3 changes: 3 additions & 0 deletions docs/assets/ProtocolState.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 6 additions & 1 deletion spectrum-network/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@ edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
libp2p = "0.43.0"
libp2p = "0.46.1"
futures = "0.3.21"
async-std = { version = "1.10.0", features = ["attributes"] }
unsigned-varint = { version = "0.7.1", features = ["futures", "asynchronous_codec"] }
asynchronous-codec = "0.6"
pin-project = "1.0.10"
void = "1.0.2"
thiserror = "1.0.34"
13 changes: 3 additions & 10 deletions spectrum-network/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,11 +1,4 @@
pub mod peer;
pub mod peer_conn_handler;
pub mod peer_manager;
pub mod protocol;

#[cfg(test)]
mod tests {
#[test]
fn it_works() {
let result = 2 + 2;
assert_eq!(result, 4);
}
}
pub mod types;
5 changes: 0 additions & 5 deletions spectrum-network/src/peer.rs

This file was deleted.

31 changes: 0 additions & 31 deletions spectrum-network/src/peer/types.rs

This file was deleted.

Loading

0 comments on commit 3270fab

Please sign in to comment.