Script for quick terminator 4x4 test

master
Mike Goelzer 6 years ago
parent de366fdd4c
commit 59a9c90813
No known key found for this signature in database
GPG Key ID: EDAC46A37751AD6D

1
.gitignore vendored

@ -3,3 +3,4 @@ pubsub-interop
content-dht-provide-find/js-dht-test/node_modules/
util/private-key-gen
pubsub/js/node_modules
ibus

@ -23,7 +23,7 @@ Running the Node.js program:
```
cd content-dht-provide-find/js-dht-test
npm install # first time only
node js-dht-test/index.js /ip4/127.0.0.1/tcp/9876/ipfs/QmehVYruznbyDZuHBV4vEHESpDevMoAovET6aJ9oRuEzWa
node js-dht-test/index.js /ip4/127.0.0.1/tcp/5555/ipfs/QmehVYruznbyDZuHBV4vEHESpDevMoAovET6aJ9oRuEzWa
```
@ -34,6 +34,8 @@ node js-dht-test/index.js /ip4/127.0.0.1/tcp/9876/ipfs/QmehVYruznbyDZuHBV4vEHESp
**What it demonstrates**: Two Go peers, one JS peer, and one Rust peer are all created and run a chat server using a shared PubSub topic. Typing text in any peer sends it to all the other peers.
**Quick test**: `cd pubsub` and then run `./test/test.sh`. Requires Terminator (eg, `sudo apt-get install terminator`). The rest of this section describes how to test manually.
(**TODO**: eliminate centralized bootstrapper; any peer should be able to bootstrap from any other peer and peers should be able to start in any order)
**First terminal**: Create the bootstrapper node
@ -58,7 +60,7 @@ This peer, which is not in bootstrapper mode, creates a node, subscribes to the
```
cd pubsub/js
npm install # first time only
node index.js /ip4/127.0.0.1/tcp/9876/ipfs/QmehVYruznbyDZuHBV4vEHESpDevMoAovET6aJ9oRuEzWa
node index.js /ip4/127.0.0.1/tcp/5555/ipfs/QmehVYruznbyDZuHBV4vEHESpDevMoAovET6aJ9oRuEzWa
```
This JS peer will fire off a hello message every few seconds, which the other two subscribing nodes can see.
@ -67,13 +69,10 @@ This JS peer will fire off a hello message every few seconds, which the other tw
```
cd pubsub/rust
cargo run /ip4/0.0.0.0/tcp/9879
# Wait for it to start up
/dial /ip4/127.0.0.1/tcp/9876
# Now type any message to publish
cargo run
```
The Rust peer listens on the CLI-specified port (9879 in the above example), and then the `/dial` command causes it to dial out to the boostrap host. (TODO: rust-libp2p#471) It is now subscribed to the same topic as the other peers.
The Rust peer starts up, listens on port 6002, and then dials the boostrap peer. (TODO: rust-libp2p#471) It is now subscribed to the same topic as the other peers.
If you return to the second, third or fourth terminals and type a message, the bootstrapper and the other 2 peers will all print your message.

@ -0,0 +1,74 @@
[global_config]
suppress_multiple_term_dialog = True
[keybindings]
[layouts]
[[default]]
[[[child1]]]
command = ""
parent = window0
type = Terminal
[[[window0]]]
parent = ""
type = Window
[[FourByFour]]
[[[child0]]]
fullscreen = False
last_active_term = e05bb5f2-7bce-41c4-a19b-26be884919df
last_active_window = True
maximised = True
order = 0
parent = ""
position = 71:55
size = 734, 451
title = PubSub Demo (Go, JS, Rust)
type = Window
[[[child1]]]
order = 0
parent = child0
position = 223
ratio = 0.5
type = VPaned
[[[child2]]]
order = 0
parent = child1
position = 365
ratio = 0.500685871056
type = HPaned
[[[child5]]]
order = 1
parent = child1
position = 365
ratio = 0.500685871056
type = HPaned
[[[terminal3]]]
profile = default
command = 'pushd .. ; ./pubsub-interop -b ../util/private_key.bin.bootstrapper.Wa; popd ; bash'
order = 0
parent = child2
type = Terminal
uuid = e05bb5f2-7bce-41c4-a19b-26be884919df
[[[terminal4]]]
profile = default
command = 'sleep 1 ; pushd .. ; ./pubsub-interop ../util/private_key.bin.peer.Sk; popd ; bash'
order = 1
parent = child2
type = Terminal
uuid = a551b167-2da7-4994-ac12-5063852055da
[[[terminal6]]]
profile = default
command = 'sleep 1 ; pushd ../js ; node index.js /ip4/127.0.0.1/tcp/5555/ipfs/QmehVYruznbyDZuHBV4vEHESpDevMoAovET6aJ9oRuEzWa; popd ; bash'
order = 0
parent = child5
type = Terminal
uuid = 8358280f-49da-4a74-bb27-7a3c7e472fe9
[[[terminal7]]]
profile = default
command = 'sleep 1 ; pushd ../rust ; cargo run; popd ; bash'
order = 1
parent = child5
type = Terminal
uuid = 2e086797-fccb-4548-8410-9267c1a4ead8
[plugins]
[profiles]
[[default]]
cursor_color = "#aaaaaa"

@ -0,0 +1,8 @@
#!/bin/bash
SELF="$(pwd)/$0"
DIR=`dirname $SELF`
pushd $DIR
XDG_CONFIG_HOME=. terminator --layout=FourByFour
popd
Loading…
Cancel
Save