ocean-subgraph/docker/setup.sh
Matthias Kretschmann f1a8269036
Activate dependabot, build tweaks, green CI (#6)
* activate dependabot

* package updates

* move auto-generated typings, adapt .gitignore

* lint fix

* eslint config tweaks, turn off eqeqeq rule

* kick out Travis, switch to GitHub Actions

* Update the readme file.

* Add totalOceanLiquidity and fix TVL calculation

* add logs to track pool shares.

* lockedValue fix

* update variable names

* Feature/devel instructions (#19)

* improve developer docs

* fix readme

Signed-off-by: mihaisc <mihai.scarlat@smartcontrol.ro>

* update gitignore

Signed-off-by: mihaisc <mihai.scarlat@smartcontrol.ro>

* .env, and infura key

Signed-off-by: mihaisc <mihai.scarlat@smartcontrol.ro>

Co-authored-by: mihaisc <mihai.scarlat@smartcontrol.ro>

* merged/dependabot-tvl-fix (#21)

* Update the readme file.

* Add totalOceanLiquidity and fix TVL calculation

* add logs to track pool shares.

* update variable names

* fix error after merge

Co-authored-by: ssallam <travis@travis-ci.org>

* use const

Co-authored-by: ssallam <travis@travis-ci.org>
Co-authored-by: Alex Coseru <alex.coseru@gmail.com>
Co-authored-by: mihaisc <mihai.scarlat@smartcontrol.ro>
Co-authored-by: Samer <36411297+ssallam@users.noreply.github.com>
2021-02-09 11:13:31 +01:00

43 lines
985 B
Bash
Executable File

#!/usr/bin/env bash
set -e
if ! which docker 2>&1 > /dev/null; then
echo "Please install 'docker' first"
exit 1
fi
if ! which docker-compose 2>&1 > /dev/null; then
echo "Please install 'docker-compose' first"
exit 1
fi
if ! which jq 2>&1 > /dev/null; then
echo "Please install 'jq' first"
exit 1
fi
# Create the graph-node container
docker-compose up --no-start graph-node
# Start graph-node so we can inspect it
docker-compose start graph-node
# Identify the container ID
CONTAINER_ID=$(docker container ls | grep graph-node | cut -d' ' -f1)
# Inspect the container to identify the host IP address
HOST_IP=$(docker inspect "$CONTAINER_ID" | jq -r .[0].NetworkSettings.Networks[].Gateway)
echo "Host IP: $HOST_IP"
# Inject the host IP into docker-compose.yml
sed -i -e "s/host.docker.internal/$HOST_IP/g" docker-compose.yml
function stop_graph_node {
# Ensure graph-node is stopped
docker-compose stop graph-node
}
trap stop_graph_node EXIT