Skip to content

Commit c922755

Browse files
committed
fix(auth-server): initSystemContext to override RPC URL
1 parent 689e557 commit c922755

File tree

2 files changed

+12
-3
lines changed

2 files changed

+12
-3
lines changed

packages/auth-services/src/_setup/initSystemContext.ts

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,12 +40,20 @@ export async function initSystemContext({
4040
throw new Error(`Unsupported network: ${env.NETWORK}`);
4141
}
4242

43+
const overrideRpc = rpcUrl || env.LIT_TXSENDER_RPC_URL;
44+
4345
// Apply runtime override if rpcUrl provided
4446
const effectiveModule =
45-
rpcUrl && typeof networkModule.withOverrides === 'function'
46-
? networkModule.withOverrides({ rpcUrl })
47+
overrideRpc && typeof networkModule.withOverrides === 'function'
48+
? networkModule.withOverrides({ rpcUrl: overrideRpc })
4749
: networkModule;
4850

51+
try {
52+
const baseRpc = typeof networkModule.getRpcUrl === 'function' ? networkModule.getRpcUrl() : 'n/a';
53+
const effRpc = typeof effectiveModule.getRpcUrl === 'function' ? effectiveModule.getRpcUrl() : 'n/a';
54+
console.log('[initSystemContext] RPC (base → effective):', baseRpc, '→', effRpc);
55+
} catch {}
56+
4957
const litClient = await createLitClient({
5058
network: effectiveModule,
5159
});

packages/auth-services/src/queue-manager/worker.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { initSystemContext } from '../_setup/initSystemContext';
22
import { bullmqConnectionOptions, mainQueueName } from './src/bullmqSetup';
33
import { createGenericWorker } from './src/genericWorker';
4+
import { env } from '../env';
45

56
interface ParsedRedisConnectionOpts {
67
host?: string;
@@ -10,7 +11,7 @@ interface ParsedRedisConnectionOpts {
1011
}
1112

1213
export async function startAuthServiceWorker() {
13-
await initSystemContext({ appName: 'auth-services-worker' });
14+
await initSystemContext({ appName: 'auth-services-worker', rpcUrl: env.LIT_TXSENDER_RPC_URL });
1415
console.log('------------------------------------------------------');
1516
console.log(' Attempting to start Generic BullMQ Worker Process... ');
1617
console.log('------------------------------------------------------');

0 commit comments

Comments
 (0)