@olane/o-node 0.7.12-alpha.27 → 0.7.12-alpha.28
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/dist/src/interfaces/o-node.config.d.ts +0 -17
- package/dist/src/interfaces/o-node.config.d.ts.map +1 -1
- package/dist/src/o-node.d.ts +1 -10
- package/dist/src/o-node.d.ts.map +1 -1
- package/dist/src/o-node.js +14 -22
- package/dist/src/utils/index.d.ts +0 -2
- package/dist/src/utils/index.d.ts.map +1 -1
- package/dist/src/utils/index.js +0 -2
- package/package.json +6 -6
|
@@ -29,23 +29,6 @@ export interface oNodeConfig extends oCoreConfig {
|
|
|
29
29
|
parentDiscoveryIntervalMs?: number;
|
|
30
30
|
parentDiscoveryMaxDelayMs?: number;
|
|
31
31
|
};
|
|
32
|
-
/**
|
|
33
|
-
* Leader request retry configuration
|
|
34
|
-
* Handles temporary leader unavailability (healing, maintenance)
|
|
35
|
-
*/
|
|
36
|
-
leaderRetry?: {
|
|
37
|
-
enabled?: boolean;
|
|
38
|
-
maxAttempts?: number;
|
|
39
|
-
baseDelayMs?: number;
|
|
40
|
-
maxDelayMs?: number;
|
|
41
|
-
timeoutMs?: number;
|
|
42
|
-
circuitBreaker?: {
|
|
43
|
-
enabled?: boolean;
|
|
44
|
-
failureThreshold?: number;
|
|
45
|
-
openTimeoutMs?: number;
|
|
46
|
-
halfOpenMaxAttempts?: number;
|
|
47
|
-
};
|
|
48
|
-
};
|
|
49
32
|
/**
|
|
50
33
|
* Connection timeout configuration
|
|
51
34
|
* Controls timeouts for stream read and drain operations in connections
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"o-node.config.d.ts","sourceRoot":"","sources":["../../../src/interfaces/o-node.config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAE3D,MAAM,WAAW,WAAY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AAM,CAAC;QAC1B,aAAa,CAAC,EAAE,OAAO,CAAC;QACxB,WAAW,CAAC,EAAE,OAAO,CAAC;QACtB,WAAW,CAAC,EAAE,OAAO,CAAC;KACvB,CAAC;IAEF;;;OAGG;IACH,YAAY,CAAC,EAAE;QACb,OAAO,CAAC,EAAE,OAAO,CAAC;QAClB,WAAW,CAAC,EAAE,MAAM,CAAC;QACrB,WAAW,CAAC,EAAE,MAAM,CAAC;QACrB,UAAU,CAAC,EAAE,MAAM,CAAC;QACpB,iBAAiB,CAAC,EAAE,OAAO,CAAC;QAC5B,yBAAyB,CAAC,EAAE,MAAM,CAAC;QACnC,yBAAyB,CAAC,EAAE,MAAM,CAAC;KACpC,CAAC;IAEF;;;OAGG;IACH,kBAAkB,CAAC,EAAE;QACnB;;;WAGG;QACH,aAAa,CAAC,EAAE,MAAM,CAAC;QACvB;;;WAGG;QACH,cAAc,CAAC,EAAE,MAAM,CAAC;KACzB,CAAC;CACH"}
|
package/dist/src/o-node.d.ts
CHANGED
|
@@ -3,14 +3,13 @@ import { PeerId } from '@olane/o-config';
|
|
|
3
3
|
import { oNodeHierarchyManager } from './o-node.hierarchy-manager.js';
|
|
4
4
|
import { oNodeConfig } from './interfaces/o-node.config.js';
|
|
5
5
|
import { oNodeTransport } from './router/o-node.transport.js';
|
|
6
|
-
import {
|
|
6
|
+
import { oRequest, oNotificationManager } from '@olane/o-core';
|
|
7
7
|
import { oNodeAddress } from './router/o-node.address.js';
|
|
8
8
|
import { oNodeConnection } from './connection/o-node-connection.js';
|
|
9
9
|
import { oNodeConnectionManager } from './connection/o-node-connection.manager.js';
|
|
10
10
|
import { oToolBase } from '@olane/o-tool';
|
|
11
11
|
import { oConnectionHeartbeatManager } from './managers/o-connection-heartbeat.manager.js';
|
|
12
12
|
import { oReconnectionManager } from './managers/o-reconnection.manager.js';
|
|
13
|
-
import { LeaderRequestWrapper } from './utils/leader-request-wrapper.js';
|
|
14
13
|
import { oNodeConnectionConfig } from './connection/index.js';
|
|
15
14
|
export declare class oNode extends oToolBase {
|
|
16
15
|
peerId: PeerId;
|
|
@@ -21,7 +20,6 @@ export declare class oNode extends oToolBase {
|
|
|
21
20
|
hierarchyManager: oNodeHierarchyManager;
|
|
22
21
|
connectionHeartbeatManager?: oConnectionHeartbeatManager;
|
|
23
22
|
reconnectionManager?: oReconnectionManager;
|
|
24
|
-
leaderRequestWrapper: LeaderRequestWrapper;
|
|
25
23
|
protected didRegister: boolean;
|
|
26
24
|
constructor(config: oNodeConfig);
|
|
27
25
|
get leader(): oNodeAddress | null;
|
|
@@ -55,13 +53,6 @@ export declare class oNode extends oToolBase {
|
|
|
55
53
|
/**
|
|
56
54
|
* Override use() to wrap leader/registry requests with retry logic
|
|
57
55
|
*/
|
|
58
|
-
use(address: oAddress, data?: {
|
|
59
|
-
method?: string;
|
|
60
|
-
params?: {
|
|
61
|
-
[key: string]: any;
|
|
62
|
-
};
|
|
63
|
-
id?: string;
|
|
64
|
-
}, options?: UseOptions): Promise<any>;
|
|
65
56
|
teardown(): Promise<void>;
|
|
66
57
|
getLeaders(): oNodeAddress[];
|
|
67
58
|
getParents(): oNodeAddress[];
|
package/dist/src/o-node.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"o-node.d.ts","sourceRoot":"","sources":["../../src/o-node.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,MAAM,EACN,YAAY,EACb,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AAEzC,OAAO,EAAE,qBAAqB,EAAE,MAAM,+BAA+B,CAAC;AACtE,OAAO,EAAE,WAAW,EAAE,MAAM,+BAA+B,CAAC;AAC5D,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAC9D,OAAO,
|
|
1
|
+
{"version":3,"file":"o-node.d.ts","sourceRoot":"","sources":["../../src/o-node.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,MAAM,EACN,YAA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
import { oNodeNotificationManager } from './o-node.notification-manager.js';
|
|
13
13
|
import { oConnectionHeartbeatManager } from './managers/o-connection-heartbeat.manager.js';
|
|
14
14
|
import { oReconnectionManager } from './managers/o-reconnection.manager.js';
|
|
15
|
-
import { LeaderRequestWrapper } from './utils/leader-request-wrapper.js';
|
|
16
15
|
export class oNode extends oToolBase {
|
|
17
16
|
constructor(config) {
|
|
18
17
|
super(config);
|
|
@@ -352,23 +351,6 @@ export class oNode extends oToolBase {
|
|
|
352
351
|
this.peerId = this.p2pNode.peerId;
|
|
353
352
|
// initialize connection manager
|
|
354
353
|
await this.initConnectionManager();
|
|
355
|
-
// Initialize leader request wrapper with circuit breaker
|
|
356
|
-
this.leaderRequestWrapper = new LeaderRequestWrapper({
|
|
357
|
-
enabled: this.config.leaderRetry?.enabled ?? true,
|
|
358
|
-
maxAttempts: this.config.leaderRetry?.maxAttempts ?? 20,
|
|
359
|
-
baseDelayMs: this.config.leaderRetry?.baseDelayMs ?? 2000,
|
|
360
|
-
maxDelayMs: this.config.leaderRetry?.maxDelayMs ?? 30000,
|
|
361
|
-
timeoutMs: this.config.leaderRetry?.timeoutMs ?? 120000,
|
|
362
|
-
circuitBreaker: {
|
|
363
|
-
enabled: this.config.leaderRetry?.circuitBreaker?.enabled ?? true,
|
|
364
|
-
failureThreshold: this.config.leaderRetry?.circuitBreaker?.failureThreshold ?? 3,
|
|
365
|
-
openTimeoutMs: this.config.leaderRetry?.circuitBreaker?.openTimeoutMs ?? 30000,
|
|
366
|
-
halfOpenMaxAttempts: this.config.leaderRetry?.circuitBreaker?.halfOpenMaxAttempts ?? 1,
|
|
367
|
-
},
|
|
368
|
-
});
|
|
369
|
-
this.logger.info(`Leader retry config: enabled=${this.leaderRequestWrapper.getConfig().enabled}, ` +
|
|
370
|
-
`maxAttempts=${this.leaderRequestWrapper.getConfig().maxAttempts}, ` +
|
|
371
|
-
`circuitBreaker.enabled=${this.leaderRequestWrapper.getConfig().circuitBreaker?.enabled}`);
|
|
372
354
|
// initialize address resolution
|
|
373
355
|
this.router.addResolver(new oMethodResolver(this.address));
|
|
374
356
|
this.router.addResolver(new oNodeResolver(this.address));
|
|
@@ -384,10 +366,20 @@ export class oNode extends oToolBase {
|
|
|
384
366
|
/**
|
|
385
367
|
* Override use() to wrap leader/registry requests with retry logic
|
|
386
368
|
*/
|
|
387
|
-
async use(
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
369
|
+
// async use(
|
|
370
|
+
// address: oAddress,
|
|
371
|
+
// data?: {
|
|
372
|
+
// method?: string;
|
|
373
|
+
// params?: { [key: string]: any };
|
|
374
|
+
// id?: string;
|
|
375
|
+
// },
|
|
376
|
+
// options?: UseOptions,
|
|
377
|
+
// ): Promise<any> {
|
|
378
|
+
// // Wrap leader/registry requests with retry logic
|
|
379
|
+
// return super.use(address, data, options),
|
|
380
|
+
// address,
|
|
381
|
+
// data?.method,
|
|
382
|
+
// }
|
|
391
383
|
async teardown() {
|
|
392
384
|
// Stop heartbeat before parent teardown
|
|
393
385
|
if (this.connectionHeartbeatManager) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC;AAClC,cAAc,oBAAoB,CAAC
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC;AAClC,cAAc,oBAAoB,CAAC"}
|
package/dist/src/utils/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@olane/o-node",
|
|
3
|
-
"version": "0.7.12-alpha.
|
|
3
|
+
"version": "0.7.12-alpha.28",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "dist/src/index.js",
|
|
6
6
|
"types": "dist/src/index.d.ts",
|
|
@@ -54,12 +54,12 @@
|
|
|
54
54
|
"typescript": "5.4.5"
|
|
55
55
|
},
|
|
56
56
|
"dependencies": {
|
|
57
|
-
"@olane/o-config": "0.7.12-alpha.
|
|
58
|
-
"@olane/o-core": "0.7.12-alpha.
|
|
59
|
-
"@olane/o-protocol": "0.7.12-alpha.
|
|
60
|
-
"@olane/o-tool": "0.7.12-alpha.
|
|
57
|
+
"@olane/o-config": "0.7.12-alpha.28",
|
|
58
|
+
"@olane/o-core": "0.7.12-alpha.28",
|
|
59
|
+
"@olane/o-protocol": "0.7.12-alpha.28",
|
|
60
|
+
"@olane/o-tool": "0.7.12-alpha.28",
|
|
61
61
|
"debug": "^4.4.1",
|
|
62
62
|
"dotenv": "^16.5.0"
|
|
63
63
|
},
|
|
64
|
-
"gitHead": "
|
|
64
|
+
"gitHead": "c860e7e62d84fa4725ef391db409476643679036"
|
|
65
65
|
}
|