forked from stellar/soroban-example-dapp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
quickstart.sh
executable file
·63 lines (53 loc) · 1.53 KB
/
quickstart.sh
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
#!/bin/bash
set -e
case "$1" in
standalone)
echo "Using standalone network"
ARGS="--local"
;;
futurenet)
echo "Using Futurenet network"
ARGS="--futurenet"
;;
*)
echo "Usage: $0 standalone|futurenet"
exit 1
;;
esac
# this is set to the quickstart `soroban-dev` image annointed as the release
# for a given Soroban Release, it is captured on Soroban Releases - https://soroban.stellar.org/docs/reference/releases
QUICKSTART_SOROBAN_DOCKER_SHA=stellar/quickstart:soroban-dev
shift
# Run the soroban-preview container
# Remember to do:
# make build-docker
echo "Creating docker soroban network"
(docker network inspect soroban-network -f '{{.Id}}' 2>/dev/null) \
|| docker network create soroban-network
echo "Searching for a previous soroban-preview docker container"
containerID=$(docker ps --filter="name=soroban-preview" --all --quiet)
if [[ ${containerID} ]]; then
echo "Start removing soroban-preview container."
docker rm --force soroban-preview
echo "Finished removing soroban-preview container."
else
echo "No previous soroban-preview container was found"
fi
currentDir=$(pwd)
docker run -dti \
--volume ${currentDir}:/workspace \
--name soroban-preview \
-p 8001:8000 \
--ipc=host \
--network soroban-network \
soroban-preview:10
# Run the stellar quickstart image
docker run --rm -ti \
--name stellar \
--pull always \
--network soroban-network \
-p 8000:8000 \
"$QUICKSTART_SOROBAN_DOCKER_SHA" \
$ARGS \
--enable-soroban-rpc \
"$@" # Pass through args from the CLI