Skip to content

Commit

Permalink
Persist ledger.
Browse files Browse the repository at this point in the history
  • Loading branch information
brycecurtis committed Mar 23, 2018
1 parent cc09a86 commit ce37aad
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 3 deletions.
10 changes: 9 additions & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ services:
- DOCKERHOST=${DOCKERHOST}
networks:
- von
volumes:
- von-client-cli:/home/indy/.indy-cli
- von-client-libindy:/var/lib/indy

#
# Webserver
Expand All @@ -34,6 +37,7 @@ services:
- node4
volumes:
- ./server:/home/indy/server
- von-webserver:/home/indy/.indy-cli
- node1-data:/home/indy/.mnt/node1
- node2-data:/home/indy/.mnt/node2
- node3-data:/home/indy/.mnt/node3
Expand Down Expand Up @@ -113,4 +117,8 @@ volumes:
node1-data:
node2-data:
node3-data:
node4-data:
node4-data:
von-client-cli:
von-client-libindy:
von-webserver:

9 changes: 7 additions & 2 deletions manage
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ case "$1" in
else
if [[ $2 == *","* ]]; then
# If arg contains comma, then it should be multiple IPS
IPS=$2 docker-compose up --force-recreate webserver node1 node2 node3 node4
IPS=$2 docker-compose up webserver node1 node2 node3 node4
else
IP=$2 docker-compose up --force-recreate webserver node1 node2 node3 node4
IP=$2 docker-compose up webserver node1 node2 node3 node4
fi
fi
;;
Expand All @@ -39,6 +39,11 @@ case "$1" in
rebuild)
docker-compose build --no-cache
;;
rm)
docker-compose stop
docker rm -f von_node1_1 von_node2_1 von_node3_1 von_node4_1 von_webserver_1 || true
docker volume rm -f von_node1-data von_node2-data von_node3-data von_node4-data von_von-client-cli von_von-client-libindy von_von-webserver
;;
*)
echo $"Usage: $0 {start|cli|stop|build|rebuild}"
esac
Expand Down
3 changes: 3 additions & 0 deletions scripts/start_node.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ set -e
NODE_NUM="${1}"
START_PORT="9700"

if [ ! -d "/var/lib/indy/sandbox/keys" ]; then
echo "Ledger does not exist - Creating..."
if [ ! -z "$IPS" ]; then
echo von_generate_transactions -s "$IPS" -n "$NODE_NUM"
von_generate_transactions -s "$IPS" -n "$NODE_NUM"
Expand All @@ -28,6 +30,7 @@ fi
# start_indy_node "Node""$NODE_NUM" $((START_PORT + ( NODE_NUM * 2 ) - 1 )) $(( START_PORT + ( NODE_NUM * 2 ) ))
# fi

fi

echo start_indy_node "Node""$NODE_NUM" $((START_PORT + ( NODE_NUM * 2 ) - 1 )) $(( START_PORT + ( NODE_NUM * 2 ) ))
start_indy_node "Node""$NODE_NUM" $((START_PORT + ( NODE_NUM * 2 ) - 1 )) $(( START_PORT + ( NODE_NUM * 2 ) ))
3 changes: 3 additions & 0 deletions scripts/start_webserver.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

set -e

if [ ! -d "/home/indy/.indy-cli/networks/sandbox" ]; then
echo "Ledger does not exist - Creating..."
if [ ! -z "$IPS" ]; then
echo von_generate_transactions -s "$IPS"
von_generate_transactions -s "$IPS"
Expand All @@ -13,5 +15,6 @@ else
von_generate_transactions
fi

fi

cd server && pipenv run python server.py

0 comments on commit ce37aad

Please sign in to comment.