Skip to content

Commit

Permalink
Merge pull request #52 from cosmwasm/minor_docker_demo_fixes
Browse files Browse the repository at this point in the history
Docker demo fixes
  • Loading branch information
ethanfrey authored Jan 24, 2020
2 parents eab4c94 + 6a3df66 commit 3de4ee6
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 9 deletions.
18 changes: 9 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,19 +55,19 @@ docker volume rm -f wasmd_data
# pass password (one time) as env variable for setup, so we don't need to keep typing it
# add some addresses that you have private keys for (locally) to give them genesis funds
docker run --rm -it \
-e PASSWORD=my-secret-password \
-e PASSWORD=xxxxxxxxx \
--mount type=volume,source=wasmd_data,target=/root \
cosmwasm/wasmd:manual ./setup.sh cosmos1pkptre7fdkl6gfrzlesjjvhxhlc3r4gmmk8rs6
cosmwasm/wasmd-demo:latest ./setup.sh cosmos1pkptre7fdkl6gfrzlesjjvhxhlc3r4gmmk8rs6

# This will start both wasmd and wasmcli rest-server, only wasmcli output is shown on the screen
docker run --rm -it -p 26657:26657 -p 26656:26656 -p 1317:1317 \
--mount type=volume,source=wasmd_data,target=/root \
cosmwasm/wasmd:manual ./run_all.sh
cosmwasm/wasmd-demo:latest ./run_all.sh

# view wasmd logs in another shell
docker run --rm -it \
--mount type=volume,source=wasmd_data,target=/root,readonly \
cosmwasm/wasmd:manual ./logs.sh
cosmwasm/wasmd-demo:latest ./logs.sh
```

### CI
Expand All @@ -78,9 +78,9 @@ For CI, we want to generate a template one time and save to disk/repo. Then we c
# Init chain and pass addresses so they are non-empty accounts
rm -rf ./template && mkdir ./template
docker run --rm -it \
-e PASSWORD=my-secret-password \
-e PASSWORD=xxxxxxxxx \
--mount type=bind,source=$(pwd)/template,target=/root \
cosmwasm/wasmd:manual ./setup.sh cosmos1pkptre7fdkl6gfrzlesjjvhxhlc3r4gmmk8rs6
cosmwasm/wasmd-demo:latest ./setup.sh cosmos1pkptre7fdkl6gfrzlesjjvhxhlc3r4gmmk8rs6

sudo chown -R $(id -u):$(id -g) ./template

Expand All @@ -91,15 +91,15 @@ docker volume rm -f wasmd_data
docker run --rm -it -p 26657:26657 -p 26656:26656 -p 1317:1317 \
--mount type=bind,source=$(pwd)/template,target=/template \
--mount type=volume,source=wasmd_data,target=/root \
cosmwasm/wasmd:manual ./run_all.sh /template
cosmwasm/wasmd-demo:latest ./run_all.sh /template

# RESTART CHAIN with existing state
docker run --rm -it -p 26657:26657 -p 26656:26656 -p 1317:1317 \
--mount type=volume,source=wasmd_data,target=/root \
cosmwasm/wasmd:manual ./run_all.sh
cosmwasm/wasmd-demo:latest ./run_all.sh

# view wasmd logs in another shell
docker run --rm -it \
--mount type=volume,source=wasmd_data,target=/root,readonly \
cosmwasm/wasmd:manual ./logs.sh
cosmwasm/wasmd-demo:latest ./logs.sh
```
3 changes: 3 additions & 0 deletions docker/run_all.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
#!/bin/bash
set -euo pipefail

mkdir -p /root/log
touch /root/log/wasmd.log
./run_wasmd.sh >> /root/log/wasmd.log &

sleep 4
Expand Down

0 comments on commit 3de4ee6

Please sign in to comment.