From 57108363d3618c8d31b13edb414fba87f627fd97 Mon Sep 17 00:00:00 2001 From: Diego Rodriguez Baquero Date: Tue, 15 Aug 2023 15:18:21 -0500 Subject: [PATCH] fix(pre-register): send preregistration fields --- container/shim/src/config.js | 1 + container/shim/src/modules/registration.js | 9 ++++++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/container/shim/src/config.js b/container/shim/src/config.js index cb52f2b6..6ae74296 100644 --- a/container/shim/src/config.js +++ b/container/shim/src/config.js @@ -7,6 +7,7 @@ export const PORT = 10361; export const TESTING_CID = "QmXjYBY478Cno4jzdCcPy4NcJYFrwHZ51xaCP8vUwN9MGm"; // Node and network info +export const NETWORK_LEVEL = 1; export const NODE_ID = (await readFile(NODE_ID_FILE_PATH, "utf8")).trim(); export const NETWORK = process.env.NETWORK?.trim().toLowerCase() || "local"; export const VERSION = pVersion(process.env.VERSION || DEV_VERSION); diff --git a/container/shim/src/modules/registration.js b/container/shim/src/modules/registration.js index 3dfe8c62..87c3c502 100644 --- a/container/shim/src/modules/registration.js +++ b/container/shim/src/modules/registration.js @@ -5,11 +5,12 @@ import fetch from "node-fetch"; import { DEV_VERSION, FIL_WALLET_ADDRESS, - NODE_VERSION_HASH, NETWORK, + NETWORK_LEVEL, NODE_ID, NODE_OPERATOR_EMAIL, NODE_UA, + NODE_VERSION_HASH, ORCHESTRATOR_REGISTRATION, ORCHESTRATOR_URL, updateNodeToken, @@ -48,7 +49,9 @@ export async function register(initial = false) { let preregisterResponse; if (initial) { - preregisterResponse = await sendPreRegisterRequest(postOptions({ nodeId: NODE_ID })); + preregisterResponse = await sendPreRegisterRequest( + postOptions({ nodeId: NODE_ID, level: NETWORK_LEVEL, version: VERSION }) + ); } if (preregisterResponse?.filesToPurge) { @@ -75,7 +78,7 @@ export async function register(initial = false) { const body = { nodeId: NODE_ID, nodeVersionHash: NODE_VERSION_HASH, - level: 1, + level: NETWORK_LEVEL, version: VERSION, filWalletAddress: FIL_WALLET_ADDRESS, operatorEmail: NODE_OPERATOR_EMAIL,