Skip to content

Commit

Permalink
fix(env): update some of env vars to SCREAMING_CASE from camelCase
Browse files Browse the repository at this point in the history
- update RestApiNodeUrl to REST_API_NODE_URL

- update ServerOrigin to SERVER_ORIGIN

- update HealthchecksEnabled to HEALTHCHECKS_ENABLED

- update SentryDSN to SENTRY_DSN

- update AkashDatabaseCS to AKASH_DATABASE_CS

- update AkashTestnetDatabaseCS to AKASH_TESTNET_DATABASE_CS

- update UserDatabaseCS to USER_DATABASE_CS

- update AUTH0_JWKS_URI to AUTH0_JWKS_URI

- update Auth0Audience to AUTH0_AUDIENCE

- update Auth0Issuer to AUTH0_ISSUER

- update StripeSecretKey to STRIPE_SECRET_KEY

- update WebsiteUrl to WEBSITE_URL

- update AkashlyticsGithubPAT to AKASHLYTICS_GITHUB_PAT

- update SecretToken to SECRET_TOKEN

- update AkashSandboxDatabaseCS to AKASH_SANDBOX_DATABASE_CS

- update SentryDSN to SENTRY_DSN

- update HealthChecks_SyncBlocks to HEALTHCHECKS_SYNC_BLOCKS

- update HealthChecks_SyncAKTPriceHistory to HEALTHCHECKS_SYNC_AKT_PRICE_HISTORY

- update HealthChecks_SyncProviderInfo to HEALTHCHECKS_SYNC_PROVIDER_INFO

- update HealthChecks_SyncKeybaseInfo to HEALTHCHECKS_SYNC_KEYBASE_INFO

- update AkashDatabaseCS to AKASH_DATABASE_CS

- update ActiveChain to ACTIVE_CHAIN

- update KeepCache to KEEP_CACHE

- update Standby to STANDBY

- update DataFolder to DATA_FOLDER

- update JunoDatabaseCS to JUNO_DATABASE_CS

- update PassageDatabaseCS to PASSAGE_DATABASE_CS

- update HealthchecksEnabled to HEALTH_CHECKS_ENABLED

- update SentryServerName to SENTRY_SERVER_NAME
  • Loading branch information
hiroyukikumazawa committed Sep 10, 2024
1 parent 2190000 commit 82b5bad
Show file tree
Hide file tree
Showing 22 changed files with 100 additions and 101 deletions.
2 changes: 1 addition & 1 deletion apps/api/env/.env
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
AKASHLYTICS_CORS_WEBSITE_URLS=https://cloudmos.io,https://www.cloudmos.io,http://debug.cloudmos.io,https://deploy.cloudmos.io,https://beta.cloudmos.io,https://stats.akash.network,https://console.akash.network,https://akash.network,https://akash.hooman.digital,http://localhost:3000,http://localhost:3001,https://beta2.cloudmos.io,https://beta3.cloudmos.io,https://akashconsole.vercel.app,https://console-beta.akash.network
WebsiteUrl=https://console-beta.akash.network
WEBSITE_URL=https://console-beta.akash.network
TRIAL_DEPLOYMENT_ALLOWANCE_AMOUNT=10000000
DEPLOYMENT_ALLOWANCE_REFILL_AMOUNT=10000000
DEPLOYMENT_ALLOWANCE_REFILL_THRESHOLD=1000000
Expand Down
4 changes: 2 additions & 2 deletions apps/api/env/.env.functional.test
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
AkashSandboxDatabaseCS=postgres://postgres:password@localhost:5432/console-akash-sandbox
UserDatabaseCS=postgres://postgres:password@localhost:5432/console-users
AKASH_SANDBOX_DATABASE_CS=postgres://postgres:password@localhost:5432/console-akash-sandbox
USER_DATABASE_CS=postgres://postgres:password@localhost:5432/console-users
POSTGRES_DB_URI=postgres://postgres:password@localhost:5432/console-users
MASTER_WALLET_MNEMONIC="motion isolate mother convince snack twenty tumble boost elbow bundle modify balcony"
NETWORK=sandbox
Expand Down
8 changes: 4 additions & 4 deletions apps/api/env/.env.production
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
Auth0JWKSUri=https://cloudmos-prod.us.auth0.com/.well-known/jwks.json
Auth0Audience=https://api.cloudmos.io
Auth0Issuer=https://auth.cloudmos.io/
AUTH0_JWKS_URI=https://cloudmos-prod.us.auth0.com/.well-known/jwks.json
AUTH0_AUDIENCE=https://api.cloudmos.io
AUTH0_ISSUER=https://auth.cloudmos.io/
PORT=80
ServerOrigin=https://api.cloudmos.io
SERVER_ORIGIN=https://api.cloudmos.io
DRIZZLE_MIGRATIONS_FOLDER=./dist/drizzle
SENTRY_ENABLED=true
BILLING_ENABLED=false
Expand Down
21 changes: 10 additions & 11 deletions apps/api/env/.env.sample
Original file line number Diff line number Diff line change
@@ -1,22 +1,21 @@
# Secrets
AkashDatabaseCS=
AkashlyticsGithubPAT=
AKASH_DATABASE_CS=
AKASHLYTICS_GITHUB_PAT=
ANONYMOUS_USER_TOKEN_SECRET=
HealthChecks_SyncAKTMarketData=
MASTER_WALLET_MNEMONIC=
POSTGRES_DB_URI=
SecretToken=
SentryDSN=
SECRET_TOKEN=
SENTRY_DSN=
UserDatabaseCS=
STRIPE_SECRET_KEY=
STRIPE_PRICE_ID=
USER_DATABASE_CS=

# Configuration
AKASHLYTICS_CORS_WEBSITE_URLS=
Auth0Audience=
Auth0Issuer=
Auth0JWKSUri=
AUTH0_AUDIENCE=
AUTH0_ISSUER=
AUTH0_JWKS_URI=
BILLING_ENABLED=
DEPLOYMENT_ALLOWANCE_REFILL_AMOUNT=
DEPLOYMENT_ALLOWANCE_REFILL_THRESHOLD=
Expand All @@ -25,7 +24,7 @@ DEPLOYMENT_GRANT_DENOM=
DRIZZLE_MIGRATIONS_FOLDER=
FEE_ALLOWANCE_REFILL_AMOUNT=
FEE_ALLOWANCE_REFILL_THRESHOLD=
HealthchecksEnabled=
HEALTHCHECKS_ENABLED=
LOG_LEVEL=
NETWORK=
PORT=
Expand All @@ -34,7 +33,7 @@ SENTRY_ENABLED=
SENTRY_SERVER_NAME=
SentryServerName=
SENTRY_TRACES_RATE=
ServerOrigin=
SERVER_ORIGIN=
TRIAL_DEPLOYMENT_ALLOWANCE_AMOUNT=
TRIAL_FEES_ALLOWANCE_AMOUNT=
WebsiteUrl=
WEBSITE_URL=
8 changes: 4 additions & 4 deletions apps/api/env/.env.staging
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
ServerOrigin=https://api-sandbox.cloudmos.io
SERVER_ORIGIN=https://api-sandbox.cloudmos.io
DRIZZLE_MIGRATIONS_FOLDER=./dist/drizzle
Auth0JWKSUri=https://dev-5aprb0lr.us.auth0.com/.well-known/jwks.json
Auth0Audience=https://api.cloudmos.io
Auth0Issuer=https://dev-5aprb0lr.us.auth0.com/
AUTH0_JWKS_URI=https://dev-5aprb0lr.us.auth0.com/.well-known/jwks.json
AUTH0_AUDIENCE=https://api.cloudmos.io
AUTH0_ISSUER=https://dev-5aprb0lr.us.auth0.com/
SENTRY_TRACES_RATE=1.0
SENTRY_ENABLED=true
BILLING_ENABLED=true
Expand Down
2 changes: 1 addition & 1 deletion apps/api/src/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ appHono.use(
const { PORT = 3080, BILLING_ENABLED } = process.env;

const scheduler = new Scheduler({
healthchecksEnabled: env.HealthchecksEnabled === "true",
healthchecksEnabled: env.HEALTHCHECKS_ENABLED === "true",
errorHandler: (task, error) => {
console.error(`Task "${task.name}" failed: ${error}`);
getSentry().captureException(error);
Expand Down
2 changes: 1 addition & 1 deletion apps/api/src/auth/services/auth.interceptor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ export class AuthInterceptor implements HonoInterceptor {

private async getValidUserId(bearer: string, c: Context) {
const token = bearer.replace(/^Bearer\s+/i, "");
const jwks = await getJwks(env.Auth0JWKSUri || c.env?.JWKS_URI, useKVStore(kvStore || c.env?.VERIFY_RSA_JWT), c.env?.VERIFY_RSA_JWT_JWKS_CACHE_KEY);
const jwks = await getJwks(env.AUTH0_JWKS_URI || c.env?.JWKS_URI, useKVStore(kvStore || c.env?.VERIFY_RSA_JWT), c.env?.VERIFY_RSA_JWT_JWKS_CACHE_KEY);
const result = await verify(token, jwks);

return (result.payload as { sub: string }).sub;
Expand Down
8 changes: 4 additions & 4 deletions apps/api/src/db/dbConnection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ function isValidNetwork(network: string): network is keyof typeof csMap {
}

const csMap = {
mainnet: env.AkashDatabaseCS,
testnet: env.AkashTestnetDatabaseCS,
sandbox: env.AkashSandboxDatabaseCS
mainnet: env.AKASH_DATABASE_CS,
testnet: env.AKASH_TESTNET_DATABASE_CS,
sandbox: env.AKASH_SANDBOX_DATABASE_CS
};

if (!isValidNetwork(env.NETWORK)) {
Expand Down Expand Up @@ -63,7 +63,7 @@ export const chainDbs: { [key: string]: Sequelize } = Object.keys(chainDefinitio
{}
);

export const userDb = new Sequelize(env.UserDatabaseCS, {
export const userDb = new Sequelize(env.USER_DATABASE_CS, {
dialectModule: pg,
logging,
logQueryParameters: true,
Expand Down
4 changes: 2 additions & 2 deletions apps/api/src/middlewares/privateMiddleware.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ import { Context, Next } from "hono";
import { env } from "@src/utils/env";

export async function privateMiddleware(c: Context, next: Next) {
if (!env.SecretToken) {
if (!env.SECRET_TOKEN) {
await next();
} else if (c.req.query("token") === env.SecretToken) {
} else if (c.req.query("token") === env.SECRET_TOKEN) {
await next();
} else {
return c.text("Unauthorized", 401);
Expand Down
4 changes: 2 additions & 2 deletions apps/api/src/middlewares/userMiddleware.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,12 @@ export const kvStore = {
};

export const requiredUserMiddleware = verifyRsaJwt({
jwksUri: env.Auth0JWKSUri,
jwksUri: env.AUTH0_JWKS_URI,
kvStore: kvStore
});

export const optionalUserMiddleware = verifyRsaJwt({
jwksUri: env.Auth0JWKSUri,
jwksUri: env.AUTH0_JWKS_URI,
kvStore: kvStore,
optional: true
});
Expand Down
2 changes: 1 addition & 1 deletion apps/api/src/routers/apiRouter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ function registerApiVersion(version: string, baseRouter: OpenAPIHono, versionRou

versionRouter.doc(`/doc`, {
openapi: "3.0.0",
servers: [{ url: `${env.ServerOrigin}/${version}` }],
servers: [{ url: `${env.SERVER_ORIGIN}/${version}` }],
info: {
title: "Console API",
description: "Access Akash data from our indexer",
Expand Down
2 changes: 1 addition & 1 deletion apps/api/src/routers/internalRouter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export const internalRouter = new OpenAPIHono();

internalRouter.doc(`/doc`, {
openapi: "3.0.0",
servers: [{ url: `${env.ServerOrigin}/internal` }],
servers: [{ url: `${env.SERVER_ORIGIN}/internal` }],
info: {
title: "Console Internal API",
description: "APIs for internal use that are not part of the public API. There is no garantees of stability or backward compatibility.",
Expand Down
4 changes: 2 additions & 2 deletions apps/api/src/services/external/githubService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ import { Auditor, ProviderAttributesSchema } from "@src/types/provider";
import { env } from "@src/utils/env";

export function getOctokit() {
const githubPAT = env.AkashlyticsGithubPAT;
const githubPAT = env.AKASHLYTICS_GITHUB_PAT;

if (!githubPAT) {
throw new Error("AkashlyticsGithubPAT is missing");
throw new Error("AKASHLYTICS_GITHUB_PAT is missing");
}

return new Octokit({
Expand Down
2 changes: 1 addition & 1 deletion apps/api/src/utils/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,6 @@ export const defaultNodeUrlMapping: { [key: string]: string } = {
testnet: "https://api.testnet-02.aksh.pw"
};

export const apiNodeUrl = env.RestApiNodeUrl ?? defaultNodeUrlMapping[env.NETWORK] ?? defaultNodeUrlMapping.mainnet;
export const apiNodeUrl = env.REST_API_NODE_URL ?? defaultNodeUrlMapping[env.NETWORK] ?? defaultNodeUrlMapping.mainnet;
export const betaTypeVersion = "v1beta3";
export const betaTypeVersionMarket = "v1beta4";
26 changes: 13 additions & 13 deletions apps/api/src/utils/env.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,20 @@ export const env = z
.object({
AKASHLYTICS_CORS_WEBSITE_URLS: z.string().optional(),
NODE_ENV: z.string().optional(),
HealthchecksEnabled: z.string().optional(),
AkashDatabaseCS: z.string().optional(),
AkashTestnetDatabaseCS: z.string().optional(),
AkashSandboxDatabaseCS: z.string().optional(),
UserDatabaseCS: z.string().optional(),
HEALTHCHECKS_ENABLED: z.string().optional(),
AKASH_DATABASE_CS: z.string().optional(),
AKASH_TESTNET_DATABASE_CS: z.string().optional(),
AKASH_SANDBOX_DATABASE_CS: z.string().optional(),
USER_DATABASE_CS: z.string().optional(),
NETWORK: z.string().default("mainnet"),
RestApiNodeUrl: z.string().optional(),
ServerOrigin: z.string().optional().default("http://localhost:3080"),
AkashlyticsGithubPAT: z.string().optional(),
Auth0JWKSUri: z.string().optional(),
Auth0Audience: z.string().optional(),
Auth0Issuer: z.string().optional(),
WebsiteUrl: z.string().optional(),
SecretToken: z.string().optional(),
REST_API_NODE_URL: z.string().optional(),
SERVER_ORIGIN: z.string().optional().default("http://localhost:3080"),
AKASHLYTICS_GITHUB_PAT: z.string().optional(),
AUTH0_JWKS_URI: z.string().optional(),
AUTH0_AUDIENCE: z.string().optional(),
AUTH0_ISSUER: z.string().optional(),
WEBSITE_URL: z.string().optional(),
SECRET_TOKEN: z.string().optional(),
ProviderUptimeGracePeriodMinutes: z
.number()
.optional()
Expand Down
22 changes: 11 additions & 11 deletions apps/indexer/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,17 +21,17 @@ You can make sure the api is working by accessing the status endpoint: `http://l

|Name|Value|Note|
|-|-|-
HealthchecksEnabled|`true` or `false`|Specify if the [Scheduler](./src/index.ts#L42) should send health check pings.
SentryDSN|ex: `"https://[email protected]/1234"`|[Sentry DSN](https://docs.sentry.io/product/sentry-basics/dsn-explainer/) used when [initializing](./src/index.ts#L25) Sentry
HealthChecks_SyncBlocks|ex: `041b2561-be28-4a36-bb3f-36a68f86224e`|[HealthChecks.io](https://healthchecks.io) check ID for the `SyncBlocks` task.
HealthChecks_SyncAKTPriceHistory|ex: `041b2561-be28-4a36-bb3f-36a68f86224e`|[HealthChecks.io](https://healthchecks.io) check ID for the `SyncAKTPriceHistory` task.
HealthChecks_SyncProviderInfo|ex: `041b2561-be28-4a36-bb3f-36a68f86224e`|[HealthChecks.io](https://healthchecks.io) check ID for the `SyncProviderInfo` task.
HealthChecks_SyncKeybaseInfo|ex: `041b2561-be28-4a36-bb3f-36a68f86224e`|[HealthChecks.io](https://healthchecks.io) check ID for the `SyncKeybaseInfo` task.
AkashDatabaseCS|ex: `postgres://user:password@localhost:5432/cloudmos-akash`|Akash Database Connection String
ActiveChain|ex: `akash`|Chain code from [chainDefinitions.ts](../shared/chainDefinitions.ts)
KeepCache|`true` or `false`|Specify if the [block & block response cache](#block-cache-structure) should be kept on drive. Takes a lot of space, but allow rebuilding the database without redownloading every blocks.
Standby|`true` or `false`|If `true`, indexer will not start. Useful for stopping an indexer deployed on akash without needing to close the lease.
DataFolder|ex: `./data/`|Directory where block cache and node statuses should be saved. Defaults to `./data/`.
HEALTH_CHECKS_ENABLED|`true` or `false`|Specify if the [Scheduler](./src/index.ts#L42) should send health check pings.
SENTRY_DSN|ex: `"https://[email protected]/1234"`|[Sentry DSN](https://docs.sentry.io/product/sentry-basics/dsn-explainer/) used when [initializing](./src/index.ts#L25) Sentry
HEALTHCHECKS_SYNC_BLOCKS|ex: `041b2561-be28-4a36-bb3f-36a68f86224e`|[HealthChecks.io](https://healthchecks.io) check ID for the `SyncBlocks` task.
HEALTHCHECKS_SYNC_AKT_PRICE_HISTORY|ex: `041b2561-be28-4a36-bb3f-36a68f86224e`|[HealthChecks.io](https://healthchecks.io) check ID for the `SyncAKTPriceHistory` task.
HEALTHCHECKS_SYNC_PROVIDER_INFO|ex: `041b2561-be28-4a36-bb3f-36a68f86224e`|[HealthChecks.io](https://healthchecks.io) check ID for the `SyncProviderInfo` task.
HEALTHCHECKS_SYNC_KEYBASE_INFO|ex: `041b2561-be28-4a36-bb3f-36a68f86224e`|[HealthChecks.io](https://healthchecks.io) check ID for the `SyncKeybaseInfo` task.
AKASH_DATABASE_CS|ex: `postgres://user:password@localhost:5432/cloudmos-akash`|Akash Database Connection String
ACTIVE_CHAIN|ex: `akash`|Chain code from [chainDefinitions.ts](../shared/chainDefinitions.ts)
KEEP_CACHE|`true` or `false`|Specify if the [block & block response cache](#block-cache-structure) should be kept on drive. Takes a lot of space, but allow rebuilding the database without redownloading every blocks.
STANDBY|`true` or `false`|If `true`, indexer will not start. Useful for stopping an indexer deployed on akash without needing to close the lease.
DATA_FOLDER|ex: `./data/`|Directory where block cache and node statuses should be saved. Defaults to `./data/`.

## Scheduled Tasks

Expand Down
16 changes: 8 additions & 8 deletions apps/indexer/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@ services:
syncer:
image: redm4x/console-syncer:1.0.0
env:
- HealthchecksEnabled=true
- SentryDSN=<SENTRY_DSN>
- SentryServerName=<SENTRY_SERVER_NAME>
- HealthChecks_SyncBlocks=<HEALTH_CHECKS_ID>
- HealthChecks_SyncAKTPriceHistory=<HEALTH_CHECKS_ID>
- HealthChecks_SyncProviderInfo=<HEALTH_CHECKS_ID>
- HealthChecks_SyncKeybaseInfo=<HEALTH_CHECKS_ID>
- HEALTH_CHECKS_ENABLED=true
- SENTRY_DSN=<SENTRY_DSN>
- SENTRY_SERVER_NAME=<SENTRY_SERVER_NAME>
- HEALTHCHECKS_SYNC_BLOCKS=<HEALTH_CHECKS_ID>
- HEALTHCHECKS_SYNC_AKT_PRICE_HISTORY=<HEALTH_CHECKS_ID>
- HEALTHCHECKS_SYNC_PROVIDER_INFO=<HEALTH_CHECKS_ID>
- HEALTHCHECKS_SYNC_KEYBASE_INFO=<HEALTH_CHECKS_ID>
- ChainDatabaseCS=<DATABASE_CONNECTION_STRING>
- ActiveChain=<CHAIN>
- ACTIVE_CHAIN=<CHAIN>
expose:
- port: 3079
as: 80
Expand Down
6 changes: 3 additions & 3 deletions apps/indexer/src/chain/chainSync.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ export async function syncBlocks() {
if (latestHeightInCache >= latestBlockToDownload) {
console.log("No blocks to download");
} else {
let startHeight = !env.KeepCache ? latestInsertedHeight + 1 : Math.max(latestHeightInCache, 1);
let startHeight = !env.KEEP_CACHE ? latestInsertedHeight + 1 : Math.max(latestHeightInCache, 1);

// If database is empty
if (latestInsertedHeight === 0) {
Expand Down Expand Up @@ -118,7 +118,7 @@ export async function syncBlocks() {
if (executionMode === ExecutionMode.RebuildAll) {
await sequelize.query("DROP INDEX message_height");

if (env.ActiveChain === "akash") {
if (env.ACTIVE_CHAIN === "akash") {
await sequelize.query("DROP INDEX message_related_deployment_id");
}

Expand All @@ -144,7 +144,7 @@ export async function syncBlocks() {

benchmark.displayTimes();

if (!env.KeepCache) {
if (!env.KEEP_CACHE) {
await deleteCache();
}
}
Expand Down
26 changes: 13 additions & 13 deletions apps/indexer/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ const app = express();
const { PORT = 3079 } = process.env;

Sentry.init({
dsn: env.SentryDSN,
dsn: env.SENTRY_DSN,
environment: env.NODE_ENV,
serverName: env.SentryServerName,
serverName: env.SENTRY_SERVER_NAME,
release: packageJson.version,
enabled: isProd,
integrations: [],
Expand All @@ -40,10 +40,10 @@ Sentry.init({
tracesSampleRate: 0.01
});

Sentry.setTag("chain", env.ActiveChain);
Sentry.setTag("chain", env.ACTIVE_CHAIN);

const scheduler = new Scheduler({
healthchecksEnabled: env.HealthchecksEnabled === "true",
healthchecksEnabled: env.HEALTH_CHECKS_ENABLED === "true",
errorHandler: (task, error) => {
console.error(`Task "${task.name}" failed: `, error);
Sentry.captureException(error, { tags: { task: task.name } });
Expand Down Expand Up @@ -84,17 +84,17 @@ app.get("/nodes", async (req, res) => {

function startScheduler() {
scheduler.registerTask("Sync Blocks", syncBlocks, "7 seconds", true, {
id: env.HealthChecks_SyncBlocks
id: env.HEALTHCHECKS_SYNC_BLOCKS
});
scheduler.registerTask("Sync Price History", syncPriceHistory, "1 hour", true, {
id: env.HealthChecks_SyncAKTPriceHistory,
id: env.HEALTHCHECKS_SYNC_AKT_PRICE_HISTORY,
measureDuration: true
});
scheduler.registerTask("Address Balance Monitor", () => addressBalanceMonitor.run(), "10 minutes");

if (env.ActiveChain === "akash" || env.ActiveChain === "akashTestnet" || env.ActiveChain === "akashSandbox") {
if (env.ACTIVE_CHAIN === "akash" || env.ACTIVE_CHAIN === "akashTestnet" || env.ACTIVE_CHAIN === "akashSandbox") {
scheduler.registerTask("Sync Providers Info", syncProvidersInfo, "10 seconds", true, {
id: env.HealthChecks_SyncProviderInfo,
id: env.HEALTHCHECKS_SYNC_PROVIDER_INFO,
measureDuration: true
});

Expand All @@ -106,7 +106,7 @@ function startScheduler() {

if (!activeChain.startHeight) {
scheduler.registerTask("Sync Keybase Info", fetchValidatorKeybaseInfos, "6 hours", true, {
id: env.HealthChecks_SyncKeybaseInfo,
id: env.HEALTHCHECKS_SYNC_KEYBASE_INFO,
measureDuration: true
});
}
Expand All @@ -122,16 +122,16 @@ function startScheduler() {
*/
async function initApp() {
try {
if (env.Standby) {
console.log("Standby mode enabled. Doing nothing.");
if (env.STANDBY) {
console.log("STANDBY mode enabled. Doing nothing.");
// eslint-disable-next-line no-constant-condition
while (true) {
await sleep(5_000);
}
}

if (!(process.env.ActiveChain in chainDefinitions)) {
throw new Error(`Unknown chain with code: ${process.env.ActiveChain}`);
if (!(process.env.ACTIVE_CHAIN in chainDefinitions)) {
throw new Error(`Unknown chain with code: ${process.env.ACTIVE_CHAIN}`);
}

await initDatabase();
Expand Down
2 changes: 1 addition & 1 deletion apps/indexer/src/shared/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,5 @@ export enum ExecutionMode {
export const executionMode: ExecutionMode = ExecutionMode.SyncOnly;
export const lastBlockToSync = Number.POSITIVE_INFINITY;

export const dataFolderPath = path.join(env.DataFolder, activeChain.code);
export const dataFolderPath = path.join(env.DATA_FOLDER, activeChain.code);
export const concurrentNodeQuery = 5;
Loading

0 comments on commit 82b5bad

Please sign in to comment.