telehash/gogotelehash

Basic "link" test command line?

quartzjer opened this issue · 2 comments

I have a minimal almost-automated test between c and js at https://github.com/telehash/telehash-c/blob/master/test/node.sh that just prints out the json over stdout and the recipient exits success/fail if a link was established.

I've been meaning to learn more about the go implementation, how far away do you think it is to set up a similar test or how hard would it be? :)

fd commented

Here is a basic version

go get github.com/telehash/gogotelehash/tools/test-net-link

# Then from telehash-c
bin/test_net_link | test-net-link

Holy shit that's awesome!

[jer@bolt-2 ~/th/telehash-c] [master]:~$ ./bin/test_net_link | ~/go/bin/test-net-link 
src/e3x/self3.c:40 self3_new() self created with 1 csids
2014/11/18 10:18:20 golang: rtvyrw4ewkw7l6b2ohflknk4iyvr6nsu7nqpewh7qu3gxp7o5voa
2014/11/18 10:18:20 remote: piqwg6tgfmiecqvpnrhj7rrplfkuaed7g575uk7ajorn3ugxpdia
00:00:00.013 | rtvy piqw | addrbook     | Changed path from <nil> to {"type":"udp4","ip":"127.0.0.1","port":61147}
00:00:00.013 | rtvy piqw | addrbook     | Discovered path {"type":"udp4","ip":"127.0.0.1","port":61147} (latency=125ms, emwa=125ms)
src/net/udp4.c:37 udp4_pipe() new pipe to 127.0.0.1:52956
src/mesh.c:202 mesh_receive() mesh receiving handshake to piqwg6tgfmiecqvpnrhj7rrplfkuaed7g575uk7ajorn3ugxpdia via pipe 127.0.0.1:52956
src/mesh.c:233 mesh_receive() no link for hashname rtvyrw4ewkw7l6b2ohflknk4iyvr6nsu7nqpewh7qu3gxp7o5voa
src/mesh.c:93 mesh_add() mesh add {"hashname":"rtvyrw4ewkw7l6b2ohflknk4iyvr6nsu7nqpewh7qu3gxp7o5voa","keys":{"1a":"ak2svt5qc2jdtm3gotpj4eayevu7ax54hy"}}
src/link.c:31 link_new() adding link rtvyrw4ewkw7l6b2ohflknk4iyvr6nsu7nqpewh7qu3gxp7o5voa
src/link.c:130 link_load() adding 1a key to link rtvyrw4ewkw7l6b2ohflknk4iyvr6nsu7nqpewh7qu3gxp7o5voa
src/link.c:153 link_load() delivering session token b56d6dea6efc8a0eaf8857b3e4df6b21 to rtvyrw4ewkw7l6b2ohflknk4iyvr6nsu7nqpewh7qu3gxp7o5voa
src/link.c:296 link_sync() link sync at 1416331100
src/net/udp4.c:21 udp4_send() udp4 to rtvyrw4ewkw7l6b2ohflknk4iyvr6nsu7nqpewh7qu3gxp7o5voa
00:00:00.057 | rtvy piqw | e3x          | Opened exchange
00:00:00.058 | rtvy piqw | e3x          | Opened channel "link" 1
src/mesh.c:202 mesh_receive() mesh receiving handshake to piqwg6tgfmiecqvpnrhj7rrplfkuaed7g575uk7ajorn3ugxpdia via pipe 127.0.0.1:52956
src/mesh.c:257 mesh_receive() incoming handshake for link rtvyrw4ewkw7l6b2ohflknk4iyvr6nsu7nqpewh7qu3gxp7o5voa
src/link.c:235 link_handshake() link ready
src/ext/link.c:60 ext_link_status() link down
src/ext/link.c:101 link_on_link() auto-linking
src/ext/link.c:61 ext_link_status() initiating new link channel
src/e3x/channel3.c:64 channel3_new() new reliable channel 01000000 2 link
src/link.c:331 link_channel() new outgoing channel open: link
src/mesh.c:202 mesh_receive() mesh receiving channel to piqwg6tgfmiecqvpnrhj7rrplfkuaed7g575uk7ajorn3ugxpdia via pipe 127.0.0.1:52956
src/e3x/exchange3.c:167 exchange3_receive() decrypted head 29 body 0
src/mesh.c:286 mesh_receive() channel packet 31 bytes from rtvyrw4ewkw7l6b2ohflknk4iyvr6nsu7nqpewh7qu3gxp7o5voa
src/ext/link.c:37 link_on_open() note: new incoming link channel replacing existing one
src/ext/link.c:39 link_on_open() incoming link channel open
src/e3x/channel3.c:64 channel3_new() new reliable channel 02000000 1 link
src/link.c:331 link_channel() new outgoing channel open: link
src/ext/link.c:101 link_on_link() auto-linking
src/e3x/channel3.c:219 channel3_send() channel send 1 {"c":1,"seq":1}
src/e3x/exchange3.c:177 exchange3_send() encrypting head 15 body 2
src/net/udp4.c:21 udp4_send() udp4 to rtvyrw4ewkw7l6b2ohflknk4iyvr6nsu7nqpewh7qu3gxp7o5voa
00:00:00.062 | rtvy piqw | e3x.tx       | RCV token=c4dd78a91a0a8140a35e525590452661 from={"type":"udp4","ip":"127.0.0.1","port":61147}
00:00:00.062 | rtvy piqw | mesh         | Linked
00:00:01.063 | rtvy piqw | e3x          | Closed channel "link" 1
00:00:01.063 | rtvy piqw | e3x          | Closed exchange
00:00:01.063 | rtvy piqw | e3x          | Closed exchange
2014/11/18 10:18:21 Bye