diff --git a/src/environment.ts b/src/environment.ts index 45f5810..f152745 100644 --- a/src/environment.ts +++ b/src/environment.ts @@ -8,6 +8,7 @@ export const Env = z.object({ TON_API_KEY: z.string().optional(), SERVER_PORT: z.string().optional(), SERVER_LINK: z.string().optional(), + NETWORK: z.union([z.literal("testnet"), z.literal("mainnet"), z.undefined()]), }); export type Env = z.infer; diff --git a/src/index.ts b/src/index.ts index b3c076a..398b7d2 100644 --- a/src/index.ts +++ b/src/index.ts @@ -29,9 +29,10 @@ async function main() { let config: IBridgeConfig = prodBridgeConfig; - if (process.argv.includes("--testnet")) { + const network = process.env.NETWORK; + if (network === "testnet") { + logger.info("Starting up testnet"); config = testnetBridgeConfig; - logger.info("Setting up for testnet environment"); } const deps = await configDeps(config, secrets, logger);