Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 34 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,37 @@ services:
timeout: 5s
retries: 5

subquery-migrations:
build:
context: .
dockerfile: ./docker/sq-Dockerfile
depends_on:
'postgres':
condition: service_healthy
environment:
START_NODE: 'false'
DB_USER: postgres
DB_PASS: postgres
DB_DATABASE: postgres
DB_HOST: postgres
DB_PORT: 5432
# Polymesh-local
NETWORK_ENDPOINT: ws://host.docker.internal:9944
# Setting NETWORK_HTTP_ENDPOINT will allow dynamic lookup of NETWORK_CHAIN_ID
NETWORK_HTTP_ENDPOINT: 'http://host.docker.internal:9944'
# Staging
# NETWORK_ENDPOINT: wss://staging-rpc.polymesh.dev/
# NETWORK_CHAIN_ID: '0x3c3183f6d701500766ff7d147b79c4f10014a095eaaa98e960dcef6b3ead50ee'
# NETWORK_DICTIONARY: https://subql-dictionary.polymesh.dev
# Testnet
# NETWORK_ENDPOINT: wss://testnet-rpc.polymesh.live
# NETWORK_CHAIN_ID: '0x2ace05e703aa50b48c0ccccfc8b424f7aab9a1e2c424ed12e45d20b1e8ffd0d6'
# NETWORK_DICTIONARY: https://testnet-subql-dictionary.polymesh.live/
# Mainnet
# NETWORK_ENDPOINT: wss://mainnet-rpc.polymesh.network
# NETWORK_CHAIN_ID: '0x6fbd74e5e1d0a61d52ccfe9d4adaed16dd3a7caa37c6bc4d0c2fa12e8b2f4063'
# NETWORK_DICTIONARY: https://mainnet-subql-dictionary.polymesh.network/

subquery-node:
build:
context: .
Expand All @@ -24,8 +55,11 @@ services:
depends_on:
'postgres':
condition: service_healthy
'subquery-migrations':
condition: service_completed_successfully
restart: always
environment:
RUN_MIGRATIONS: 'false'
DB_USER: postgres
DB_PASS: postgres
DB_DATABASE: postgres
Expand Down
28 changes: 18 additions & 10 deletions docker/docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,24 @@ fi

npm run build ## This creates the project.yaml file

(npm run sql || (sleep 3 && kill "$$")) &
if [[ "${START_NODE:-true}" == "true" ]]; then
(npm run sql || (sleep 3 && kill "$$")) &
fi

npm run migrations
if [[ "${RUN_MIGRATIONS:-true}" == "true" ]]; then
npm run migrations
fi

# Allow configuring node memory. It should be no more than 75% of available RAM.
# Defaults to 3 GB (expecting at least 4 GB available).
NODE_SPACE=${MAX_OLD_SPACE_SIZE:-3072}
if [[ "${START_NODE:-true}" == "true" ]]; then
# Allow configuring node memory. It should be no more than 75% of available RAM.
# Defaults to 3 GB (expecting at least 4 GB available).
NODE_SPACE=${MAX_OLD_SPACE_SIZE:-3072}

NODE_OPTIONS=--max_old_space_size="$NODE_SPACE" \
/bin/run --disable-historical=false \
--db-schema=public "$@" &
child=$!
wait "$child"
NODE_OPTIONS=--max_old_space_size="$NODE_SPACE" \
/bin/run --disable-historical=false \
--db-schema=public "$@" &
child=$!
wait "$child"
else
wait
fi
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "polymesh-subquery",
"version": "19.6.0",
"version": "19.7.0",
"author": "Polymesh Association",
"license": "Apache-2.0",
"description": "A Polymesh Chain Indexer, providing a GraphQL interface",
Expand Down
Loading