Skip to content

Commit

Permalink
fix: pr comments
Browse files Browse the repository at this point in the history
  • Loading branch information
0xkenj1 committed Nov 7, 2024
1 parent 8a799c6 commit f89c568
Show file tree
Hide file tree
Showing 7 changed files with 60 additions and 43 deletions.
47 changes: 33 additions & 14 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -3,25 +3,23 @@
######################################################
DATALAYER_POSTGRES_PASSWORD=testing
DATALAYER_PG_USER=postgres
DATALAYER_PG_DATABASE=datalayer-postgres
DATALAYER_PG_DATABASE=datalayer-postgres-db
DATALAYER_POSTGRES_EXPOSED_PORT=5434

######################################################
############### DATALAYER HASURA API #################
######################################################
#for reference on Hasura configuration, see: https://hasura.io/docs/2.0/deployment/graphql-engine-flags/reference/
DATALAYER_HASURA_EXPOSED_PORT=8082
DATALAYER_HASURA_ENABLE_CONSOLE=true
DATALAYER_HASURA_ADMIN_SECRET=my-admin-secret
DATALAYER_HASURA_UNAUTHORIZED_ROLE=public
DATALAYER_HASURA_ENABLE_CONSOLE="true"
DATALAYER_HASURA_ADMIN_SECRET="my-admin-secret"
DATALAYER_HASURA_UNAUTHORIZED_ROLE="public"
DATALAYER_HASURA_CORS_DOMAIN=*
DATALAYER_HASURA_ENABLE_TELEMETRY=false
# HASURA_GRAPHQL_METADATA_DATABASE_EXTENSIONS_SCHEMA: "chain_data_schema_1"
DATALAYER_HASURA_ENABLE_TELEMETRY="false"
## enable debugging mode. It is recommended to disable this in production
DATALAYER_HASURA_DEV_MODE=true
DATALAYER_HASURA_ADMIN_INTERNAL_ERRORS=true
DATALAYER_HASURA_DEV_MODE="true"
DATALAYER_HASURA_ADMIN_INTERNAL_ERRORS="true"
## uncomment next line to run console offline (i.e load console assets from server instead of CDN)
# HASURA_GRAPHQL_CONSOLE_ASSETS_DIR: /srv/console-assets
# DATALAYER_HASURA_CONSOLE_ASSETS_DIR="/srv/console-assets"

############################################################
############### ENVIO POSTGRES & INDEXER ###################
Expand All @@ -38,20 +36,41 @@ ENVIO_POSTGRES_EXPOSED_PORT=5433
############################################
############### INDEXER ####################
############################################
ENVIO_PG_HOST=envio-postgres
ENVIO_PG_HOST=indexer-postgres-db
ENVIO_PG_PORT=5432
HASURA_GRAPHQL_ENDPOINT=http://graphql-engine:8080/v1/metadata
HASURA_GRAPHQL_ENDPOINT=http://indexer-graphql-api:8080/v1/metadata
TUI_OFF=true

############################################
############### HASURA #####################
############################################
HASURA_EXPOSED_PORT=8080
HASURA_GRAPHQL_DATABASE_URL=postgres://postgres:testing@envio-postgres:5432/envio-dev
HASURA_GRAPHQL_DATABASE_URL=postgres://postgres:testing@indexer-postgres-db:5432/envio-dev
HASURA_GRAPHQL_ENABLE_CONSOLE=true
HASURA_GRAPHQL_ENABLED_LOG_TYPES=startup, http-log, webhook-log, websocket-log, query-log
HASURA_GRAPHQL_NO_OF_RETRIES=10
HASURA_GRAPHQL_ADMIN_SECRET=testing
HASURA_GRAPHQL_STRINGIFY_NUMERIC_TYPES="true"
PORT=8080
HASURA_GRAPHQL_UNAUTHORIZED_ROLE=public
HASURA_GRAPHQL_UNAUTHORIZED_ROLE=public

############################################
############### PROCESSING #################
############################################

RPC_URLS=["https://optimism.llamarpc.com","https://rpc.ankr.com/optimism","https://optimism.gateway.tenderly.co","https://optimism.blockpi.network/v1/rpc/public","https://mainnet.optimism.io","https://opt-mainnet.g.alchemy.com/v2/demo"]
CHAIN_ID=10

FETCH_LIMIT=1000
FETCH_DELAY_MS=3000

DATABASE_URL=postgresql://postgres:testing@datalayer-postgres-db:5432/datalayer-postgres-db
DATABASE_SCHEMA=chain_data_schema_1

INDEXER_GRAPHQL_URL=http://indexer-graphql-api:8080/v1/graphql
INDEXER_ADMIN_SECRET=testing

IPFS_GATEWAYS_URL=["https://ipfs.io","https://gateway.pinata.cloud","https://dweb.link", "https://ipfs.eth.aragon.network"]

COINGECKO_API_KEY=CG-WPGoHFCHyzGHcyFkigiVgetT
COINGECKO_API_TYPE=demo
18 changes: 15 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,19 +21,31 @@ Ensure you have the following installed on your machine:

### Setup

1. Build and start the services in detached mode:
1. Copy the Example Environment File and edit the `.env` file

```
cp .env.example .env
```

2. Build and start the services in detached mode:

```
docker-compose up -d --build
```

2. After starting Docker Compose, run the following command to apply the database migrations:
3. Copy the Example Environment File on `apps/migration-scripts` and edit the `.env` file

```
cp apps/migration-scripts/.env.example apps/migration-scripts/.env
```

4. After starting Docker Compose, run the following command to apply the database migrations:

```
pnpm script:db:migrate
```

3. Navigate to the processing service directory and start it with:
5. Navigate to the processing service directory and start it with:

```
cd apps/processing && pnpm dev
Expand Down
5 changes: 0 additions & 5 deletions apps/processing/.dockerignore

This file was deleted.

18 changes: 9 additions & 9 deletions apps/processing/.env.example
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
# configuration for Optimism
RPC_URLS=["https://optimism.llamarpc.com","https://rpc.ankr.com/optimism","https://optimism.gateway.tenderly.co","https://optimism.blockpi.network/v1/rpc/public","https://mainnet.optimism.io","https://opt-mainnet.g.alchemy.com/v2/demo"]
CHAIN_ID=10
LOG_LEVEL=debug

FETCH_LIMIT=500
FETCH_DELAY_MS=3000
FETCH_LIMIT=10000
FETCH_DELAY_MS=30000

DATABASE_URL=
DATABASE_SCHEMA=chainDataSchema
DATABASE_URL=postgresql://postgres:testing@localhost:5434/datalayer-postgres-db
DATABASE_SCHEMA=chain_data_schema_1

INDEXER_GRAPHQL_URL=
INDEXER_ADMIN_SECRET=
INDEXER_GRAPHQL_URL=http://localhost:8080/v1/graphql
INDEXER_ADMIN_SECRET=testing

IPFS_GATEWAYS_URL=["https://ipfs.io","https://gateway.pinata.cloud","https://dweb.link", "https://ipfs.eth.aragon.network"]

COINGECKO_API_KEY=
COINGECKO_API_TYPE= #demo or pro
COINGECKO_API_KEY=CG-WPGoHFCHyzGHcyFkigiVgetT
COINGECKO_API_TYPE=demo
11 changes: 0 additions & 11 deletions apps/processing/Dockerfile

This file was deleted.

2 changes: 2 additions & 0 deletions apps/scripts/.env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
DATABASE_URL=postgres://postgres:testing@localhost:5434/datalayer-postgres-db
DATABASE_SCHEMA=chain_data_schema_1
2 changes: 1 addition & 1 deletion docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ services:
POSTGRES_USER: ${ENVIO_PG_USER}
POSTGRES_PASSWORD: ${ENVIO_POSTGRES_PASSWORD}
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${DATALAYER_PG_USER}"]
test: ["CMD-SHELL", "pg_isready -U ${ENVIO_PG_USER}"]
interval: 5s
timeout: 5s
retries: 5
Expand Down

0 comments on commit f89c568

Please sign in to comment.