From e45e98f864453eda6a04fe9c23b17e64b8bdbaa0 Mon Sep 17 00:00:00 2001 From: xiaoch05 Date: Mon, 19 Aug 2024 20:02:21 +0800 Subject: [PATCH] testnet graph indexer --- apollo/.env.test | 1 + apollo/src/base/TransferServiceT2.ts | 1 + apollo/src/lnv3/lnv3.service.ts | 14 ++++++++++++++ apollo/src/lnv3/transfer.service.ts | 15 ++++++++------- 4 files changed, 24 insertions(+), 7 deletions(-) diff --git a/apollo/.env.test b/apollo/.env.test index 9f3e5f7..c8d88ea 100644 --- a/apollo/.env.test +++ b/apollo/.env.test @@ -35,3 +35,4 @@ XTOKEN_DISPATCH_DARWINIA = https://thegraph-g2.darwinia.network/helix/subgraphs/ XTOKEN_DISPATCH_ETHEREUM = https://api.studio.thegraph.com/query/61328/xtoken-dispatch-sepolia/v1.1.4 PONDER_LNV3_ENDPOINT = https://ponder-testnet.helixbridge.app/ +LNV3_SUPER_ENDPOINT = http://g2.generic.darwinia.network:8800/graphql diff --git a/apollo/src/base/TransferServiceT2.ts b/apollo/src/base/TransferServiceT2.ts index a682f01..eb0670b 100644 --- a/apollo/src/base/TransferServiceT2.ts +++ b/apollo/src/base/TransferServiceT2.ts @@ -23,6 +23,7 @@ export enum Level0IndexerType { thegraph, ponder, envio, + superindex, } export interface FetchCacheInfo { diff --git a/apollo/src/lnv3/lnv3.service.ts b/apollo/src/lnv3/lnv3.service.ts index 6eaeb77..72201d1 100644 --- a/apollo/src/lnv3/lnv3.service.ts +++ b/apollo/src/lnv3/lnv3.service.ts @@ -9,6 +9,7 @@ import { ChainToken, ChainMessager, ChainCouple } from '@helixbridge/helixconf'; import { Lnv3ThegraphService } from './source/thegraph.service'; import { Lnv3PonderService } from './source/ponder.service'; import { Lnv3EnvioService } from './source/envio.service'; +import { Lnv3SuperService } from './source/super.service'; export enum RelayUpdateType { PROVIDER_UPDATE, @@ -44,6 +45,7 @@ export class Lnv3Service implements OnModuleInit { this.sourceServices.set(Level0IndexerType.thegraph, new Lnv3ThegraphService()); this.sourceServices.set(Level0IndexerType.ponder, new Lnv3PonderService()); this.sourceServices.set(Level0IndexerType.envio, new Lnv3EnvioService()); + this.sourceServices.set(Level0IndexerType.superindex, new Lnv3SuperService()); } async onModuleInit() { @@ -236,6 +238,18 @@ export class Lnv3Service implements OnModuleInit { } const fromToken = this.getTokenInfo(transfer, record.sourceToken); const toToken = this.getTokenInfo(toChain, record.targetToken); + if (fromToken === null) { + this.logger.warn( + `cannot find fromToken symbol, fromToken ${record.sourceToken}, chain: ${transfer.chainConfig.code}` + ); + continue; + } + if (toToken === null) { + this.logger.warn( + `cannot find fromToken symbol, toToken ${record.targetToken}, chain: ${toChain.chainConfig.code}` + ); + continue; + } const responseHash = ''; const result = RecordStatus.pending; diff --git a/apollo/src/lnv3/transfer.service.ts b/apollo/src/lnv3/transfer.service.ts index cf91f73..e87cbde 100644 --- a/apollo/src/lnv3/transfer.service.ts +++ b/apollo/src/lnv3/transfer.service.ts @@ -28,6 +28,7 @@ export class TransferService extends BaseTransferServiceT2 { public readonly ponderEndpoint = this.configService.get('PONDER_LNV3_ENDPOINT'); private readonly dnvioEndpoint = this.configService.get('LNV3_ENVIO_ENDPOINT'); + private readonly superindexEndpoint = this.configService.get('LNV3_SUPER_ENDPOINT'); formalChainTransfers: PartnerT2[] = [ { @@ -247,8 +248,8 @@ export class TransferService extends BaseTransferServiceT2 { { level0Indexers: [ { - indexerType: Level0IndexerType.thegraph, - url: this.beraEndpoint, + indexerType: Level0IndexerType.superindex, + url: this.superindexEndpoint, }, ], chainConfig: HelixChain.bera, @@ -256,8 +257,8 @@ export class TransferService extends BaseTransferServiceT2 { { level0Indexers: [ { - indexerType: Level0IndexerType.thegraph, - url: this.morphEndpoint, + indexerType: Level0IndexerType.superindex, + url: this.superindexEndpoint, }, ], chainConfig: HelixChain.morph, @@ -274,11 +275,11 @@ export class TransferService extends BaseTransferServiceT2 { { level0Indexers: [ { - indexerType: Level0IndexerType.thegraph, - url: this.zircuitEndpoint, + indexerType: Level0IndexerType.superindex, + url: this.superindexEndpoint, }, ], - chainConfig: HelixChain.zircuit, + chainConfig: HelixChain.zircuitSepolia, }, ];