Closed kilimanjarolows closed 5 years ago
I believe you missed the remote peer's connection info, e.g.:
> connect 0 {"id":[69,179,26,91,30,37,129,181,210,61,9,134,181,74,170,154,33,63,253,237],
"for_direct":["127.0.0.1:56419","192.168.1.122:56419","172.17.42.1:56419","10.0.0.1:56419",
"86.100.204.140:43795"],"our_pk":{"encrypt":[240,160,65,141,35,248,81,3,221,127,142,130,113,
81,191,59,223,134,106,52,250,136,111,244,158,79,18,148,32,125,87,21]}}
So 0
indicates the index of our connection infos: we can create multiple of them via prepare-connection-info
command and they will be stored in memory. But then we need to specify their connection info. See if that helps :)
Hm... I have the similar problem:
so in terminal 1:
cargo run --example crust_peer
Finished dev [unoptimized + debuginfo] target(s) in 0.25s
Running `target/debug/examples/crust_peer`
>
Received event ListenerStarted(40623) (not handled)
cli
USAGE:
cli [SUBCOMMAND]
SUBCOMMANDS:
connect Initiate a connection to the remote peer
help Print this help
list List existing connections and UDP sockets
prepare-connection-info Prepare a connection info
send Send a string to the given peer
send-all Send a string to all connections
stop Exit the app
> prepare-connection-info
> Prepared connection info with id 0
Share this info with the peer you want to connect to:
{"id":[242,209,213,103,80,102,224,103,19,98,35,108,93,179,72,11,235,81,42,168],"for_direct":["192.168.50.89:40623","172.17.0.1:40623","127.0.0.1:40623"],"our_pk":{"encrypt":[87,9,176,18,162,139,33,168,224,113,233,206,233,108,252,184,242,238,73,136,107,129,70,50,14,132,217,215,24,45,173,21]}}
In the second one :
cargo run --example crust_peer
Finished dev [unoptimized + debuginfo] target(s) in 0.41s
Running `target/debug/examples/crust_peer`
>
Received event ListenerStarted(40763) (not handled)
cargo run --example crust_peer
Finished dev [unoptimized + debuginfo] target(s) in 0.13s
Running `target/debug/examples/crust_peer`
>
Received event ListenerStarted(42451) (not handled)
cli
USAGE:
cli [SUBCOMMAND]
SUBCOMMANDS:
connect Initiate a connection to the remote peer
help Print this help
list List existing connections and UDP sockets
prepare-connection-info Prepare a connection info
send Send a string to the given peer
send-all Send a string to all connections
stop Exit the app
> connect 0 {"id":[242,209,213,103,80,102,224,103,19,98,35,108,93,179,72,11,235,81,42,168],"for_direct":["192.168.50.89:40623","172.17.0.1:40623","127.0.0.1:40623"],"our_pk":{"encrypt":[87,9,176,18,162,139,33,168,224,113,233,206,233,108,252,184,242,238,73,136,107,129,70,50,14,132,217,215,24,45,173,21]}}
Invalid connection info index
What is wrong here? Sorry for not opening a new issue but i did not think it deserved one ...
Are there any forums such trivial issues can be discussed?
Hey, @RobertBakaric , no worries, that's related anyway :)
The problem with you example is that on the second peer you have to call prepare-connection-info
command as well before doing connect
. In order to do a p2p connection both of the peers have to collect their connection information: LAN and public IP addresses if available. Then you exchange this information and start connecting. Usually this info exchange will be automated by software using Crust but in this example it's a simple copy paste to the terminal to make it simpler.
Crust is one of the core components of SAFE network. Please don't be a stranger at our forum: https://safenetforum.org/c/development . Any type of feedback, discussions, etc. will help us improve this component and SAFE net as well :)
Also, it seems like there was another issue with connectivity on LAN. https://github.com/maidsafe/crust/pull/1123 should fix it.
The issue mentioned by @povilasb was fixed on PR #1141, so closing this issue.
following the instructions crust_peer example fails.
We run the example in two different terminals. In each terminal we typed:
prepare-connection-info
Then in terminal 1 we typed: `connect 0
The result is: `Received event ConnectFailure(UniqueId([205, 49, 114, 16, 134, 64, 127, 199, 109, 252, 223, 167, 226, 99, 220, 5, 142, 109, 191, 161])) (not handled)