Skip to content

Commit

Permalink
Script to start and stop local daml-on-sawtooth
Browse files Browse the repository at this point in the history
1. Add bash script to ensure that daml-on-sawtooth starts cleanly. This
is to avoid any stale keys stopping validator from starting.

2. Update README to reflect use of script.

Signed-off-by: Paul Sitoh <[email protected]>
  • Loading branch information
paulwizviz committed Jan 2, 2020
1 parent 4d6d661 commit 119166e
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 2 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@ Please refer to [BUILD.md](./BUILD.md) for further instructions.

* Open a terminal and `cd` into the project folder (i.e. location where you git clone the daml-on-sawtooth project) described in step 2.

* To run up a development copy of daml-on-sawtooth, run this command `docker-compose -f ./docker/compose/daml-local.yaml up`. This will start-up single node sawtooth environment, running the devmode consensus and a DAML environment.
* To run up a development copy of daml-on-sawtooth, and at the top level ot the project, run this command `./docker/run.sh stop`. This will start-up single node sawtooth environment, running the devmode consensus and a DAML environment.

* To shutdown the application by running the following command `docker-compose -f ./docker/compose/daml-local.yaml down`.
* To shutdown the application by running the following command `./docker/run.sh stop`.

### 4. Interacting with daml-on-sawtooth using daml navigator

Expand Down
26 changes: 26 additions & 0 deletions docker/run.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#!/bin/bash

COMMAND=$1

function start(){
if [ -d ${PWD}/docker/keys ]; then
rm -rf ${PWD}/docker/keys
fi
docker-compose -f ${PWD}/docker/compose/daml-local.yaml up
}

function stop(){
if [ -d ${PWD}/docker/keys ]; then
rm -rf ${PWD}/docker/keys
fi
docker-compose -f ${PWD}/docker/compose/daml-local.yaml down
}

case "$COMMAND" in
start)
start
;;
stop)
stop
;;
esac

0 comments on commit 119166e

Please sign in to comment.