docker-compose OS file consolidation
add pseudo-service elixir-omg back into docker-compose file
tell geth websockets which interface to run on
fix docker-compose file typo
merge docker-compose files and update README
MODIFY
.gitignore
.gitignore
@@ -42,3 +42,7 @@ env/
#test files
/apps/omg_child_chain/priv/omisego_operator_test_fees_file*
+
+# VS Code config file
+.vscode/
+

MODIFY
README.md
README.md
@@ -69,21 +69,30 @@ However, if you are brave and want to test being a Tesuji Plasma chain operator,
## Service start up using Docker Compose
This is the recommended method of starting the blockchain services, with the auxiliary services automatically provisioned through Docker.
+
Before attempting the start up please ensure that you are not running any services that are listening on the following TCP ports: 9656, 7434, 5000, 8545, 5432, 5433.
All commands should be run from the root of the repo.
**NOTE** known to work with `docker-compose version 1.24.0, build 0aa59064`, version `1.17` has had problems
-### Mac
+To bring the entire system up:
+
+```sh
+docker-compose up
+```
+
+To bring only specific services up (eg: the childchain service):
```sh
-docker-compose -f docker-compose.yml -f docker-compose-full-services-mac.yml up`
+docker-compose up childchain
```
-### Linux
+_(Note: This will also bring up any services childchain depends on.)_
+
+To override and run specific Watcher code use:
```sh
-docker-compose -f docker-compose.yml -f docker-compose-full-services-non-mac.yml up`
+docker-compose -f docker-compose.yml -f docker-compose-watcher.yml up
```
### Get the deployed contract details

DELETE
docker-compose-full-services-mac.yml
-version: "2.1"
-services:
- geth:
- image: ethereum/client-go:v1.8.21
- entrypoint: /bin/sh -c "apk add curl && geth --targetgaslimit "6200000" --dev --dev.period 1 --rpc --rpcapi personal,web3,eth,net --rpcaddr 0.0.0.0 --rpcvhosts=* --rpcport=8545 --ws --wsorigins='*'"
- ports:
- - "8545:8545"
- healthcheck:
- test: curl docker.for.mac.localhost:8545
- interval: 5s
- timeout: 3s
- retries: 5
-
- elixir-omg:
- build: .
- image: elixir-omg:dockercompose
-
- contractexchanger:
- image: jakebunce/contractexchanger:v0.0.2
- ports:
- - "5000:5000"
- healthcheck:
- test: curl docker.for.mac.localhost:5000
- interval: 5s
- timeout: 3s
- retries: 5
- depends_on:
- geth:
- condition: service_healthy
-
- childchain:
- image: elixir-omg:dockercompose
- entrypoint: /bin/bash -c "./launcher.py && elixir --erl '-sname childchain' -S mix xomg.child_chain.start --config ~/config.exs"
- environment:
- - MIX_ENV=dev
- - EXIT_PERIOD_SECONDS=86400
- - ELIXIR_SERVICE=CHILDCHAIN
- - CONTRACT_EXCHANGER_URL=http://docker.for.mac.localhost:5000
- - ETHEREUM_RPC_URL=http://docker.for.mac.localhost:8545
- - CHILD_CHAIN_URL=http://docker.for.mac.localhost:9656
- - ETHEREUM_NETWORK=LOCALCHAIN
- restart: always
- ports:
- - "9656:9656"
- healthcheck:
- test: curl docker.for.mac.localhost:9656
- interval: 10s
- timeout: 3s
- retries: 7
- depends_on:
- geth:
- condition: service_healthy
- contractexchanger:
- condition: service_healthy
-
- watcher:
- image: elixir-omg:dockercompose
- entrypoint: /bin/bash -c "./launcher.py && elixir --erl '-sname watcher' -S mix xomg.watcher.start --convenience --config ~/config_watcher.exs "
- environment:
- - MIX_ENV=dev
- - ELIXIR_SERVICE=WATCHER
- - CONTRACT_EXCHANGER_URL=http://docker.for.mac.localhost:5000
- - ETHEREUM_RPC_URL=http://docker.for.mac.localhost:8545
- - CHILD_CHAIN_URL=http://docker.for.mac.localhost:9656
- - ETHEREUM_NETWORK=LOCALCHAIN
- - DATABASE_URL=postgres://omisego_dev:omisego_dev@docker.for.mac.localhost:5433/omisego_dev
- restart: always
- ports:
- - "7434:7434"
- healthcheck:
- test: curl docker.for.mac.localhost:7434
- interval: 5s
- timeout: 3s
- retries: 5
- depends_on:
- childchain:
- condition: service_healthy

DELETE
docker-compose-full-services-non-mac.yml
-version: "2.1"
-services:
- geth:
- image: ethereum/client-go:v1.8.21
- entrypoint: /bin/sh -c "apk add curl && geth --targetgaslimit "6200000" --dev --dev.period 1 --rpc --rpcapi personal,web3,eth,net --rpcaddr 0.0.0.0 --rpcvhosts=* --rpcport=8545 --ws --wsorigins='*'"
- ports:
- - "8545:8545"
- network_mode: "host"
- healthcheck:
- test: curl localhost:8545
- interval: 5s
- timeout: 3s
- retries: 5
-
- contractexchanger:
- image: jakebunce/contractexchanger:v0.0.2
- ports:
- - "5000:5000"
- network_mode: "host"
- healthcheck:
- test: curl localhost:5000
- interval: 5s
- timeout: 3s
- retries: 5
- depends_on:
- geth:
- condition: service_healthy
-
- childchain:
- image: elixir-omg:dockercompose
- entrypoint: /bin/bash -c "./launcher.py && elixir --erl '-sname childchain' -S mix xomg.child_chain.start --config ~/config.exs"
- environment:
- - MIX_ENV=dev
- - EXIT_PERIOD_SECONDS=86400
- - ELIXIR_SERVICE=CHILDCHAIN
- - CONTRACT_EXCHANGER_URL=http://localhost:5000
- - ETHEREUM_RPC_URL=http://localhost:8545
- - CHILD_CHAIN_URL=http://localhost:9656
- - ETHEREUM_NETWORK=LOCALCHAIN
- restart: always
- ports:
- - "9656:9656"
- network_mode: "host"
- healthcheck:
- test: curl localhost:9656
- interval: 7s
- timeout: 3s
- retries: 15
- depends_on:
- geth:
- condition: service_healthy
- contractexchanger:
- condition: service_healthy
-
- watcher:
- image: elixir-omg:dockercompose
- entrypoint: /bin/bash -c "./launcher.py && elixir --erl '-sname watcher' -S mix xomg.watcher.start --convenience --config ~/config_watcher.exs"
- environment:
- - MIX_ENV=dev
- - ELIXIR_SERVICE=WATCHER
- - CONTRACT_EXCHANGER_URL=http://localhost:5000
- - ETHEREUM_RPC_URL=http://localhost:8545
- - CHILD_CHAIN_URL=http://localhost:9656
- - ETHEREUM_NETWORK=LOCALCHAIN
- - DATABASE_URL=postgres://omisego_dev:omisego_dev@localhost:5433/omisego_dev
- restart: always
- ports:
- - "7434:7434"
- network_mode: "host"
- healthcheck:
- test: curl localhost:7434
- interval: 5s
- timeout: 3s
- retries: 5
- depends_on:
- childchain:
- condition: service_healthy

DELETE
docker-compose-watcher-non-mac.yml
-version: "2.1"
-services:
- watcher:
- image: omisego/watcher:latest
- command: "full_local"
- environment:
- - ETHEREUM_RPC_URL=https://rinkeby.infura.io/v3/<your_api_key>
- - ETHEREUM_WS_RPC_URL=wss://rinkeby.infura.io/ws/v3/<your_api_key>
- - CHILD_CHAIN_URL=http://samrong.omg.network
- - ETHEREUM_NETWORK=RINKEBY
- - RINKEBY_CONTRACT_ADDRESS=0x740ecec4c0ee99c285945de8b44e9f5bfb71eea7
- - RINKEBY_TXHASH_CONTRACT=0x29f8cd44b4b94a148f779105f0e09e06f762b411ebef6c499281b74d45818c1c
- - RINKEBY_AUTHORITY_ADDRESS=0x41863dafbdf8cfc2a33fc38c0b525b6343d857b3
- - DATABASE_URL=postgres://omisego_dev:omisego_dev@localhost:5433/omisego_dev
- - NODE_HOST=127.0.0.1
- restart: always
- ports:
- - "7434:7434"
- network_mode: "host"
- healthcheck:
- test: curl localhost:7434
- interval: 5s
- timeout: 3s
- retries: 5
- depends_on:
- postgres:
- condition: service_healthy

RENAME
docker-compose-watcher-mac.yml
docker-compose-watcher.yml
@@ -7,20 +7,19 @@ services:
context: ./
dockerfile: Dockerfile.watcher
environment:
- - ETHEREUM_RPC_URL=https://rinkeby.infura.io/v3/<your_api_key>
- - ETHEREUM_WS_RPC_URL=wss://rinkeby.infura.io/ws/v3/<your_api_key>
+ - ETHEREUM_RPC_URL=https://rinkeby.infura.io/v3/${INFURA_API_KEY}
+ - ETHEREUM_WS_RPC_URL=wss://rinkeby.infura.io/ws/v3/${INFURA_API_KEY}
- CHILD_CHAIN_URL=http://samrong.omg.network
- ETHEREUM_NETWORK=RINKEBY
- RINKEBY_CONTRACT_ADDRESS=0x740ecec4c0ee99c285945de8b44e9f5bfb71eea7
- RINKEBY_TXHASH_CONTRACT=0x29f8cd44b4b94a148f779105f0e09e06f762b411ebef6c499281b74d45818c1c
- RINKEBY_AUTHORITY_ADDRESS=0x41863dafbdf8cfc2a33fc38c0b525b6343d857b3
- - DATABASE_URL=postgres://omisego_dev:omisego_dev@docker.for.mac.localhost:5433/omisego_dev
+ - DATABASE_URL=postgres://omisego_dev:omisego_dev@postgres:5432/omisego_dev
- NODE_HOST=127.0.0.1
ports:
- "7434:7434"
- network_mode: "host"
healthcheck:
- test: curl docker.for.mac.localhost:7434
+ test: curl watcher:7434
interval: 5s
timeout: 3s
retries: 5

MODIFY
docker-compose.dev.yml
docker-compose.dev.yml
version: "2.1"
services:
elixir-omg:
+ build: .
+ image: elixir-omg:dockercompose
environment:
DATABASE_URL: postgres://omisego_dev:omisego_dev@postgres:5432/omisego_dev
volumes:

MODIFY
docker-compose.yml
docker-compose.yml
version: "2.1"
services:
postgres:
- image: postgres
+ image: postgres:9.6.13-alpine
restart: always
ports:
- "5433:5432"
@@ -17,8 +17,89 @@ services:
elixir-omg:
build: .
image: elixir-omg:dockercompose
+
+ geth:
+ image: ethereum/client-go:v1.8.21
+ entrypoint: /bin/sh -c "apk add curl && geth --targetgaslimit "6200000" --dev --dev.period 1 --rpc --rpcapi personal,web3,eth,net --rpcaddr 0.0.0.0 --rpcvhosts=* --rpcport=8545 --ws --wsaddr 0.0.0.0 --wsorigins='*'"
+ ports:
+ - "8545:8545"
+ - "8546:8546"
+ expose:
+ - "8546"
+ - "8545"
+ healthcheck:
+ test: curl geth:8545
+ interval: 5s
+ timeout: 3s
+ retries: 5
+
+ contractexchanger:
+ image: jakebunce/contractexchanger:v0.0.2
+ ports:
+ - "5000:5000"
+ expose:
+ - "5000"
+ healthcheck:
+ test: curl contractexchanger:5000
+ interval: 5s
+ timeout: 3s
+ retries: 5
+ depends_on:
+ geth:
+ condition: service_healthy
+
+ childchain:
+ image: elixir-omg:dockercompose
+ entrypoint: /bin/bash -c "./launcher.py && elixir --erl '-sname childchain' -S mix xomg.child_chain.start --config ~/config.exs"
+ environment:
+ - MIX_ENV=dev
+ - EXIT_PERIOD_SECONDS=86400
+ - ELIXIR_SERVICE=CHILDCHAIN
+ - CONTRACT_EXCHANGER_URL=http://contractexchanger:5000
+ - ETHEREUM_RPC_URL=http://geth:8545
+ - ETHEREUM_WS_RPC_URL=ws://geth:8546
+ - CHILD_CHAIN_URL=http://childchain:9656
+ - ETHEREUM_NETWORK=LOCALCHAIN
+ restart: always
+ ports:
+ - "9656:9656"
+ expose:
+ - "9656"
+ healthcheck:
+ test: curl childchain:9656
+ interval: 7s
+ timeout: 3s
+ retries: 15
depends_on:
+ geth:
+ condition: service_healthy
+ contractexchanger:
+ condition: service_healthy
+
+ watcher:
+ image: elixir-omg:dockercompose
+ entrypoint: /bin/bash -c "./launcher.py && elixir --erl '-sname watcher' -S mix xomg.watcher.start --convenience --config ~/config_watcher.exs"
+ environment:
+ - MIX_ENV=dev
+ - ELIXIR_SERVICE=WATCHER
+ - CONTRACT_EXCHANGER_URL=http://contractexchanger:5000
+ - ETHEREUM_RPC_URL=http://geth:8545
+ - ETHEREUM_WS_RPC_URL=ws://geth:8546
+ - CHILD_CHAIN_URL=http://childchain:9656
+ - ETHEREUM_NETWORK=LOCALCHAIN
+ - DATABASE_URL=postgres://omisego_dev:omisego_dev@postgres:5432/omisego_dev
+ restart: always
+ ports:
+ - "7434:7434"
+ expose:
+ - "7434"
+ healthcheck:
+ test: curl watcher:7434
+ interval: 5s
+ timeout: 3s
+ retries: 5
+ depends_on:
+ childchain:
+ condition: service_healthy
postgres:
condition: service_healthy
- links:
- - postgres

docker-compose OS file consolidation

add pseudo-service elixir-omg back into docker-compose file

tell geth websockets which interface to run on

fix docker-compose file typo

merge docker-compose files and update README