Skip to content
This repository has been archived by the owner on Nov 15, 2022. It is now read-only.

Commit

Permalink
Merge pull request #104 from Colm3na/feature/use-environment-variable
Browse files Browse the repository at this point in the history
Use environment variable for WS_PROVIDER_URL
  • Loading branch information
Bigomby authored Mar 20, 2020
2 parents 527dde2 + f644808 commit acf31d3
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 9 deletions.
21 changes: 15 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
3 changes: 0 additions & 3 deletions backend.config.js
Original file line number Diff line number Diff line change
@@ -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 = {
Expand Down
1 change: 1 addition & 0 deletions docker/polkastats-backend/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ services:
restart: on-failure
environment:
- NODE_ENV=production
- WS_PROVIDER_URL=ws://substrate-node:9944
#
# Persisten volumes
#
Expand Down

0 comments on commit acf31d3

Please sign in to comment.