Skip to content

Commit 7fca7b4

Browse files
committed
Update the new SDK teleport example
1 parent 3ad36d4 commit 7fca7b4

7 files changed

Lines changed: 15 additions & 13 deletions

File tree

examples/nativeMode/template/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,4 +111,4 @@ that are still running.
111111
## `doNew.sh`
112112

113113
This is ascript that you can use to start a new instance of your application from a clean state.
114-
This scrip simply invokes `terminate.sh` and `run.sh` sequentially.
114+
This script simply invokes `terminate.sh` and `run.sh` sequentially.

examples/new-sdk/teleport/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,12 +101,12 @@ Now you can run:
101101

102102
* on Bob:
103103
```shell
104-
python teleport-bob.py
104+
python bobTest.py
105105
```
106106

107107
* on Alice:
108108
```shell
109-
python teleport-alice.py
109+
python aliceTest.py
110110
```
111111

112112
The code assumes you start Bob before starting Alice. Using your knowledge of network programming
File renamed without changes.

examples/new-sdk/teleport/doNew.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/usr/bin/env bash
2+
3+
./terminate.sh
4+
./run.sh

examples/new-sdk/teleport/run.sh

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,6 @@ if [ ! -f ~/.simulaqron_pids/simulaqron_network_default.pid ]; then
66
simulaqron start --nodes=Alice,Bob --network-config-file simulaqron_network.json
77
fi
88

9-
python3 teleport-bob.py &
10-
SERVERPID=$!
9+
python3 bobTest.py &
1110
sleep 1
12-
python3 teleport-alice.py
13-
14-
# Kill the server after it was used
15-
kill -9 $SERVERPID
11+
python3 aliceTest.py
Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,16 @@
11
#!/usr/bin/env sh
2-
TEST_PIDS=$(ps aux | grep python | grep -E "teleport" | awk {'print $2'})
2+
TEST_PIDS=$(ps aux | grep python | grep -E "Test" | awk {'print $2'})
33
if [ "$TEST_PIDS" != "" ]
44
then
55
kill -9 $TEST_PIDS
66
fi
77

8-
simulaqron stop
9-
108
# Check if SimulaQron is running
119
if [ -f ~/.simulaqron_pids/simulaqron_network_default.pid ]; then
12-
cat $HOME/.simulaqron_pids/simulaqron_network_default.pid | xargs kill -9
10+
if ! simulaqron stop
11+
then
12+
# Kill the process, only if simulaqron could not be stopped gracefully
13+
cat $HOME/.simulaqron_pids/simulaqron_network_default.pid | xargs kill -9
14+
fi
1315
fi
1416

0 commit comments

Comments
 (0)