Got build scripts working

This commit is contained in:
Ethan Frey
2020-01-21 19:26:14 +01:00
parent 45a3f36e85
commit 09218ed942
5 changed files with 61 additions and 4 deletions

View File

@@ -17,4 +17,16 @@ COPY . .
RUN make tools
RUN make install
COPY docker/* /opt/
RUN chmod +x /opt/*.sh
WORKDIR /opt
# rest server
EXPOSE 1317
# tendermint p2p
EXPOSE 26656
# tendermint rpc
EXPOSE 26657
CMD ["wasmd"]

3
docker/logs.sh Normal file
View File

@@ -0,0 +1,3 @@
#!/bin/bash
tail -f /root/log/wasmd.log

11
docker/run.sh Normal file
View File

@@ -0,0 +1,11 @@
#!/bin/bash
echo Starting Wasmd...
mkdir -p /root/log
wasmd start --rpc.laddr tcp://0.0.0.0:26657 > /root/log/wasmd.log &
sleep 10
echo Starting Rest Server...
wasmcli rest-server --laddr tcp://0.0.0.0:1317 --trust-node

7
docker/setup.sh Executable file
View File

@@ -0,0 +1,7 @@
#!/bin/sh
wasmd init --chain-id=testing testing
wasmcli keys add validator
wasmd add-genesis-account validator 1000000000stake,1000000000validatortoken
wasmd gentx --name validator
wasmd collect-gentxs

View File

@@ -1,8 +1,6 @@
approach 1:
Build:
`docker build -t wasmd:manual .`
Build: `docker build -t wasmd:manual .`
Start from the outside
@@ -42,4 +40,30 @@ panic: too many failed passphrase attempts
goroutine 1 [running]:
github.com/cosmos/cosmos-sdk/crypto/keys.keyringKeybase.writeInfo(0x13b4720, 0xc0008ea0f0, 0x7ffdf0302f1a, 0x9, 0x13b4860, 0xc0008ea2a0)
```
```
approach 3:
Use scripts inside docker:
Build: `docker build -t wasmd:manual .`
Run:
```sh
docker volume rm -f wasmd_data
# pick a simple (8 char) passphrase for testing.. you will type it many times
docker run --rm -it \
--mount type=volume,source=wasmd_data,target=/root \
wasmd:manual ./setup.sh
docker run --rm -it -p 26657:26657 -p 26656:26656 -p 1317:1317 \
--mount type=volume,source=wasmd_data,target=/root \
wasmd:manual ./run.sh
# view logs in another shell
docker run --rm -it \
--mount type=volume,source=wasmd_data,target=/root,readonly \
wasmd:manual ./logs.sh
```