-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathquickstart.sh
More file actions
85 lines (73 loc) · 2.21 KB
/
Copy pathquickstart.sh
File metadata and controls
85 lines (73 loc) · 2.21 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
#!/bin/bash
previewVersion=$(jq -r '.previewVersion' preview_version.json)
quickstartHash=$(jq -r '.quickstartHash' preview_version.json)
set -e
case "$1" in
standalone)
echo "Using standalone network"
ARGS="--local --enable-soroban-diagnostic-events"
;;
futurenet)
echo "Using Futurenet network"
ARGS="--futurenet"
;;
testnet)
echo "Using Testnet network"
ARGS="--testnet"
;;
*)
echo "Usage: $0 standalone|futurenet|testnet"
exit 1
;;
esac
shift
echo "1. Creating docker soroban network"
(docker network inspect soroban-network -f '{{.Id}}' 2>/dev/null) \
|| docker network create soroban-network
echo " "
echo " "
echo "2. Searching for a previous soroban-preview-${previewVersion}-dos docker container"
containerID=$(docker ps --filter=`name=soroban-preview-${previewVersion}-dos` --all --quiet)
if [[ ${containerID} ]]; then
echo "Start removing soroban-preview-${previewVersion}-dos container."
docker rm --force soroban-preview-${previewVersion}-dos
echo "Finished removing soroban-preview-${previewVersion}-dos container."
else
echo "No previous soroban-preview-${previewVersion}-dos container was found"
fi
echo " "
echo " "
echo "3. Searching for a previous stellar-dos container"
containerID=$(docker ps --filter=`name=stellar-dos` --all --quiet)
if [[ ${containerID} ]]; then
echo "Start removing stellar-dos container."
docker rm --force stellar-dos
echo "Finished removing stellar-dos container."
else
echo "No previous stellar-dos container was found"
fi
echo " "
echo " "
echo "4. Run a soroban-preview-${previewVersion}-dos container"
currentDir=$(pwd)
docker run -dti \
--volume ${currentDir}:/workspace \
--name soroban-preview-${previewVersion}-dos \
-p 8011:8000 \
--ipc=host \
--network soroban-network \
esteblock/soroban-preview:${previewVersion}
echo " "
echo " "
echo "5. Run a stellar-dos quickstart container"
# Run the stellar-dos quickstart image
docker run --rm -ti \
--name stellar-dos \
--network soroban-network \
-p 8010:8000 \
stellar/quickstart:${quickstartHash} \
$ARGS \
--enable-soroban-rpc \
--protocol-version 20 \
--enable-soroban-diagnostic-events \
"$@" # Pass through args from the CLI