From 67e0000ab130f73b02fafa26eb50abc454320d78 Mon Sep 17 00:00:00 2001 From: alexcos20 Date: Sat, 12 Feb 2022 05:18:59 -0800 Subject: [PATCH 1/2] add subgraph deploy module --- README.md | 1 + compose-files/ocean_subgraph.yml | 12 ++++++++++++ compose-files/thegraph.yml | 2 +- start_ocean.sh | 6 ++++++ 4 files changed, 20 insertions(+), 1 deletion(-) create mode 100644 compose-files/ocean_subgraph.yml diff --git a/README.md b/README.md index 70935d5..5349808 100644 --- a/README.md +++ b/README.md @@ -108,6 +108,7 @@ export AQUARIUS_VERSION=v2.0.0 | `--no-dashboard` | Start up Ocean without the `dashboard` Building Block. | | `--with-rbac` | Start up Ocean with RBAC Server | | `--with-thegraph` | Start up Ocean with graphnode,postgresql | +| `--deploy-ocean-subgraph` | Deploys ocean-subgraph | | `--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. | diff --git a/compose-files/ocean_subgraph.yml b/compose-files/ocean_subgraph.yml new file mode 100644 index 0000000..7b9f358 --- /dev/null +++ b/compose-files/ocean_subgraph.yml @@ -0,0 +1,12 @@ +version: '3' +services: + subgraph: + image: oceanprotocol/subgraph:${SUBGRAPH_VERSION:-latest} + networks: + backend: + ipv4_address: 172.15.0.19 + depends_on: + - graph-node + - ocean-contracts + volumes: + - ${OCEAN_ARTIFACTS_FOLDER}:/ocean-contracts/artifacts/ diff --git a/compose-files/thegraph.yml b/compose-files/thegraph.yml index 39ea20e..9e7ce1e 100644 --- a/compose-files/thegraph.yml +++ b/compose-files/thegraph.yml @@ -21,7 +21,7 @@ services: postgres_pass: let-me-in postgres_db: graph-node ipfs: '172.15.0.16:5001' - ethereum: 'barge:${NETWORK_RPC_URL}' + ethereum: 'development:${NETWORK_RPC_URL}' RUST_LOG: info postgres: image: postgres diff --git a/start_ocean.sh b/start_ocean.sh index 826ebb9..88d49df 100755 --- a/start_ocean.sh +++ b/start_ocean.sh @@ -30,6 +30,7 @@ COMPOSE_DIR="${DIR}/compose-files" export AQUARIUS_VERSION=${AQUARIUS_VERSION:-v4main} export PROVIDER_VERSION=${PROVIDER_VERSION:-v4main} +export SUBGRAPH_VERSION=${SUBGRAPH_VERSION:-v4main} export CONTRACTS_VERSION=${CONTRACTS_VERSION:-v4main_postaudit} export RBAC_VERSION=${RBAC_VERSION:-next} @@ -233,6 +234,11 @@ while :; do COMPOSE_FILES+=" -f ${COMPOSE_DIR}/thegraph.yml" printf $COLOR_Y'Starting with TheGraph...\n\n'$COLOR_RESET ;; + --deploy-ocean-subgraph) + COMPOSE_FILES+=" -f ${COMPOSE_DIR}/ocean_subgraph.yml" + COMPOSE_FILES+=" -f ${COMPOSE_DIR}/thegraph.yml" + printf $COLOR_Y'Deploying ocean-subgraph...\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/}" From 930e57ece1972d7b8a5d6e039a39c42df3063be8 Mon Sep 17 00:00:00 2001 From: alexcos20 Date: Sat, 12 Feb 2022 08:34:01 -0800 Subject: [PATCH 2/2] add ---skip-subgraph-deploy --- README.md | 4 ++-- compose-files/ocean_subgraph.yml | 12 ------------ compose-files/thegraph.yml | 14 ++++++++++++++ start_ocean.sh | 11 +++++------ 4 files changed, 21 insertions(+), 20 deletions(-) delete mode 100644 compose-files/ocean_subgraph.yml diff --git a/README.md b/README.md index 5349808..89fa35a 100644 --- a/README.md +++ b/README.md @@ -107,8 +107,8 @@ export AQUARIUS_VERSION=v2.0.0 | `--no-ganache` | Start up Ocean without the `ganache` Building Block. | | `--no-dashboard` | Start up Ocean without the `dashboard` Building Block. | | `--with-rbac` | Start up Ocean with RBAC Server | -| `--with-thegraph` | Start up Ocean with graphnode,postgresql | -| `--deploy-ocean-subgraph` | Deploys ocean-subgraph | +| `--with-thegraph` | Start up Ocean with graphnode,postgresql and deploys ocean-subgraph | +| `---skip-subgraph-deploy` | Will skip deployment of ocean-subgraphs | | `--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. | diff --git a/compose-files/ocean_subgraph.yml b/compose-files/ocean_subgraph.yml deleted file mode 100644 index 7b9f358..0000000 --- a/compose-files/ocean_subgraph.yml +++ /dev/null @@ -1,12 +0,0 @@ -version: '3' -services: - subgraph: - image: oceanprotocol/subgraph:${SUBGRAPH_VERSION:-latest} - networks: - backend: - ipv4_address: 172.15.0.19 - depends_on: - - graph-node - - ocean-contracts - volumes: - - ${OCEAN_ARTIFACTS_FOLDER}:/ocean-contracts/artifacts/ diff --git a/compose-files/thegraph.yml b/compose-files/thegraph.yml index 9e7ce1e..df4efdd 100644 --- a/compose-files/thegraph.yml +++ b/compose-files/thegraph.yml @@ -37,6 +37,20 @@ services: POSTGRES_DB: graph-node volumes: - graphpgsql:/var/lib/postgresql/data + subgraph: + image: oceanprotocol/subgraph:${SUBGRAPH_VERSION:-latest} + networks: + backend: + ipv4_address: 172.15.0.19 + environment: + DEPLOY_SUBGRAPH: ${DEPLOY_SUBGRAPH} + depends_on: + - graph-node + - ocean-contracts + volumes: + - ${OCEAN_ARTIFACTS_FOLDER}:/ocean-contracts/artifacts/ volumes: graphpgsql: + + diff --git a/start_ocean.sh b/start_ocean.sh index 88d49df..256bb20 100755 --- a/start_ocean.sh +++ b/start_ocean.sh @@ -62,6 +62,7 @@ export GANACHE_MNEMONIC=${GANACHE_MNEMONIC:-"taxi music thumb unique chat sand c export OCEAN_HOME="${HOME}/.ocean" export CONTRACTS_OWNER_ROLE_ADDRESS="${CONTRACTS_OWNER_ROLE_ADDRESS}" export DEPLOY_CONTRACTS=true +export DEPLOY_SUBGRAPH=true export OCEAN_ARTIFACTS_FOLDER="${OCEAN_HOME}/ocean-contracts/artifacts" mkdir -p ${OCEAN_ARTIFACTS_FOLDER} export OCEAN_C2D_FOLDER="${OCEAN_HOME}/ocean-c2d/" @@ -234,11 +235,6 @@ while :; do COMPOSE_FILES+=" -f ${COMPOSE_DIR}/thegraph.yml" printf $COLOR_Y'Starting with TheGraph...\n\n'$COLOR_RESET ;; - --deploy-ocean-subgraph) - COMPOSE_FILES+=" -f ${COMPOSE_DIR}/ocean_subgraph.yml" - COMPOSE_FILES+=" -f ${COMPOSE_DIR}/thegraph.yml" - printf $COLOR_Y'Deploying ocean-subgraph...\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/}" @@ -252,7 +248,6 @@ while :; do 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 @@ -261,6 +256,10 @@ while :; do export DEPLOY_CONTRACTS=false printf $COLOR_Y'Ocean contracts will not be deployed, the last deployment (if any) will be intact ...\n\n'$COLOR_RESET ;; + --skip-subgraph-deploy) + export DEPLOY_SUBGRAPH=false + printf $COLOR_Y'Ocean subgraph will not be deployed, the last deployment (if any) will be intact ...\n\n'$COLOR_RESET + ;; ################################################# # Cleaning switches #################################################