Skip to content

Commit

Permalink
testnet graph indexer
Browse files Browse the repository at this point in the history
  • Loading branch information
xiaoch05 committed Aug 19, 2024
1 parent ce7cdf1 commit e45e98f
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 7 deletions.
1 change: 1 addition & 0 deletions apollo/.env.test
Original file line number Diff line number Diff line change
Expand Up @@ -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
1 change: 1 addition & 0 deletions apollo/src/base/TransferServiceT2.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ export enum Level0IndexerType {
thegraph,
ponder,
envio,
superindex,
}

export interface FetchCacheInfo {
Expand Down
14 changes: 14 additions & 0 deletions apollo/src/lnv3/lnv3.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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() {
Expand Down Expand Up @@ -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;
Expand Down
15 changes: 8 additions & 7 deletions apollo/src/lnv3/transfer.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ export class TransferService extends BaseTransferServiceT2 {

public readonly ponderEndpoint = this.configService.get<string>('PONDER_LNV3_ENDPOINT');
private readonly dnvioEndpoint = this.configService.get<string>('LNV3_ENVIO_ENDPOINT');
private readonly superindexEndpoint = this.configService.get<string>('LNV3_SUPER_ENDPOINT');

formalChainTransfers: PartnerT2[] = [
{
Expand Down Expand Up @@ -247,17 +248,17 @@ export class TransferService extends BaseTransferServiceT2 {
{
level0Indexers: [
{
indexerType: Level0IndexerType.thegraph,
url: this.beraEndpoint,
indexerType: Level0IndexerType.superindex,
url: this.superindexEndpoint,
},
],
chainConfig: HelixChain.bera,
},
{
level0Indexers: [
{
indexerType: Level0IndexerType.thegraph,
url: this.morphEndpoint,
indexerType: Level0IndexerType.superindex,
url: this.superindexEndpoint,
},
],
chainConfig: HelixChain.morph,
Expand All @@ -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,
},
];

Expand Down

0 comments on commit e45e98f

Please sign in to comment.