@onlineapps/conn-orch-registry 1.1.7 → 1.1.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/registryClient.js +33 -22
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@onlineapps/conn-orch-registry",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.8",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "Connector-registry-client provides the core communication mechanism for microservices in this environment. It enables them to interact with a services_registry to receive and fulfill tasks by submitting heartbeats or their API descriptions.",
|
|
6
6
|
"keywords": [
|
package/src/registryClient.js
CHANGED
|
@@ -66,7 +66,9 @@ class ServiceRegistryClient extends EventEmitter {
|
|
|
66
66
|
await this.queueManager.init();
|
|
67
67
|
|
|
68
68
|
// Load validation proof if exists
|
|
69
|
+
console.error(`[RegistryClient] ${this.serviceName}: === CALLING _loadValidationProof() ===`);
|
|
69
70
|
await this._loadValidationProof();
|
|
71
|
+
console.error(`[RegistryClient] ${this.serviceName}: === FINISHED _loadValidationProof() ===`);
|
|
70
72
|
|
|
71
73
|
// Create service-specific response queue
|
|
72
74
|
this.serviceResponseQueue = `${this.serviceName}.responses`;
|
|
@@ -100,40 +102,49 @@ class ServiceRegistryClient extends EventEmitter {
|
|
|
100
102
|
*/
|
|
101
103
|
async _loadValidationProof() {
|
|
102
104
|
const proofPath = path.join(process.cwd(), '.validation-proof.json');
|
|
105
|
+
const debugLogPath = path.join(process.cwd(), '.validation-debug.log');
|
|
106
|
+
|
|
107
|
+
// Write to file for debugging (append mode)
|
|
108
|
+
const log = (msg) => {
|
|
109
|
+
const timestamp = new Date().toISOString();
|
|
110
|
+
const logLine = `${timestamp} [${this.serviceName}] ${msg}\n`;
|
|
111
|
+
fs.appendFileSync(debugLogPath, logLine);
|
|
112
|
+
console.log(`[RegistryClient] ${msg}`);
|
|
113
|
+
};
|
|
103
114
|
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
115
|
+
log('=== _loadValidationProof() CALLED ===');
|
|
116
|
+
log(`CWD: ${process.cwd()}`);
|
|
117
|
+
log(`Proof path: ${proofPath}`);
|
|
107
118
|
|
|
108
119
|
try {
|
|
109
120
|
// Check file existence explicitly
|
|
110
121
|
if (!fs.existsSync(proofPath)) {
|
|
111
|
-
|
|
112
|
-
|
|
122
|
+
log(`⚠️ Validation proof file NOT FOUND`);
|
|
123
|
+
log(`Service will use Tier 2 validation`);
|
|
113
124
|
this.validationProof = null;
|
|
114
125
|
return;
|
|
115
126
|
}
|
|
116
127
|
|
|
117
|
-
|
|
128
|
+
log(`✓ Proof file exists, reading...`);
|
|
118
129
|
|
|
119
130
|
// Read and parse file
|
|
120
131
|
const fileContent = fs.readFileSync(proofPath, 'utf8');
|
|
121
|
-
|
|
132
|
+
log(`✓ File read, size: ${fileContent.length} bytes`);
|
|
122
133
|
|
|
123
134
|
const proofData = JSON.parse(fileContent);
|
|
124
|
-
|
|
135
|
+
log(`✓ JSON parsed successfully`);
|
|
125
136
|
|
|
126
137
|
// Validate structure
|
|
127
138
|
if (!proofData.validationProof) {
|
|
128
|
-
|
|
129
|
-
|
|
139
|
+
log(`❌ ERROR: Missing 'validationProof' field`);
|
|
140
|
+
log(`Available fields: ${Object.keys(proofData).join(', ')}`);
|
|
130
141
|
this.validationProof = null;
|
|
131
142
|
return;
|
|
132
143
|
}
|
|
133
144
|
|
|
134
145
|
if (!proofData.validationData) {
|
|
135
|
-
|
|
136
|
-
|
|
146
|
+
log(`❌ ERROR: Missing 'validationData' field`);
|
|
147
|
+
log(`Available fields: ${Object.keys(proofData).join(', ')}`);
|
|
137
148
|
this.validationProof = null;
|
|
138
149
|
return;
|
|
139
150
|
}
|
|
@@ -144,19 +155,19 @@ class ServiceRegistryClient extends EventEmitter {
|
|
|
144
155
|
data: proofData.validationData
|
|
145
156
|
};
|
|
146
157
|
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
158
|
+
log(`✅ SUCCESS - Validation proof loaded`);
|
|
159
|
+
log(` Proof hash: ${this.validationProof.hash.substring(0, 32)}...`);
|
|
160
|
+
log(` Validator: ${this.validationProof.data.validator}`);
|
|
161
|
+
log(` Tests passed: ${this.validationProof.data.testsPassed}/${this.validationProof.data.testsRun}`);
|
|
162
|
+
log(` Validated at: ${this.validationProof.data.validatedAt}`);
|
|
152
163
|
|
|
153
164
|
} catch (error) {
|
|
154
165
|
// Non-critical error - service can still register without proof (will trigger Tier 2 validation)
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
166
|
+
log(`❌ EXCEPTION while loading validation proof`);
|
|
167
|
+
log(` Error: ${error.message}`);
|
|
168
|
+
log(` Stack: ${error.stack}`);
|
|
169
|
+
log(` Path attempted: ${proofPath}`);
|
|
170
|
+
log(`Service will use Tier 2 validation`);
|
|
160
171
|
this.validationProof = null;
|
|
161
172
|
}
|
|
162
173
|
}
|