Skip to content

Commit

Permalink
fix indexer build
Browse files Browse the repository at this point in the history
Signed-off-by: simvalery <[email protected]>
  • Loading branch information
simvalery committed Nov 4, 2024
1 parent f8004b1 commit ee48060
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 4 deletions.
1 change: 1 addition & 0 deletions indexer-api-gateway/src/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ Promise.all([
queue: 'INDEXER_API_SERVICES',
servers: [`nats://${process.env.MQ_ADDRESS}:4222`],
},
// tls: GenerateTLSOptionsNats()
});
app.useGlobalPipes(
new ValidationPipe({
Expand Down
2 changes: 2 additions & 0 deletions indexer-common/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
import 'reflect-metadata';
import * as ent from './entity/index.js';

export * from './entity/index.js';
export * from './utils/utils.js';
export * from './utils/environment.js';
export * from './utils/job.js';
export * from './utils/tls.js';
export * from './db-helper/db-config.js';
export * from './db-helper/db-migration.js';
export * from './db-helper/db-helper.js';
Expand Down
10 changes: 10 additions & 0 deletions indexer-common/src/utils/tls.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
export function GenerateTLSOptionsNats() {
if (process.env.TLS_CERT && process.env.TLS_KEY) {
return {
cert: process.env.TLS_CERT,
key: process.env.TLS_KEY,
ca: process.env.TLS_CA
}
}
return undefined;
}
3 changes: 1 addition & 2 deletions indexer-service/src/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import * as process from 'process';
import { Module } from '@nestjs/common';
import { NestFactory } from '@nestjs/core';
import { ClientsModule, MicroserviceOptions, Transport, } from '@nestjs/microservices';
import { COMMON_CONNECTION_CONFIG, DataBaseHelper, entities, Migration, Utils, } from '@indexer/common';
import { COMMON_CONNECTION_CONFIG, DataBaseHelper, entities, GenerateTLSOptionsNats, Migration, Utils } from '@indexer/common';
import { ChannelService } from './api/channel.service.js';
import { LogService } from './_dev/api/log.service.js';
import { SearchService } from './api/search.service.js';
Expand All @@ -12,7 +12,6 @@ import { LandingService } from './api/landing.service.js';
import { AnalyticsService } from './api/analytics.service.js';
import { SynchronizationAnalytics, SynchronizationContracts, SynchronizationDid, SynchronizationModules, SynchronizationPolicy, SynchronizationProjects, SynchronizationRegistries, SynchronizationRoles, SynchronizationSchemas, SynchronizationTools, SynchronizationTopics, SynchronizationVCs, SynchronizationVPs, } from './helpers/synchronizers/index.js';
import { fixtures } from './helpers/fixtures.js';
import { GenerateTLSOptionsNats } from '@guardian/common';

const channelName = (
process.env.SERVICE_CHANNEL || `indexer-service.${Utils.GenerateUUIDv4(26)}`
Expand Down
3 changes: 1 addition & 2 deletions indexer-worker-service/src/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@ import { ClientsModule, MicroserviceOptions, Transport } from '@nestjs/microserv
import { ChannelService, Worker } from './api/channel.service.js';
import { IPFSService } from './loaders/ipfs-service.js';
import { HederaService } from './loaders/hedera-service.js';
import { COMMON_CONNECTION_CONFIG, DataBaseHelper, entities, Environment, Migration, Utils } from '@indexer/common';
import { GenerateTLSOptionsNats } from '@guardian/common';
import { COMMON_CONNECTION_CONFIG, DataBaseHelper, entities, Environment, GenerateTLSOptionsNats, Migration, Utils } from '@indexer/common';

const channelName = (process.env.SERVICE_CHANNEL || `indexer-worker.${Utils.GenerateUUIDv4(26)}`).toUpperCase();

Expand Down

0 comments on commit ee48060

Please sign in to comment.