Skip to content

Commit 131bb2b

Browse files
authored
Merge pull request #15 from RandyMcMillan/more-play-command-1
play: add commands & more help
2 parents 06e8df4 + 7039b1e commit 131bb2b

File tree

2 files changed

+41
-19
lines changed

2 files changed

+41
-19
lines changed

.github/workflows/plebnet-playground.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ jobs:
4343
sudo apt install -y mkdocs
4444
pip install -r docs/requirements.txt
4545
make init report
46+
play
4647
make install
4748
#make uninstall
4849
@@ -60,6 +61,7 @@ jobs:
6061
sudo apt install -y mkdocs
6162
pip install -r docs/requirements.txt
6263
make init report
64+
play
6365
make install
6466
#make uninstall
6567

scripts/play

Lines changed: 39 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -35,33 +35,51 @@ export TOR_IMAGE
3535
for ((i=1;i<=$#;i++));
3636
do
3737

38-
if [[ ${!i} = *id ]]; then
38+
if [[ ${!i} = *ids ]]; then
3939
((i++))
40+
echo THUNDERHUB_ID:
41+
echo $THUNDERHUB_ID
42+
echo RTL_ID:
43+
echo $RTL_ID
44+
echo LND_ID:
45+
echo $LND_ID
46+
echo DOCS_ID:
47+
echo $DOCS_ID
48+
echo BITCOIND_ID:
4049
echo $BITCOIND_ID
50+
echo TOR_ID:
51+
echo $TOR_ID
4152
exit
4253

43-
elif [[ ${!i} = *image ]]; then
54+
elif [[ ${!i} = *images ]]; then
4455
((i++))
56+
echo THUNDERHUB_IMAGE:
57+
echo $THUNDERHUB_IMAGE
58+
echo RTL_IMAGE:
59+
echo $RTL_IMAGE
60+
echo LND_IMAGE:
61+
echo $LND_IMAGE
62+
echo DOCS_IMAGE:
63+
echo $DOCS_IMAGE
64+
echo BITCOIND_IMAGES:
4565
echo $BITCOIND_IMAGE
66+
echo TOR_IMAGE:
67+
echo $TOR_IMAGE
4668
exit
4769

4870
elif [[ ${!i} = top ]]; then
4971
((i++))
50-
docker top $BITCOIND_ID
72+
docker top ${!i}
5173
exit
5274

53-
elif [[ ${!i} = start ]]; then
75+
elif [[ ${!i} = *start ]]; then
5476
((i++))
55-
[ -z "$var" ] && echo "playground-bitcoind not running" && echo "make run from folder" && exit
56-
docker exec -it $BITCOIND_ID sh -c "/usr/local/bin/entrypoint &"
57-
docker exec -it $BITCOIND_ID sh -c "/usr/local/bin/bitcoind -daemon -datadir=/home/root/.bitcoin -addnode=umbrel.local &"
58-
docker exec -it $BITCOIND_ID sh -c "/usr/local/bin/bitcoin-cli gettxoutsetinfo"
59-
docker exec -it $BITCOIND_ID sh -c "/usr/local/bin/bitcoin-cli getmininginfo"
77+
docker restart ${!i}
6078
exit
6179

6280
elif [[ ${!i} = stop ]]; then
6381
((i++))
64-
docker stop $BITCOIND_ID
82+
docker stop ${!i}
6583
exit
6684

6785
elif [[ ${!i} = *cli ]]; then
@@ -90,22 +108,24 @@ do
90108
elif [[ ${!i} == *help ]]; then
91109
((i++))
92110
echo
93-
echo "play <command> - execute shell command in container"
94-
echo "play -d '<command>' - send command to bitcoind"
95-
echo "play -cli '<command>' - send command to bitcoin-cli"
111+
echo "play ids"
112+
echo "play top <CONTAINER_ID>"
113+
echo "play start <CONTAINER_ID>"
114+
echo "play stop <CONTAINER_ID>"
96115
echo
97116
echo "Examples:"
98117
echo
99-
echo "play ls"
100-
echo "play cd / & ls -a"
101-
echo "play -cli gettxoutsetinfo"
102-
echo "play -cli getmininginfo"
103-
echo "play -cli 'getblockhash 1000'"
118+
echo "docker exec -it <CONTAINER_ID> sh - enter container shell"
119+
echo
120+
echo "playground-bitcoind"
104121
echo
105-
echo "docker exec -it $BITCOIND_ID sh -c '/usr/local/bin/bitcoind -daemon -prune=550'"
122+
echo "play -cli gettxoutsetinfo"
106123
echo "docker exec -it $BITCOIND_ID sh -c '/usr/local/bin/bitcoin-cli gettxoutsetinfo'"
124+
echo "play -cli getmininginfo"
107125
echo "docker exec -it $BITCOIND_ID sh -c '/usr/local/bin/bitcoin-cli getmininginfo'"
126+
echo "play -cli 'getblockhash 1000'"
108127
echo "docker exec -it $BITCOIND_ID sh -c '/usr/local/bin/bitcoin-cli $1'"
128+
echo
109129
exit
110130

111131
elif [ -n ${!i} ]; then

0 commit comments

Comments
 (0)