-
Notifications
You must be signed in to change notification settings - Fork 267
Conversation
There was a problem hiding this 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..
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.. |
There was a problem hiding this 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
`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 |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is the code for a --networked
option
https://github.com/holochain/holochain-rust/pull/826/files#diff-3f97b1cf8c268f48439642916602b667R113
There was a problem hiding this comment.
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.
Co-Authored-By: zippy <eric@harris-braun.com>
Co-Authored-By: zippy <eric@harris-braun.com>
There was a problem hiding this 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")] |
There was a problem hiding this comment.
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...
No description provided.