Skip to content
This repository has been archived by the owner on Feb 3, 2023. It is now read-only.

Sim2h Integration #1744

Merged
merged 55 commits into from
Oct 11, 2019
Merged

Sim2h Integration #1744

merged 55 commits into from
Oct 11, 2019

Conversation

zippy
Copy link
Member

@zippy zippy commented Oct 5, 2019

PR summary

  • Sim2hWorker
  • Sim2h server as nix command
  • app-spec running against Sim2h
    ==== parity with sim1h ^^ =====
  • Reconnect to sim2h node if connection breaks up
  • Offline-mode: mirror publish messages back to core as store request
  • Wire encryption
  • Signed WireMessages

changelog

Please check one of the following, relating to the CHANGELOG-UNRELEASED.md

  • this is a code change that effects some consumer (e.g. zome developers) of holochain core so it is added to the CHANGELOG-UNRELEASED.md (linked above), with the format - summary of change [PR#1234](https://github.com/holochain/holochain-rust/pull/1234)
  • this is not a code change, or doesn't effect anyone outside holochain core development

@zippy zippy changed the title sim2h-worker wip WIP: sim2h-worker wip Oct 5, 2019
@zippy zippy added the WIP work in progress label Oct 5, 2019
@lucksus lucksus changed the title WIP: sim2h-worker wip Sim2h Integration Oct 8, 2019
@lucksus lucksus removed the WIP work in progress label Oct 8, 2019
@zippy zippy marked this pull request as ready for review October 8, 2019 22:16
Copy link
Collaborator

@Connoropolous Connoropolous left a comment

Choose a reason for hiding this comment

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

for the sake of related stuff I've been doing, reading over this code anyways so I thought I'd chime in...

.circleci/config.yml Show resolved Hide resolved
app_spec/test/default.nix Outdated Show resolved Hide resolved
app_spec/test/index.js Outdated Show resolved Hide resolved
net/src/sim2h_worker.rs Outdated Show resolved Hide resolved
net/src/sim2h_worker.rs Outdated Show resolved Hide resolved
zippy and others added 2 commits October 8, 2019 21:10
Co-Authored-By: Connor Turland <connorturland@gmail.com>
@@ -0,0 +1,14 @@
[package]
Copy link
Collaborator

Choose a reason for hiding this comment

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

@AshantiMutinta, take note of this new crate. It only includes this ConductorApi struct which is a proxy for the conductor api that does not depend on anything in the conductor_api crate - which is good because we can't depend on that in the net crate without creating cyclic dependencies. ConductorApi was in core before we can't depend on that either.

With the repository clean-up that we discussed yesterday, I would suggest with rename this crate to conductor_api since the current conductor_api will be conductor_lib, right?

transport.request(
Span::todo("Find out how to use spans the right way"),
RequestToChild::Bind {
spec: Url::parse("wss://localhost:0").expect("can parse url").into(),
Copy link
Contributor

Choose a reason for hiding this comment

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

Didn't we decide we need wss://127.0.0.1:0 to ensure we use ipv4 for now?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Hm, good point. Interesting. It seems this was only a problem with the server. This code worked on @zippy's machine with IPv6 interfaces... will change it anyway to be sure.


/// Check for messages from our NetworkEngine
fn tick(&mut self) -> NetResult<bool> {
self.num_ticks += 1;
Copy link
Contributor

Choose a reason for hiding this comment

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

as a u32, if tick gets called once per millisecond (on a fast computer hopefully it'll get called more often than this even) - num_ticks will overflow in ~50 days. I think it should be a u64 : )

Copy link
Collaborator

Choose a reason for hiding this comment

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

Yes. I've removed num_ticks now since it wasn't used anyway.

net/src/sim2h_worker.rs Outdated Show resolved Hide resolved
Copy link
Contributor

@neonphog neonphog left a comment

Choose a reason for hiding this comment

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

couple minor comments / suggestions - all in all looks awesome!

@lucksus lucksus merged commit c4c8620 into develop Oct 11, 2019
@lucksus
Copy link
Collaborator

lucksus commented Oct 11, 2019

In sim2h you changed this to 0.0.0.0 right... How come not the same here?

@Connoropolous, the sim2h_server needs to be accessible from the outside so it has to bind to real network interfaces. The sim2h worker is a client that only calls out, we don't even want somebody to connect on that port.

@zippy zippy deleted the sim2h branch January 4, 2020 01:11
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants