From 5196d1d949c92402e5b7561f5fcf660018320323 Mon Sep 17 00:00:00 2001 From: Konstantina Blazhukova Date: Mon, 21 Oct 2024 17:25:50 +0300 Subject: [PATCH] Removes querying to mirrorNode Signed-off-by: Konstantina Blazhukova --- packages/relay/src/lib/clients/sdkClient.ts | 25 +-------------------- 1 file changed, 1 insertion(+), 24 deletions(-) diff --git a/packages/relay/src/lib/clients/sdkClient.ts b/packages/relay/src/lib/clients/sdkClient.ts index 7741b5096..8f8745c93 100644 --- a/packages/relay/src/lib/clients/sdkClient.ts +++ b/packages/relay/src/lib/clients/sdkClient.ts @@ -67,10 +67,6 @@ import { ITransactionRecordMetric, RequestDetails, } from '../types'; -import MirrorNode from '@hashgraph/sdk/lib/MirrorNode'; -import { MirrorNodeClient } from './mirrorNodeClient'; -import { Registry } from 'prom-client'; - const _ = require('lodash'); export class SDKClient { @@ -121,8 +117,6 @@ export class SDKClient { */ private readonly eventEmitter: EventEmitter; - private readonly mirrorNodeClient: MirrorNodeClient; - /** * Constructs an instance of the SDKClient and initializes various services and settings. * @@ -139,9 +133,6 @@ export class SDKClient { cacheService: CacheService, eventEmitter: EventEmitter, ) { - const registry = new Registry(); - const restUrl = process.env.MIRROR_NODE_REST_URL || ''; - this.mirrorNodeClient = new MirrorNodeClient(restUrl, logger, registry, cacheService); this.clientMain = clientMain; if (process.env.CONSENSUS_MAX_EXECUTION_TIME) { @@ -757,22 +748,8 @@ export class SDKClient { ); if (!transactionResponse) { - await new Promise((resolve) => setTimeout(resolve, 2000)); - const transactionId = transaction.transactionId ? transaction.transactionId.toString() : false; - console.log('Transaction id', transactionId); - if (transactionId) { - try { - const transactionFromMirrorNode = await this.mirrorNodeClient.getTransactionById( - transactionId, - requestDetails, - ); - this.logger.warn('Transaction found', transactionFromMirrorNode); - } catch (e) { - this.logger.warn('Transaction not found in mirror node', e); - } - } throw predefined.INTERNAL_ERROR( - `${requestDetails.formattedRequestId} TTransaction execution returns a null value: transactionId=${transaction.transactionId}, callerName=${callerName}, txConstructorName=${txConstructorName}`, + `${requestDetails.formattedRequestId} Transaction execution returns a null value: transactionId=${transaction.transactionId}, callerName=${callerName}, txConstructorName=${txConstructorName}`, ); }