Skip to content

Commit 5710836

Browse files
author
Diego Rodriguez Baquero
committed
fix(pre-register): send preregistration fields
1 parent b75b7dc commit 5710836

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

container/shim/src/config.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ export const PORT = 10361;
77
export const TESTING_CID = "QmXjYBY478Cno4jzdCcPy4NcJYFrwHZ51xaCP8vUwN9MGm";
88

99
// Node and network info
10+
export const NETWORK_LEVEL = 1;
1011
export const NODE_ID = (await readFile(NODE_ID_FILE_PATH, "utf8")).trim();
1112
export const NETWORK = process.env.NETWORK?.trim().toLowerCase() || "local";
1213
export const VERSION = pVersion(process.env.VERSION || DEV_VERSION);

container/shim/src/modules/registration.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,12 @@ import fetch from "node-fetch";
55
import {
66
DEV_VERSION,
77
FIL_WALLET_ADDRESS,
8-
NODE_VERSION_HASH,
98
NETWORK,
9+
NETWORK_LEVEL,
1010
NODE_ID,
1111
NODE_OPERATOR_EMAIL,
1212
NODE_UA,
13+
NODE_VERSION_HASH,
1314
ORCHESTRATOR_REGISTRATION,
1415
ORCHESTRATOR_URL,
1516
updateNodeToken,
@@ -48,7 +49,9 @@ export async function register(initial = false) {
4849

4950
let preregisterResponse;
5051
if (initial) {
51-
preregisterResponse = await sendPreRegisterRequest(postOptions({ nodeId: NODE_ID }));
52+
preregisterResponse = await sendPreRegisterRequest(
53+
postOptions({ nodeId: NODE_ID, level: NETWORK_LEVEL, version: VERSION })
54+
);
5255
}
5356

5457
if (preregisterResponse?.filesToPurge) {
@@ -75,7 +78,7 @@ export async function register(initial = false) {
7578
const body = {
7679
nodeId: NODE_ID,
7780
nodeVersionHash: NODE_VERSION_HASH,
78-
level: 1,
81+
level: NETWORK_LEVEL,
7982
version: VERSION,
8083
filWalletAddress: FIL_WALLET_ADDRESS,
8184
operatorEmail: NODE_OPERATOR_EMAIL,

0 commit comments

Comments
 (0)