1
0
mirror of https://github.com/oceanprotocol/barge.git synced 2024-12-02 05:57:21 +01:00

Merge pull request #241 from oceanprotocol/feature/subgraph

add graph & split elastic
This commit is contained in:
Alex Coseru 2021-04-16 10:00:22 +03:00 committed by GitHub
commit 70684e746e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 101 additions and 19 deletions

View File

@ -9,12 +9,13 @@
- [Prerequisites](#prerequisites)
- [Get Started](#get-started)
- [Options](#options)
- [Component Versions](#component-versions)
- [Component Versions](#component-versions-and-exposed-ports)
- [All Options](#all-options)
- [Docker Building Blocks](#docker-building-blocks)
- [Aquarius](#aquarius)
- [Provider](#provider)
- [Ganache](#ganache)
- [TheGraph](#thegraph)
- [ocean-contracts](#ocean-contracts)
- [Dashboard](#dashboard)
- [Contributing](#contributing)
@ -55,13 +56,23 @@ This will run the current default versions of [Aquarius](https://github.com/ocea
The startup script comes with a set of options for customizing various things.
### Component Versions
### Component Versions and exposed ports
The default versions are always a combination of component versions which are considered stable.
| Aquarius | Provider | Ganache | ocean-contracts |
| -------- | -------- | -------- | --------------- |
| `v2.2.8` | `v0.4.9` | `latest` | `V0.5.9`
| Component name | Required by | Version | IP Address | Ports exposed |
| -------------- | ------------------ | --------------------------------- | --------------- | ------------- |
| ganache | ocean-contracts | latest | 172.15.0.3 | 8545 -> 8545 |
| ocean-contracts | | v0.5.9 | 172.15.0.14 | |
| Aquarius | | v2.2.8 | 172.15.0.5 | 5000 -> 5000 |
| Elasticsearch | Aquarius | 6.8.3 | 172.15.0.6 | |
| Provider | | v0.4.9 | 172.15.0.4 | 8030 -> 8030 |
| Provider2 | | v0.4.9 | 172.15.0.7 | 8030 -> 8030 |
| GraphNode | | oceanprotocol/graph-node:latest | 172.15.0.15 | 9000 -> 8000 ,9001 -> 8001 , 9020 -> 8020, 9030 -> 8030, 9040 -> 8040 |
| Graphipfs | | ipfs/go-ipfs:v0.4.23 | 172.15.0.16 | 5001 -> 5001 |
| Graphpgsql | | postgres | 172.15.0.7 | 5432 -> 5432 |
| Dashboard | | portainer/portainer | 172.15.0.25 | 9100 -> 9000 |
You can override the Docker image tag used for a particular component by setting its associated environment variable before calling `start_ocean.sh`:
@ -81,10 +92,12 @@ export AQUARIUS_VERSION=v2.0.0
| Option | Description |
| -------------------------- | ----------------------------------------------------------------------------------------------- |
| `--no-aquarius` | Start up Ocean without the `aquarius` Building Block. |
| `--no-elasticseach` | Start up Ocean without the `elasticsearch` Building Block. |
| `--no-provider` | Start up Ocean without the `provider` Building Block. |
| `--with-provider2` | Runs a 2nd provider, on port 8031. This is required for ocean.js/ocean.py integration tests. 2nd Provider will use the same image and parameters (log_level, ipfs gateway, compute gateway, etc) as provider1, but has a different private key |
| `--no-ganache` | Start up Ocean without the `ganache` Building Block. |
| `--no-dashboard` | Start up Ocean without the `dashboard` Building Block. |
| `--with-thegraph` | Start up Ocean with graphnode, ipfs & postgresql |
| `--skip-deploy` | Start up Ocean without deploying the contracts. Useful when ethereum node already has contracts.|
| `--force-pull` | Force pulling the latest revision of the used Docker images. |
| `--purge` | Removes the Docker containers, volumes, artifact folder and networks used by the script. |
@ -111,13 +124,19 @@ This Building Block can be disabled by setting the `--no-aquarius` flag.
| Hostname | External Port | Internal URL | Local URL | Description |
| ----------- | ------------- | --------------------- | --------------------- | --------------------------------------------------- |
| `provider` | `8030` | http://provider:9000 | http://localhost:8030 | |
| `provider` | `8030` | http://provider:8030 | http://localhost:8030 | |
### Ganache
| Hostname | External Port | Internal URL | Local URL | Description |
| ----------- | ------------- | --------------------- | --------------------- | --------------------------------------------------- |
| `ganache` | `8545` | http://ganache:9000 | http://localhost:8545 | |
| `ganache` | `8545` | http://ganache:8545 | http://localhost:8545 | |
### TheGraph
| Hostname | External Port | Internal URL | Local URL | Description |
| ----------- | ------------- | --------------------- | --------------------- | --------------------------------------------------- |
| `graphnode` | `9000` | http://graphnode:9000 | http://localhost:9000 | |
### ocean-contracts
@ -142,7 +161,7 @@ This will start a `portainer` dashboard with the following admin credentials and
| Hostname | External Port | Internal URL | Local URL | Description |
| ----------- | ------------- | --------------------- | --------------------- | --------------------------------------------------- |
| `dashboard` | `9000` | http://dashboard:9000 | http://localhost:9000 | [Portainer](https://github.com/portainer/portainer) |
| `dashboard` | `9100` | http://dashboard:9100 | http://localhost:9100 | [Portainer](https://github.com/portainer/portainer) |
## Contributing

View File

@ -1,15 +1,5 @@
version: '3'
services:
elasticsearch:
image: elasticsearch:6.8.3
networks:
backend:
ipv4_address: 172.15.0.6
environment:
ES_JAVA_OPTS: "-Xms512m -Xmx512m"
MAX_MAP_COUNT: "64000"
discovery.type: "single-node"
aquarius:
image: oceanprotocol/aquarius:${AQUARIUS_VERSION:-latest}
ports:

View File

@ -12,4 +12,4 @@ services:
volumes:
- /var/run/docker.sock:/var/run/docker.sock
ports:
- 9000:9000
- 9100:9000

View File

@ -0,0 +1,11 @@
version: '3'
services:
elasticsearch:
image: elasticsearch:6.8.3
networks:
backend:
ipv4_address: 172.15.0.6
environment:
ES_JAVA_OPTS: "-Xms512m -Xmx512m"
MAX_MAP_COUNT: "64000"
discovery.type: "single-node"

View File

@ -0,0 +1,52 @@
version: '3'
services:
graph-node:
image: oceanprotocol/graph-node:latest
ports:
- '9000:8000'
- '9001:8001'
- '9020:8020'
- '9030:8030'
- '9040:8040'
networks:
backend:
ipv4_address: 172.15.0.15
depends_on:
- ipfs
- postgres
- ocean-contracts
environment:
postgres_host: 172.15.0.17
postgres_user: graph-node
postgres_pass: let-me-in
postgres_db: graph-node
ipfs: '172.15.0.16:5001'
ethereum: 'barge:${NETWORK_RPC_URL}'
RUST_LOG: info
ipfs:
image: ipfs/go-ipfs:v0.4.23
ports:
- '5001:5001'
networks:
backend:
ipv4_address: 172.15.0.16
volumes:
- graphipfs:/data/ipfs
postgres:
image: postgres
ports:
- '5432:5432'
networks:
backend:
ipv4_address: 172.15.0.17
command: ['postgres', '-cshared_preload_libraries=pg_stat_statements']
environment:
POSTGRES_USER: graph-node
POSTGRES_PASSWORD: let-me-in
POSTGRES_DB: graph-node
volumes:
- graphpgsql:/var/lib/postgresql/data
volumes:
graphipfs:
graphpgsql:

View File

@ -159,6 +159,7 @@ COMPOSE_FILES=""
COMPOSE_FILES+=" -f ${COMPOSE_DIR}/network_volumes.yml"
COMPOSE_FILES+=" -f ${COMPOSE_DIR}/dashboard.yml"
COMPOSE_FILES+=" -f ${COMPOSE_DIR}/aquarius.yml"
COMPOSE_FILES+=" -f ${COMPOSE_DIR}/elasticsearch.yml"
COMPOSE_FILES+=" -f ${COMPOSE_DIR}/provider.yml"
COMPOSE_FILES+=" -f ${COMPOSE_DIR}/ganache.yml"
COMPOSE_FILES+=" -f ${COMPOSE_DIR}/ocean_contracts.yml"
@ -191,6 +192,10 @@ while :; do
COMPOSE_FILES+=" -f ${COMPOSE_DIR}/provider2.yml"
printf $COLOR_Y'Starting with a 2nd Provider...\n\n'$COLOR_RESET
;;
--with-thegraph)
COMPOSE_FILES+=" -f ${COMPOSE_DIR}/thegraph.yml"
printf $COLOR_Y'Starting with TheGraph...\n\n'$COLOR_RESET
;;
--no-ganache)
COMPOSE_FILES="${COMPOSE_FILES/ -f ${COMPOSE_DIR}\/ganache.yml/}"
COMPOSE_FILES="${COMPOSE_FILES/ -f ${COMPOSE_DIR}\/ocean_contracts.yml/}"
@ -200,6 +205,11 @@ while :; do
COMPOSE_FILES="${COMPOSE_FILES/ -f ${COMPOSE_DIR}\/aquarius.yml/}"
printf $COLOR_Y'Starting without Aquarius...\n\n'$COLOR_RESET
;;
--no-elasticsearch)
COMPOSE_FILES="${COMPOSE_FILES/ -f ${COMPOSE_DIR}\/elasticsearch.yml/}"
printf $COLOR_Y'Starting without Elastic search...\n\n'$COLOR_RESET
;;
--no-dashboard)
COMPOSE_FILES="${COMPOSE_FILES/ -f ${COMPOSE_DIR}\/dashboard.yml/}"
printf $COLOR_Y'Starting without Dashboard ...\n\n'$COLOR_RESET