From 6d51e9aea98b574176aa374e6c3f844f3422a29e Mon Sep 17 00:00:00 2001 From: jairajdev Date: Thu, 19 Sep 2024 22:16:29 +0545 Subject: [PATCH 1/8] Restrict first node selection based on the specified node ip and port --- src/API.ts | 15 +++++++++++---- src/Config.ts | 10 ++++++++++ 2 files changed, 21 insertions(+), 4 deletions(-) diff --git a/src/API.ts b/src/API.ts index 1493cbf..f385d2b 100644 --- a/src/API.ts +++ b/src/API.ts @@ -81,6 +81,7 @@ export function registerRoutes(server: FastifyInstance { From 9b3252fde90a08f04e57ab55caa2154d4a0594e9 Mon Sep 17 00:00:00 2001 From: jairajdev Date: Thu, 19 Sep 2024 23:05:26 +0545 Subject: [PATCH 2/8] Change the first node port to 9001 --- src/Config.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Config.ts b/src/Config.ts index e9bf1de..68a626c 100644 --- a/src/Config.ts +++ b/src/Config.ts @@ -192,7 +192,7 @@ let config: Config = { restrictFirstNodeSelection: true, firstNodeInfo: { IP: '127.0.0.1', - PORT: 4000, + PORT: 9001, }, } // Override default config params from config file, env vars, and cli args From 22c7919172f0f098c3342d286e0cfc894eb5e180 Mon Sep 17 00:00:00 2001 From: jairajdev Date: Fri, 20 Sep 2024 01:09:50 +0545 Subject: [PATCH 3/8] Added restrictFirstNodeSelectionByPublicKey to use in selecting first node based on public key --- src/API.ts | 43 ++++++++++++++++++++++++++++++++++++++++--- src/Config.ts | 6 +++++- 2 files changed, 45 insertions(+), 4 deletions(-) diff --git a/src/API.ts b/src/API.ts index f385d2b..094e1c5 100644 --- a/src/API.ts +++ b/src/API.ts @@ -35,6 +35,7 @@ import { failureReceiptCount, } from './primary-process' import * as ServiceQueue from './ServiceQueue' +import { sign } from 'crypto' const { version } = require('../package.json') // eslint-disable-line @typescript-eslint/no-var-requires const TXID_LENGTH = 64 @@ -81,8 +82,37 @@ export function registerRoutes(server: FastifyInstance Date: Fri, 20 Sep 2024 01:29:02 +0545 Subject: [PATCH 4/8] Set restrictFirstNodeSelection to false as default --- src/Config.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Config.ts b/src/Config.ts index 3ce7871..e59c48f 100644 --- a/src/Config.ts +++ b/src/Config.ts @@ -191,7 +191,7 @@ let config: Config = { txCronSchedule: '*/5 * * * *', }, workerProcessesDebugLog: false, - restrictFirstNodeSelection: true, + restrictFirstNodeSelection: false, restrictFirstNodeSelectionByPublicKey: false, firstNodeInfo: { IP: '127.0.0.1', From 8ae14343970761f0939f266d5cc5284925781709 Mon Sep 17 00:00:00 2001 From: urnotsam Date: Thu, 19 Sep 2024 16:08:38 -0400 Subject: [PATCH 5/8] fix validateTypes --- src/API.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/API.ts b/src/API.ts index 094e1c5..a347261 100644 --- a/src/API.ts +++ b/src/API.ts @@ -93,7 +93,7 @@ export function registerRoutes(server: FastifyInstance Date: Fri, 20 Sep 2024 02:14:25 +0545 Subject: [PATCH 6/8] Remove first node IP and PORT check code --- src/API.ts | 10 +--------- src/Config.ts | 14 ++------------ 2 files changed, 3 insertions(+), 21 deletions(-) diff --git a/src/API.ts b/src/API.ts index a347261..26dfc7d 100644 --- a/src/API.ts +++ b/src/API.ts @@ -35,7 +35,6 @@ import { failureReceiptCount, } from './primary-process' import * as ServiceQueue from './ServiceQueue' -import { sign } from 'crypto' const { version } = require('../package.json') // eslint-disable-line @typescript-eslint/no-var-requires const TXID_LENGTH = 64 @@ -127,15 +126,8 @@ export function registerRoutes(server: FastifyInstance { From 15026bc9e299aa38c7b210e0ecc0ae9530e98a70 Mon Sep 17 00:00:00 2001 From: jairajdev Date: Fri, 20 Sep 2024 02:25:21 +0545 Subject: [PATCH 7/8] refactor restrictFirstNodeSelectionByPublicKey check --- src/API.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/API.ts b/src/API.ts index 26dfc7d..73f5da7 100644 --- a/src/API.ts +++ b/src/API.ts @@ -127,7 +127,7 @@ export function registerRoutes(server: FastifyInstance Date: Thu, 19 Sep 2024 18:02:20 -0400 Subject: [PATCH 8/8] Fix debug_mode.patch so it applies again. --- debug_mode.patch | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/debug_mode.patch b/debug_mode.patch index b29aeba..c2f2a93 100644 --- a/debug_mode.patch +++ b/debug_mode.patch @@ -1,8 +1,8 @@ diff --git a/archiver-config.json b/archiver-config.json -index a892baf..ffac25a 100644 +index 7fafd0a..da32776 100644 --- a/archiver-config.json +++ b/archiver-config.json -@@ -56,7 +56,7 @@ +@@ -56,6 +56,6 @@ "publicKey": "aec5d2b663869d9c22ba99d8de76f3bff0f54fa5e39d2899ec1f3f4543422ec7" } ], @@ -12,10 +12,10 @@ index a892baf..ffac25a 100644 } \ No newline at end of file diff --git a/src/Config.ts b/src/Config.ts -index 6b41ee4..a812003 100644 +index 49bb21a..69cda2a 100644 --- a/src/Config.ts +++ b/src/Config.ts -@@ -86,7 +86,7 @@ let config: Config = { +@@ -127,7 +127,7 @@ let config: Config = { save: true, interval: 1, },