MCPcopy Create free account
hub / github.com/EvoMap/evolver / ensureRegistered

Function ensureRegistered

index.js:3394–3404  ·  view source on GitHub ↗
(tag)

Source from the content-addressed store, hash-verified

3392 return eq ? eq.split('=').slice(1).join('=') : null;
3393 }
3394 async function ensureRegistered(tag) {
3395 if (!getHubNodeSecret()) {
3396 console.log('[' + tag + '] No node_secret found. Registering with Hub...');
3397 const hello = await sendHelloToHub();
3398 if (!hello || !hello.ok) {
3399 console.error('[' + tag + '] Failed to register with Hub:', (hello && hello.error) || 'unknown');
3400 process.exit(1);
3401 }
3402 console.log('[' + tag + '] Registered as ' + getNodeId());
3403 }
3404 }
3405 // True when the hub rejected our node_secret as stale/invalid — the one
3406 // case where a rotate-and-retry is the documented recovery.
3407 function isStaleSecret(result) {

Callers 1

mainFunction · 0.85

Calls 1

getHubNodeSecretFunction · 0.85

Tested by

no test coverage detected