Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat p2p #47

Merged
merged 68 commits into from
Dec 8, 2020
Merged

Feat p2p #47

merged 68 commits into from
Dec 8, 2020

Conversation

elenaf9
Copy link
Contributor

@elenaf9 elenaf9 commented Oct 19, 2020

Description of change

Enable communication between peers by using rust-libp2p and a mailbox concept for peers that can not communicate directly.

Type of change

  • Enhancement (a non-breaking change which adds functionality)

Change checklist

  • [x ] I have performed a self-review of my own code
  • [ x] I have commented my code, particularly in hard-to-understand areas

Copy link
Contributor

@nothingismagick nothingismagick left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need to discuss how we want to propagate connection errors as well as removing the println! macro usage because we cannot assume that all library consumers will have a console at all.

engine/communication/README.md Outdated Show resolved Hide resolved
engine/communication/README.md Outdated Show resolved Hide resolved
engine/communication/README.md Outdated Show resolved Hide resolved
engine/communication/rustfmt.toml Outdated Show resolved Hide resolved
engine/communication/src/behaviour/mod.rs Outdated Show resolved Hide resolved
engine/communication/examples/mailbox.rs Outdated Show resolved Hide resolved
engine/communication/examples/mailbox.rs Outdated Show resolved Hide resolved
engine/communication/src/lib.rs Outdated Show resolved Hide resolved
engine/communication/src/lib.rs Outdated Show resolved Hide resolved
engine/communication/src/lib.rs Outdated Show resolved Hide resolved
engine/communication/src/behaviour/mod.rs Outdated Show resolved Hide resolved
engine/communication/src/behaviour/mod.rs Outdated Show resolved Hide resolved
engine/communication/src/network/mod.rs Outdated Show resolved Hide resolved
thiserror = "1.0.21"
serde = { version = "1.0.117", default-features = false, features = ["alloc", "derive"] }
serde_json = { version = "1.0.59", default-features = false, features = ["alloc"] }
riker = "0.4.1"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Riker 0.4.2 was just published, so this is now out of date. In order to stay 'synced' with the client deps, please drop the patch versions for now. At some point we may return to this, but I am concerned that things stop working in concert if we don't have parity.

@@ -0,0 +1,29 @@
[package]
name = "communication"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
name = "communication"
name = "stronghold-communication"

version = "0.1.0"
authors = ["Elena Frank <elena.frank@iota.org>"]
edition = "2018"
license = "Apache-2.0 OR MIT"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
license = "Apache-2.0 OR MIT"
license = "Apache-2.0"

@elenaf9 elenaf9 force-pushed the feat-p2p branch 2 times, most recently from e11d42d to 0823734 Compare December 2, 2020 03:43
}

fn handle_input_line(swarm: &mut Swarm<P2PNetworkBehaviour<Request, Response>>, line: String) {
if let Some(peer_id) = Regex::new("PING\\s+\"(\\w+)\"")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Little verbose on the if branches. Would be better if you put most of the internal logic into the body of the if checks so that it doesn't have to execute it every time.

@elenaf9 elenaf9 merged commit e7f9357 into dev Dec 8, 2020
@elenaf9 elenaf9 deleted the feat-p2p branch December 10, 2020 10:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants