Skip to content

Commit

Permalink
production mode for pgSink
Browse files Browse the repository at this point in the history
  • Loading branch information
bryzettler committed Dec 17, 2024
1 parent 0398c7b commit 90b359d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
1 change: 1 addition & 0 deletions packages/account-postgres-sink-service/src/env.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ process.env.ANCHOR_WALLET =
process.env.ANCHOR_WALLET || os.homedir() + "/.config/solana/id.json";

const getEnvBoolean = (key: string): boolean => process.env[key] === "true";
export const PRODUCTION = process.env.NODE_ENV === "production" || false;
export const SOLANA_URL = process.env.SOLANA_URL || "http://127.0.0.1:8899";

export const REFRESH_PASSWORD = process.env.REFRESH_PASSWORD;
Expand Down
10 changes: 7 additions & 3 deletions packages/account-postgres-sink-service/src/services/substream.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,12 @@ import {
} from "@substreams/core";
import { FastifyInstance } from "fastify";
import { Op } from "sequelize";
import { SUBSTREAM, SUBSTREAM_API_KEY, SUBSTREAM_URL } from "../env";
import {
PRODUCTION,
SUBSTREAM,
SUBSTREAM_API_KEY,
SUBSTREAM_URL,
} from "../env";
import { getPluginsByAccountTypeByProgram } from "../plugins";
import { IConfig } from "../types";
import { Cursor, database } from "../utils/database";
Expand Down Expand Up @@ -79,8 +84,7 @@ export const setupSubstream = async (
const request = createRequest({
substreamPackage: substream,
outputModule: MODULE,
// Todo Bry: Setup as env
productionMode: false,
productionMode: PRODUCTION,
startBlockNum: cursor ? undefined : currentBlock,
startCursor: cursor,
});
Expand Down

0 comments on commit 90b359d

Please sign in to comment.