Skip to content

Commit

Permalink
Feat: replay captured events on live canisters (#62)
Browse files Browse the repository at this point in the history
* replay feature

* fix stale name

* update demo scripts

* frame order and frame rate

* fix de-queuing behavior
  • Loading branch information
matthewhammer authored Jan 14, 2021
1 parent c26ac37 commit 50e8521
Show file tree
Hide file tree
Showing 8 changed files with 485 additions and 161 deletions.
34 changes: 29 additions & 5 deletions scripts/MirrorGarden-demo.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,40 @@
VERSION=`cat .DFX_VERSION`
export PATH=~/.cache/dfinity/versions/$VERSION:`pwd`:$PATH
echo
echo Starting: Mirror Garden 2-user demo...using DFINITY SDK replica
echo Starting: Mirror Garden demo...using DFINITY SDK replica
echo
dfx stop &&\
dfx start --background --clean &&\
dfx canister create MirrorGarden &&\
dfx build MirrorGarden &&\
dfx canister install MirrorGarden

ic-mt ${1} connect 127.0.0.1:8000 `dfx canister id MirrorGarden` --user '("Alice", (100, 200, 200))' &
ic-mt ${1} connect 127.0.0.1:8000 `dfx canister id MirrorGarden` --user '("Bob", (200, 100, 200))' &
echo
echo Mirror Garden 2-user demo, started.
echo Mirror Garden canister:
echo `dfx canister id MirrorGarden`
echo
echo Hint: Ready for manual mini-terminal connection:
echo For example:
echo
echo ic-mt connect 127.0.0.1:8000 `dfx canister id MirrorGarden` --user '("xyz", (100, 200, 200))'
echo
case ${1} in
"" | "0")
echo No initial terminals requested. All done.
;;
"1")
ic-mt ${2} connect 127.0.0.1:8000 `dfx canister id MirrorGarden` --user '("Alice", (100, 200, 200))'
echo
echo Started one live terminal for Alice.
echo
;;
"2")
ic-mt ${2} connect 127.0.0.1:8000 `dfx canister id MirrorGarden` --user '("Alice", (100, 200, 200))'
ic-mt ${2} connect 127.0.0.1:8000 `dfx canister id MirrorGarden` --user '("Bob", (200, 100, 200))' &
echo
echo Started two live terminals, for Alice and Bob.
echo
;;
*)
echo Expected a number: 0, 1 or 2, but instead got '${1}'
exit -1
esac
2 changes: 1 addition & 1 deletion scripts/icmt-kill.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh
pkill -9 replica
pkill -9 ic-gt
pkill -9 ic-mt
pkill -9 dfx
Loading

0 comments on commit 50e8521

Please sign in to comment.