diff --git a/README.md b/README.md index 24df9995..b19c3261 100644 --- a/README.md +++ b/README.md @@ -63,12 +63,21 @@ This container includes an offline-phragmen binary. It is a forked modification ## Hasura demo -The crawler needs to wait for your substrate-node container to get synced before starting to collect data. You can use an already synced external RPC for instant testing by changing the following lines in your -backend.config.js file - -``` -//const DEFAULT_WS_PROVIDER_URL = 'wss://kusama-rpc.polkadot.io'; -const DEFAULT_WS_PROVIDER_URL = 'ws://substrate-node:9944'; +The crawler needs to wait for your substrate-node container to get synced before starting to collect data. You can use an already synced external RPC for instant testing by changing the environment variable WS_PROVIDER_URL in `docker-compose.yml` file: + +```yaml +crawler: + image: polkastats-backend:latest + build: + context: ../../ + dockerfile: ./docker/polkastats-backend/backend/Dockerfile + depends_on: + - "postgres" + - "substrate-node" + restart: on-failure + environment: + - NODE_ENV=production + - WS_PROVIDER_URL=wss://kusama-rpc.polkadot.io # Change this line ``` Just uncomment out the first one and comment the second and rebuild the dockers. diff --git a/backend.config.js b/backend.config.js index 4c6c8847..54cf9b68 100644 --- a/backend.config.js +++ b/backend.config.js @@ -1,6 +1,3 @@ - -// In order to check this backend without a synced local substrate-node container use: -//const DEFAULT_WS_PROVIDER_URL = 'wss://kusama-rpc.polkadot.io'; const DEFAULT_WS_PROVIDER_URL = 'ws://substrate-node:9944'; module.exports = { diff --git a/docker/polkastats-backend/docker-compose.yml b/docker/polkastats-backend/docker-compose.yml index 432bb304..2f8faf2e 100644 --- a/docker/polkastats-backend/docker-compose.yml +++ b/docker/polkastats-backend/docker-compose.yml @@ -63,6 +63,7 @@ services: restart: on-failure environment: - NODE_ENV=production + - WS_PROVIDER_URL=ws://substrate-node:9944 # # Persisten volumes #