diff --git a/env.ts b/env.ts index 1af9b69..a7ae8ed 100644 --- a/env.ts +++ b/env.ts @@ -7,7 +7,7 @@ const envSchema = z.object({ PUBLIC_ADDRESS: z.string(), MNEMONIC_SECRET_ARN: z.string().optional(), AWS_REGION: z.string().optional(), - TESTNET: z.coerce.boolean(), + TESTNET: z.preprocess((str) => str === 'true', z.boolean()), TOKEN_ADDRESS: z.string(), PROVIDER_URL: z.string(), Y2K_TOKEN_MIGRATION_ADDRESS: z.string(), diff --git a/libs/HyperliquidManager.ts b/libs/HyperliquidManager.ts index 6bb6a6c..30eaa17 100644 --- a/libs/HyperliquidManager.ts +++ b/libs/HyperliquidManager.ts @@ -24,6 +24,7 @@ export class HyperliquidManager { async init(arbitrumTokenDecimals: bigint) { try { await this.hlSdk.connect() + console.info('Connected to hyperliquid') this.tokenInfo = await this.getTokenInfo(env.TOKEN_ADDRESS) console.info( `Using HL token with name ${this.tokenInfo.name} wei decimals ${this.tokenInfo.weiDecimals}` diff --git a/migrationService.ts b/migrationService.ts index 8e893a6..94fbe1d 100644 --- a/migrationService.ts +++ b/migrationService.ts @@ -36,7 +36,7 @@ export async function main(runWithCron: boolean) { redisOperations = new RedisOperations() await redisOperations.initialize() - hlManager = new HyperliquidManager(true, true, privateKeyManager.getPrivateKey()) + hlManager = new HyperliquidManager(false, env.TESTNET, privateKeyManager.getPrivateKey()) blockchainConnectionProvider = new BlockchainConnectionProvider({ providerUrl: env.PROVIDER_URL, @@ -56,7 +56,7 @@ export async function main(runWithCron: boolean) { console.error("Error initializing migration service due to the following error, skipping this run", error); throw error; } - + console.info('migration service initialized') if (runWithCron) { console.info('starting cron job for migrations, running every 5 minutes') const scheduledTask = cron.schedule('* * * * *', async () => {