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

Hc networking option #826

Merged
merged 19 commits into from
Jan 9, 2019
Merged

Hc networking option #826

merged 19 commits into from
Jan 9, 2019

Conversation

sphinxc0re
Copy link
Contributor

No description provided.

lucksus
lucksus previously requested changes Jan 7, 2019
Copy link
Collaborator

@lucksus lucksus left a comment

Choose a reason for hiding this comment

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

Setting the network config of instances like this won't work. The container has to create the n3h process and plug the IPC URI into the instance configs, which is happening already.

This code should set the network config of the container itself and let the container do the rest..

@zippy
Copy link
Member

zippy commented Jan 9, 2019

Ok, I got this working in the very super simplest of ways. Namely you can activate networking by simply supplying an environment variable with the path to your n3h instance. Eg from my terminal:

$ HC_N3H_PATH=/home/eric/code/metacurrency/holochain/n3h hc run
Spawning network with working directory: /tmp
SPAWN ("node" "/home/eric/code/metacurrency/holochain/n3h/packages/n3h/bin/n3h")
(@hackmode@) [t] bound to tcp://127.0.0.1:45875
(@hackmode@) [i] p2p bound [
  "/ip4/127.0.0.1/tcp/44753/ipfs/QmdWBR5jEMJRtCCzqGS6vgXjaRknAcsTU1VaYoCiqMw4ES",
  "/ip4/192.168.1.5/tcp/44753/ipfs/QmdWBR5jEMJRtCCzqGS6vgXjaRknAcsTU1VaYoCiqMw4ES"
]
(@hackmode@) [t] running
READY! tcp://127.0.0.1:45875 ["/ip4/127.0.0.1/tcp/44753/ipfs/QmdWBR5jEMJRtCCzqGS6vgXjaRknAcsTU1VaYoCiqMw4ES", "/ip4/192.168.1.5/tcp/44753/ipfs/QmdWBR5jEMJRtCCzqGS6vgXjaRknAcsTU1VaYoCiqMw4ES"]
Network spawned with binding: "tcp://127.0.0.1:45875"
2019-01-08 22:13:33:test-instance: debug/reduce: ActionWrapper { action: InitApplication(Dna.

.. snip..

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.

lol, I'm good with this as an interim solution. At some point we really need a way of specifying arbitrary (opaque) configuration parameters for the networking module, that holochain-rust core does not need to know about. i.e. which network interface to bind to for p2p communications... what about socks5 proxy settings we don't want these all to have to be hand-coded when they are just pass-through items

cmd/README.md Outdated Show resolved Hide resolved
cmd/README.md Outdated Show resolved Hide resolved
`hc run` uses mock networking by default and therefore can't talk to any other nodes. If you want to test multiple nodes you will need to install the [n3h](https://github.com/holochain/n3h) networking component (following the instructions on the readme there). Once you have installed it then you can simply fire up your first node while setting the HC_N3H_PATH environment variable to the path where you installed it. If n3h was installed properly you should see something like this:

``` shell
$ HC_N3H_PATH=/home/eric/holochain/n3h hc run
Copy link
Collaborator

Choose a reason for hiding this comment

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

Don't you have to add --networked ? is the default for it be enabled or not?

I can't see in the code a default for the networked variable

Copy link
Member

Choose a reason for hiding this comment

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

you don't I just made it work with the presence of the environment variable. I didn't even add the --networked flag for now.

Copy link
Collaborator

@Connoropolous Connoropolous Jan 9, 2019

Choose a reason for hiding this comment

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

Copy link
Member

Choose a reason for hiding this comment

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

well, would you look at that! I guess Julian did that before I started working on it. You still have to set the ENV vars for now though... hopefully in the future that will go away.

@zippy zippy self-assigned this Jan 9, 2019
Connoropolous and others added 3 commits January 9, 2019 12:15
Co-Authored-By: zippy <eric@harris-braun.com>
Co-Authored-By: zippy <eric@harris-braun.com>
@zippy zippy dismissed lucksus’s stale review January 9, 2019 17:17

issue has been fixed

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.

I see the big picture here, looks good enough to go

@@ -109,6 +109,8 @@ enum Cli {
package: bool,
#[structopt(long, help = "Save generated data to file system")]
persist: bool,
#[structopt(long, help = "Use real networking")]
Copy link
Collaborator

Choose a reason for hiding this comment

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

Since this will show up in the help text, should probably improve this very unhelpful explanation... thinking...

@zippy zippy merged commit 0859b5b into develop Jan 9, 2019
@zippy zippy removed the review label Jan 9, 2019
@zippy zippy deleted the hc-networking branch January 10, 2019 04:42
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.

5 participants