Skip to content

Commit

Permalink
disable grpc for general driftclient
Browse files Browse the repository at this point in the history
  • Loading branch information
wphan committed Dec 5, 2024
1 parent 4ae9d9b commit e8feb96
Showing 1 changed file with 27 additions and 22 deletions.
49 changes: 27 additions & 22 deletions src/publishers/dlobPublisher.ts
Original file line number Diff line number Diff line change
Expand Up @@ -324,29 +324,34 @@ const main = async () => {
let accountSubscription: DriftClientSubscriptionConfig;
let slotSource: SlotSource;

// NOTE: disable GRPC for general driftClient subscriptions until we can reliably subscribe
// to multiple streams. Currently this causes the nodes to start killing connections.
//
// USE_GRPC=true will override websocket
if (useGrpc) {
accountSubscription = {
type: 'grpc',
resubTimeoutMs: 30_000,
grpcConfigs: {
endpoint,
token,
channelOptions: {
'grpc.keepalive_time_ms': 10_000,
'grpc.keepalive_timeout_ms': 1_000,
'grpc.keepalive_permit_without_calls': 1,
},
},
};

slotSubscriber = new SlotSubscriber(connection);
await slotSubscriber.subscribe();

slotSource = {
getSlot: () => slotSubscriber!.getSlot(),
};
} else if (!useWebsocket) {
// if (useGrpc) {
// accountSubscription = {
// type: 'grpc',
// resubTimeoutMs: 30_000,
// grpcConfigs: {
// endpoint,
// token,
// channelOptions: {
// 'grpc.keepalive_time_ms': 10_000,
// 'grpc.keepalive_timeout_ms': 1_000,
// 'grpc.keepalive_permit_without_calls': 1,
// },
// },
// };

// slotSubscriber = new SlotSubscriber(connection);
// await slotSubscriber.subscribe();

// slotSource = {
// getSlot: () => slotSubscriber!.getSlot(),
// };
// }

if (!useWebsocket) {
bulkAccountLoader = new BulkAccountLoader(
connection,
stateCommitment,
Expand Down

0 comments on commit e8feb96

Please sign in to comment.