Эх сурвалжийг харах

query-node: fix running processor outside of docker

Mokhtar Naamani 4 жил өмнө
parent
commit
800a7b74de

+ 1 - 1
.env

@@ -34,7 +34,7 @@ REDIS_URI=redis://localhost:6379/0
 TYPES_JSON=../../../types/augment/all/defs.json
 
 # Indexer GraphQL API endpoint to fetch indexed events
-INDEXER_ENDPOINT_URL=http://localhost:4100/graphql
+INDEXER_ENDPOINT_URL=http://localhost:4000/graphql
 
 # Block height from which the processor starts. Note that if
 # there are already processed events in the database, this setting is ignored

+ 1 - 1
query-node/package.json

@@ -6,7 +6,7 @@
 		"build": "./build.sh",
 		"test": "echo \"Error: no test specified\" && exit 1",
 		"clean": "rm -rf ./generated",
-		"processor:start": "(cd ./generated/indexer && yarn && DEBUG=${DEBUG} yarn start:processor --env ../../../.env)",
+		"processor:start": "./processor-start.sh",
 		"indexer:start": "(cd ./generated/indexer && yarn && DEBUG=${DEBUG} yarn start:indexer --env ../../../.env)",
 		"server:start:dev": "(cd ./generated/graphql-server && yarn start:dev)",
 		"server:start:prod": "(cd ./generated/graphql-server && yarn start:prod)",

+ 15 - 0
query-node/processor-start.sh

@@ -0,0 +1,15 @@
+#!/usr/bin/env bash
+set -e
+
+SCRIPT_PATH="$(dirname "${BASH_SOURCE[0]}")"
+cd $SCRIPT_PATH
+
+set -a
+. ../.env
+set +a
+
+export TYPEORM_DATABASE=${PROCESSOR_DB_NAME}
+
+cd ./generated/indexer
+yarn
+DEBUG=${DEBUG} yarn start:processor --env ../../../.env