Skip to content
This repository has been archived by the owner on Nov 16, 2022. It is now read-only.

Commit

Permalink
Merge pull request #1876 from bandprotocol/fix-docker
Browse files Browse the repository at this point in the history
Update docker script fix build failed when using go-owasm local package
  • Loading branch information
Benzbeeb committed Jun 8, 2020
2 parents 550d3d8 + 9e1744e commit 87efc2d
Show file tree
Hide file tree
Showing 6 changed files with 34 additions and 21 deletions.
13 changes: 13 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
/.github
/.vscode
/assets
/band-consumer
/bridges
/lambda
/obi
/owasm
/research
/scan
/scripts
/spec

2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,5 @@
### Oracle Binary Encoding (OBI)

### MISC

- (chore) [\#1876](https://github.com/bandprotocol/bandchain/pull/1876)Update docker script fix build failed when using go-owasm local package
8 changes: 6 additions & 2 deletions chain/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
FROM golang:1.13.5-buster

WORKDIR /oracle
WORKDIR /go-owasm
COPY go-owasm/. /go-owasm

COPY . /oracle
WORKDIR /chain
COPY chain/ /chain

COPY chain/docker-config/run.sh .

RUN make install

Expand Down
15 changes: 4 additions & 11 deletions chain/docker-config/run.sh
Original file line number Diff line number Diff line change
@@ -1,17 +1,10 @@
#!/bin/bash

bandd init $1 --chain-id bandchain
bandd init $1 --chain-id bandchain --oracle band1m5lq9u533qaya4q3nfyl6ulzqkpkhge9q8tpzs

cp /oracle/docker-config/$1/priv_validator_key.json ~/.bandd/config/priv_validator_key.json
cp /oracle/docker-config/$1/node_key.json ~/.bandd/config/node_key.json
cp /oracle/docker-config/genesis.json ~/.bandd/config/genesis.json
cp -r /oracle/docker-config/files ~/.bandd

# add cors in config.toml
cd ~/.bandd/config/
sed 's/cors_allowed_origins = \[\]/cors_allowed_origins = \["\*"\]/g' config.toml > config_tmp.toml
mv config_tmp.toml config.toml
cd /oracle/
cp /chain/docker-config/$1/priv_validator_key.json ~/.bandd/config/priv_validator_key.json
cp /chain/docker-config/$1/node_key.json ~/.bandd/config/node_key.json
cp /chain/docker-config/genesis.json ~/.bandd/config/genesis.json

if [ "$1" == "query-node" ];then
sleep 10
Expand Down
3 changes: 2 additions & 1 deletion chain/docker-config/start_docker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ done

cd ../../chain

make install

# initial new node
bandd init node-validator --chain-id bandchain --oracle band1m5lq9u533qaya4q3nfyl6ulzqkpkhge9q8tpzs

Expand Down Expand Up @@ -115,7 +117,6 @@ bandd collect-gentxs

# copy genesis to the proper location!
cp ~/.bandd/config/genesis.json $DIR/genesis.json
cp -r ~/.bandd/files $DIR

# Recreate files volume
docker volume rm query-files
Expand Down
14 changes: 7 additions & 7 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ version: "3.7"
services:
multi-validator1-node:
build:
context: chain
dockerfile: Dockerfile
context: .
dockerfile: chain/Dockerfile
image: band-validator:latest
networks:
bandchain:
ipv4_address: 172.18.0.11
command: sh -c "chmod +x ./docker-config/run.sh && ./docker-config/run.sh validator1"
command: sh -c "chmod +x ./run.sh && ./run.sh validator1"

# oracle1:
# image: band-validator:latest
Expand All @@ -23,7 +23,7 @@ services:
networks:
bandchain:
ipv4_address: 172.18.0.12
command: sh -c "chmod +x ./docker-config/run.sh && ./docker-config/run.sh validator2"
command: sh -c "chmod +x ./run.sh && ./run.sh validator2"

# oracle2:
# image: band-validator:latest
Expand All @@ -39,7 +39,7 @@ services:
networks:
bandchain:
ipv4_address: 172.18.0.13
command: sh -c "chmod +x ./docker-config/run.sh && ./docker-config/run.sh validator3"
command: sh -c "chmod +x ./run.sh && ./run.sh validator3"

# oracle3:
# image: band-validator:latest
Expand All @@ -55,7 +55,7 @@ services:
networks:
bandchain:
ipv4_address: 172.18.0.14
command: sh -c "chmod +x ./docker-config/run.sh && ./docker-config/run.sh validator4"
command: sh -c "chmod +x ./run.sh && ./run.sh validator4"

# oracle4:
# image: band-validator:latest
Expand All @@ -75,7 +75,7 @@ services:
networks:
bandchain:
ipv4_address: 172.18.0.15
command: sh -c "chmod +x ./docker-config/run.sh && ./docker-config/run.sh query-node"
command: sh -c "chmod +x ./run.sh && ./run.sh query-node"

rest-server:
image: band-validator:latest
Expand Down

0 comments on commit 87efc2d

Please sign in to comment.