diff --git a/drift-common b/drift-common index 78cb08e..0303c32 160000 --- a/drift-common +++ b/drift-common @@ -1 +1 @@ -Subproject commit 78cb08e848cffa103a4c382948237f8f5113b967 +Subproject commit 0303c32d038e1ea1c9c21fc5c31f16730eed5fc3 diff --git a/src/publishers/dlobPublisher.ts b/src/publishers/dlobPublisher.ts index 05f86a7..dbd29ec 100644 --- a/src/publishers/dlobPublisher.ts +++ b/src/publishers/dlobPublisher.ts @@ -324,7 +324,24 @@ const main = async () => { let accountSubscription: DriftClientSubscriptionConfig; let slotSource: SlotSource; - if (!useWebsocket) { + // USE_GRPC=true will override websocket + if (useGrpc) { + accountSubscription = { + type: 'grpc', + resubTimeoutMs: 30_000, + grpcConfigs: { + endpoint, + token, + }, + }; + + slotSubscriber = new SlotSubscriber(connection); + await slotSubscriber.subscribe(); + + slotSource = { + getSlot: () => slotSubscriber!.getSlot(), + }; + } else if (!useWebsocket) { bulkAccountLoader = new BulkAccountLoader( connection, stateCommitment,