Got build scripts working
This commit is contained in:
12
Dockerfile
12
Dockerfile
@@ -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
3
docker/logs.sh
Normal file
@@ -0,0 +1,3 @@
|
||||
#!/bin/bash
|
||||
|
||||
tail -f /root/log/wasmd.log
|
||||
11
docker/run.sh
Normal file
11
docker/run.sh
Normal 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
7
docker/setup.sh
Executable 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
|
||||
@@ -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
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user