David was bragging on twitter yesterday that he had several terminals open, each running “routing -n” and that it was cool to watch them talking to each other. So here’s how to join him in maidsafe rust routing smugness…
You need latest rust compiler (nightly): install rust compiler (I used yesterday’s nightly 14-May-15, @DrVecctor reports beta not ok)
You need libsodium (1.0.3): install libsodium (see @culexevilman’s CRUST instructions to install libsodium on Linux and don’t miss the “sudo ldconfig”, or see @Tom_Carlson’s post installing libsodium on Windows below)
Now build maidsafe/routing from github:
git clone https://github.com/maidsafe/routing
cd routing
cargo test --release
I got a load of warnings and then a long wait before it completed (maybe 40 minutes, on an old but fairly powerful laptop) so be patient (unlike me).
cd target/release/examples
./routing -n
You should see something like:
e856e3..529ec0 -- listening on : [Tcp(V4(127.0.1.1:53037))]
Input command (stop)
If that works, open multiple terminals, change to the “routing/target/release/examples” directory and type ./routing -n
in each one. You’ll see routing goodness like this:
Input command (stop)
handle_new_connect_event peer_ep : Tcp(V4(127.0.0.1:52968))
e856e3..529ec0 received FindGroup 1767392237
e856e3..529ec0 received ConnectRequest
RT (size : 1) added b37ee1..c9dc6e
e856e3..529ec0 construct_connect_response_msg
handle_new_connect_event peer_ep : Tcp(V4(127.0.1.1:49069))
RT (size : 1) Marked connected peer_id : b37ee1..c9dc6e , peer_ep : Tcp(V4(127.0.1.1:49069))
e856e3..529ec0 received ConnectRequest
handle_new_connect_event peer_ep : Tcp(V4(127.0.0.1:52973))
e856e3..529ec0 received FindGroup 3602834904
e856e3..529ec0 received FindGroupResponse
e856e3..529ec0 received ConnectRequest
Then go brag about it
But there’s more (first see @BenMS comment about performance immediately below) and then (courtesty of @dirvine below) open a terminal with just ./routing
(no parameters) and try put <key> <value>
with a few combinations and then get <key
to see them retrieved!
For example:
$ ./routing
Input command (stop, put <key> <value>, get <key>)
time wasted
Invalid Option
Input command (stop, put <key> <value>, get <key>)
put time spent
putting data TestData( key: "time" , value: "wasted" ) to network with name as 9d3046..8c136c
Input command (stop, put <key> <value>, get <key>)
put safe SecureAccessForEveryone
putting data TestData( key: "safe" , value: "SecureAccessForEveryone" ) to network with name as faf82e..36d5d6
Input command (stop, put <key> <value>, get <key>)
put happy being
putting data TestData( key: "happy" , value: "being" ) to network with name as c00192..5f7daa
Input command (stop, put <key> <value>, get <key>)
get time
getting data having key time from network using name as 9d3046..8c136c
Input command (stop, put <key> <value>, get <key>)
testing client received get_response with testdata TestData( key: "time" , value: "spent" )
get safe
getting data having key safe from network using name as faf82e..36d5d6
Input command (stop, put <key> <value>, get <key>)
testing client received get_response with testdata TestData( key: "safe" , value: "SecureAccessForEveryone" )
get happy
getting data having key happy from network using name as c00192..5f7daa
Input command (stop, put <key> <value>, get <key>)
testing client received get_response with testdata TestData( key: "happy" , value: "being" )