Skip to content

Commit

Permalink
chore(hapi-evm): use Hasura env variables
Browse files Browse the repository at this point in the history
  • Loading branch information
Torresmorah committed Aug 11, 2023
1 parent 710b785 commit c0c9ac7
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 9 deletions.
3 changes: 1 addition & 2 deletions .env.telos
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ HASURA_GRAPHQL_DATABASE_URL=postgres://eoscr:password@postgres:5432/localdb
HASURA_GRAPHQL_ADMIN_SECRET=myadminsecretkey
HASURA_GRAPHQL_UNAUTHORIZED_ROLE=guest
HASURA_GRAPHQL_ACTION_BASE_URL=http://hapi:9090
HASURA_GRAPHQL_ACTION_EVM_URL=http://hapi-evm:9090

# hapi
HAPI_EOS_API_NETWORK_NAME=telos
Expand Down Expand Up @@ -62,8 +63,6 @@ HAPI_EVM_ENDPOINT=https://testnet.telos.net/evm
HAPI_EVM_API_ENDPOINTS=["https://telos.greymass.com","https://telos.eosphere.io","telos.caleos.io","mainnet.telosusa.io"]
HAPI_EVM_NETWORK_CHAIN_ID=4667b205c6838ef70ff7988f6e8257e8be0e1284a2f59699054a018f743b1d11
HAPI_EVM_EOS_EVM_ACCOUNT=eosio.evm
HAPI_EVM_HASURA_URL=http://hasura:8080/v1/graphql/evm
HAPI_EVM_HASURA_ADMIN_SECRET=myadminsecretkey
HAPI_BLOCK_INTERVAL_SEC=0.3

#webapp
Expand Down
5 changes: 3 additions & 2 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,9 @@ services:
HAPI_EVM_API_ENDPOINTS: '${HAPI_EVM_API_ENDPOINTS}'
HAPI_EVM_NETWORK_CHAIN_ID: '${HAPI_EVM_NETWORK_CHAIN_ID}'
HAPI_EVM_EOS_EVM_ACCOUNT: '${HAPI_EVM_EOS_EVM_ACCOUNT}'
HAPI_EVM_HASURA_URL: '${HAPI_EVM_HASURA_URL}'
HAPI_EVM_HASURA_ADMIN_SECRET: '${HAPI_EVM_HASURA_ADMIN_SECRET}'
HAPI_EVM_HASURA_URL: '${HAPI_HASURA_URL}'
HAPI_EVM_HASURA_ADMIN_SECRET: '${HAPI_HASURA_ADMIN_SECRET}'
HAPI_EVM_DATABASE_URL: '${HAPI_DATABASE_URL}'
HAPI_BLOCK_INTERVAL_SEC: '${HAPI_BLOCK_INTERVAL_SEC}'
hasura:
container_name: '${STAGE}-${APP_NAME}-hasura'
Expand Down
8 changes: 3 additions & 5 deletions hapi-evm/src/config/hasura.config.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
export const url =
process.env.HAPI_HASURA_URL || 'http://hasura:8080/v1/graphql'
export const adminSecret =
process.env.HAPI_HASURA_ADMIN_SECRET || 'myadminsecretkey'
export const databaseURL = process.env.HAPI_DATABASE_URL
export const url = process.env.HAPI_EVM_HASURA_URL || ''
export const adminSecret = process.env.HAPI_EVM_HASURA_ADMIN_SECRET || ''
export const databaseURL = process.env.HAPI_EVM_DATABASE_URL || ''

if (!url || !adminSecret || !databaseURL) {
throw new Error('Missing required hasura env variables')
Expand Down

0 comments on commit c0c9ac7

Please sign in to comment.