Skip to content

Commit

Permalink
fix(pre-register): send preregistration fields
Browse files Browse the repository at this point in the history
  • Loading branch information
Diego Rodriguez Baquero committed Aug 15, 2023
1 parent b75b7dc commit 5710836
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
1 change: 1 addition & 0 deletions container/shim/src/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
9 changes: 6 additions & 3 deletions container/shim/src/modules/registration.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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) {
Expand All @@ -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,
Expand Down

0 comments on commit 5710836

Please sign in to comment.