From 86abb1036d4db7062150dcd18dfa1c11b78ba964 Mon Sep 17 00:00:00 2001 From: Jacob Date: Thu, 21 Mar 2024 11:49:50 +0800 Subject: [PATCH 1/5] fix rpc archive node validation --- apps/indexer-coordinator/src/project/rpc.factory.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/indexer-coordinator/src/project/rpc.factory.ts b/apps/indexer-coordinator/src/project/rpc.factory.ts index 7cd586398..08bf1b93f 100644 --- a/apps/indexer-coordinator/src/project/rpc.factory.ts +++ b/apps/indexer-coordinator/src/project/rpc.factory.ts @@ -144,7 +144,7 @@ export class RpcFamilyEvm extends RpcFamily { this.actions.push(async () => { const result = await jsonRpcRequest(this.endpoint, 'eth_getBalance', [ '0x0000000000000000000000000000000000000000', - 'latest', + '0x1', ]); let nodeTypeFromRpc: string; if (result.data.error) { From 433e9f88672a417643d8c15022f9acf83723d477 Mon Sep 17 00:00:00 2001 From: Jacob Date: Thu, 21 Mar 2024 11:50:26 +0800 Subject: [PATCH 2/5] downgrade channle.spent log level --- apps/indexer-coordinator/src/payg/payg.service.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/indexer-coordinator/src/payg/payg.service.ts b/apps/indexer-coordinator/src/payg/payg.service.ts index 0317f79e1..71ea6fb23 100644 --- a/apps/indexer-coordinator/src/payg/payg.service.ts +++ b/apps/indexer-coordinator/src/payg/payg.service.ts @@ -326,7 +326,7 @@ export class PaygService { // add a price every time channel.spent = (prevSpent + price).toString(); - logger.warn(`channel.spent: ${channel.spent}, spent: ${spent}, price: ${price}`); + logger.debug(`channel.spent: ${channel.spent}, spent: ${spent}, price: ${price}`); // if remote is less than own, just add spent if (prevRemote < currentRemote) { From f13d6360a28079d2614e14d5303e48b0d541622c Mon Sep 17 00:00:00 2001 From: Jacob Date: Thu, 11 Apr 2024 18:46:01 +0800 Subject: [PATCH 3/5] fix template to support complicated password --- .../src/project/project.service.ts | 12 ++++++++++-- apps/indexer-coordinator/src/utils/template.yml | 12 ++++++------ 2 files changed, 16 insertions(+), 8 deletions(-) diff --git a/apps/indexer-coordinator/src/project/project.service.ts b/apps/indexer-coordinator/src/project/project.service.ts index e6f283b91..d38076f14 100644 --- a/apps/indexer-coordinator/src/project/project.service.ts +++ b/apps/indexer-coordinator/src/project/project.service.ts @@ -11,7 +11,7 @@ import _ from 'lodash'; import { timeoutPromiseHO } from 'src/utils/promise'; import { PostgresKeys, argv } from 'src/yargs'; import { Not, Repository } from 'typeorm'; -import { Config } from '../configure/configure.module'; +import { Config, Postgres } from '../configure/configure.module'; import { AccountService } from '../core/account.service'; import { ContractService } from '../core/contract.service'; import { DockerService } from '../core/docker.service'; @@ -319,7 +319,7 @@ export class ProjectService { const mmrStoreType = await this.getMmrStoreType(project.id); const projectID = projectId(project.id); - const postgres = this.config.postgres; + const postgres = this.escapePostgresConfig(this.config.postgres); const dockerNetwork = this.config.dockerNetwork; const mmrPath = argv['mmrPath'].replace(/\/$/, ''); @@ -349,6 +349,14 @@ export class ProjectService { return item; } + escapePostgresConfig(config: Postgres) { + const escaped = JSON.parse(JSON.stringify(config)) as Postgres; + escaped.user = escaped.user.replace(/\\/g, '\\\\').replace(/"/g, '\\"'); + escaped.pass = escaped.pass.replace(/\\/g, '\\\\').replace(/"/g, '\\"'); + escaped.db = escaped.db.replace(/\\/g, '\\\\').replace(/"/g, '\\"'); + return escaped; + } + async createAndStartSubqueryProject(id: string, projectConfig: IProjectConfig) { let project = await this.getProject(id); if (!project) { diff --git a/apps/indexer-coordinator/src/utils/template.yml b/apps/indexer-coordinator/src/utils/template.yml index e5743fc21..40f3c0247 100644 --- a/apps/indexer-coordinator/src/utils/template.yml +++ b/apps/indexer-coordinator/src/utils/template.yml @@ -10,9 +10,9 @@ services: expose: - {{servicePort}} environment: - DB_USER: {{postgres.user}} - DB_PASS: {{postgres.pass}} - DB_DATABASE: {{postgres.db}} + DB_USER: "{{postgres.user}}" + DB_PASS: "{{postgres.pass}}" + DB_DATABASE: "{{postgres.db}}" DB_HOST: {{postgres.host}} DB_PORT: {{postgres.port}} volumes: @@ -73,9 +73,9 @@ services: condition: service_healthy restart: always environment: - DB_USER: {{postgres.user}} - DB_PASS: {{postgres.pass}} - DB_DATABASE: {{postgres.db}} + DB_USER: "{{postgres.user}}" + DB_PASS: "{{postgres.pass}}" + DB_DATABASE: "{{postgres.db}}" DB_HOST: {{postgres.host}} DB_PORT: {{postgres.port}} command: From 54187698dbe9b0c08dc457286c822b301d037d01 Mon Sep 17 00:00:00 2001 From: Jacob Date: Fri, 12 Apr 2024 16:02:10 +0800 Subject: [PATCH 4/5] update coordinator version 2.0.7-2 --- apps/indexer-coordinator/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/indexer-coordinator/package.json b/apps/indexer-coordinator/package.json index a29740d98..1da4a354a 100644 --- a/apps/indexer-coordinator/package.json +++ b/apps/indexer-coordinator/package.json @@ -1,6 +1,6 @@ { "name": "@subql/indexer-coordinator", - "version": "2.0.7-1", + "version": "2.0.7-2", "description": "", "author": "SubQuery", "license": "Apache-2.0", From 23a408924ac4a4876bee9a6d58f77d6dffa8f30b Mon Sep 17 00:00:00 2001 From: Jacob Date: Fri, 12 Apr 2024 16:47:28 +0800 Subject: [PATCH 5/5] [release] Bump coordinator v2.0.7 --- apps/indexer-coordinator/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/indexer-coordinator/package.json b/apps/indexer-coordinator/package.json index 1da4a354a..01a27b333 100644 --- a/apps/indexer-coordinator/package.json +++ b/apps/indexer-coordinator/package.json @@ -1,6 +1,6 @@ { "name": "@subql/indexer-coordinator", - "version": "2.0.7-2", + "version": "2.0.7", "description": "", "author": "SubQuery", "license": "Apache-2.0",