@olane/o-node 0.8.10 → 0.8.12
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.
|
@@ -46,10 +46,10 @@ export class oNodeConnection extends oConnection {
|
|
|
46
46
|
}
|
|
47
47
|
async newStream(config) {
|
|
48
48
|
const protocol = config.remoteAddress.protocol;
|
|
49
|
-
this.logger.debug('Creating new stream', {
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
});
|
|
49
|
+
// this.logger.debug('Creating new stream', {
|
|
50
|
+
// protocol,
|
|
51
|
+
// currentStreamCount: this.streams.size,
|
|
52
|
+
// });
|
|
53
53
|
// Create stream from libp2p connection
|
|
54
54
|
const stream = await this.p2pConnection.newStream(protocol, {
|
|
55
55
|
signal: config.abortSignal,
|
|
@@ -58,11 +58,11 @@ export class oNodeConnection extends oConnection {
|
|
|
58
58
|
});
|
|
59
59
|
// Wrap in oNodeStream with metadata
|
|
60
60
|
const wrappedStream = new oNodeStream(stream, config);
|
|
61
|
-
this.logger.debug('Stream created', {
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
});
|
|
61
|
+
// this.logger.debug('Stream created', {
|
|
62
|
+
// streamId: stream.id,
|
|
63
|
+
// protocol,
|
|
64
|
+
// totalStreams: this.streams.size,
|
|
65
|
+
// });
|
|
66
66
|
return wrappedStream;
|
|
67
67
|
}
|
|
68
68
|
// bubble up the messages to the request handler
|
|
@@ -87,7 +87,7 @@ export class oNodeConnection extends oConnection {
|
|
|
87
87
|
}
|
|
88
88
|
trackStream(stream, options) {
|
|
89
89
|
this.streams.set(stream.id, stream);
|
|
90
|
-
this.logger.debug('Stream count: ' + this.streams.size);
|
|
90
|
+
// this.logger.debug('Stream count: ' + this.streams.size);
|
|
91
91
|
// persistent listener
|
|
92
92
|
this.listenForMessages(stream, options);
|
|
93
93
|
}
|
|
@@ -110,7 +110,10 @@ export class oNodeConnection extends oConnection {
|
|
|
110
110
|
}
|
|
111
111
|
async transmit(request, options) {
|
|
112
112
|
try {
|
|
113
|
-
this.logger.debug(
|
|
113
|
+
// this.logger.debug(
|
|
114
|
+
// 'Transmitting request on limited connection?',
|
|
115
|
+
// this.config.runOnLimitedConnection,
|
|
116
|
+
// );
|
|
114
117
|
const stream = await this.doSend(request, options);
|
|
115
118
|
// Handle cleanup of the stream
|
|
116
119
|
await this.postTransmit(stream);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"o-node-stream.d.ts","sourceRoot":"","sources":["../../../src/connection/o-node-stream.ts"],"names":[],"mappings":";AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAGL,OAAO,EACP,QAAQ,EACR,SAAS,EACV,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,iBAAiB,EAAE,MAAM,sCAAsC,CAAC;AACzE,OAAO,EAAE,oBAAoB,EAAY,MAAM,iBAAiB,CAAC;AACjE,OAAO,EAAE,iBAAiB,EAAE,MAAM,qCAAqC,CAAC;AAExE,OAAO,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAC;AACtC,OAAO,EACL,iBAAiB,EACjB,qBAAqB,EACtB,MAAM,iCAAiC,CAAC;AAGzC;;GAEG;AACH,qBAAa,WAAY,SAAQ,OAAO;aAMpB,SAAS,EAAE,MAAM;aACjB,MAAM,EAAE,iBAAiB;IAN3C,SAAgB,SAAS,EAAE,MAAM,CAAC;IAClC,SAAS,CAAC,QAAQ,CAAC,EAAE,EAAE,oBAAoB,CAAC;IAC5C,SAAS,CAAC,QAAQ,CAAC,YAAY,EAAE,YAAY,CAAsB;gBAGjD,SAAS,EAAE,MAAM,EACjB,MAAM,EAAE,iBAAiB;IAU3C,qBAAqB;IAarB,QAAQ;IA6BR;;;;;;;;;;;OAWG;IACH,SAAS,CAAC,mBAAmB,CAAC,OAAO,EAAE,MAAM,GAAG,GAAG,GAAG,GAAG;IAqCnD,IAAI,CAAC,OAAO,EAAE,QAAQ,EA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AU,CAAC,OAAO,EAAE,iBAAiB;IAgCrC,eAAe,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,SAAS,CAAC;IAiB5D;;;OAGG;IACH,SAAS,CAAC,OAAO,EAAE,GAAG,GAAG,OAAO;IAQhC;;OAEG;IACH,UAAU,CAAC,OAAO,EAAE,GAAG,GAAG,OAAO;IAIjC;;;;;;;OAOG;IACH,IAAI,OAAO,IAAI,OAAO,CAMrB;IAED;;OAEG;IACH,IAAI,GAAG,IAAI,MAAM,CAEhB;IAEK,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IAY5B,IAAI,EAAE,IAAI,MAAM,CAEf;IAED;;OAEG;IACH,EAAE,CAAC,CAAC,SAAS,iBAAiB,EAC5B,KAAK,EAAE,CAAC,EACR,QAAQ,EAAE,CAAC,IAAI,EAAE,qBAAqB,CAAC,CAAC,CAAC,KAAK,IAAI,GACjD,IAAI;IAIP;;OAEG;IACH,GAAG,CAAC,CAAC,SAAS,iBAAiB,EAC7B,KAAK,EAAE,CAAC,EACR,QAAQ,EAAE,CAAC,IAAI,EAAE,qBAAqB,CAAC,CAAC,CAAC,KAAK,IAAI,GACjD,IAAI;IAIP;;OAEG;IACH,OAAO,CAAC,IAAI;CAMb"}
|
|
@@ -118,7 +118,11 @@ export class oNodeStream extends oObject {
|
|
|
118
118
|
messageBytes = await this.lp.read({ signal: options?.abortSignal });
|
|
119
119
|
}
|
|
120
120
|
catch (error) {
|
|
121
|
-
this.logger.warn('Error reading from stream:', error?.message);
|
|
121
|
+
// TODO: investigate why this always returns this.logger.warn('Error reading from stream:', error?.message);
|
|
122
|
+
/*
|
|
123
|
+
Error reading from stream: Stream closed
|
|
124
|
+
Error reading from stream: The stream has been reset
|
|
125
|
+
*/
|
|
122
126
|
await this.close();
|
|
123
127
|
return;
|
|
124
128
|
}
|
|
@@ -147,7 +151,9 @@ export class oNodeStream extends oObject {
|
|
|
147
151
|
// TODO: create unit tests around no "_last" scenario
|
|
148
152
|
if (data.id === requestId && data.result?._last === true) {
|
|
149
153
|
this.off(oNodeMessageEvent.response, handler);
|
|
150
|
-
this.logger.debug(
|
|
154
|
+
// this.logger.debug(
|
|
155
|
+
// 'Stream stopped listening for responses due to "waitForResponse", technically should continue if listen was called elsewhere',
|
|
156
|
+
// );
|
|
151
157
|
resolve(data);
|
|
152
158
|
}
|
|
153
159
|
};
|
|
@@ -130,7 +130,9 @@ export class oNodeRequestManager extends oRequestManager {
|
|
|
130
130
|
// Emit InboundRequest event and wait for handler to process
|
|
131
131
|
const response = await responseBuilder.build(request, result, null);
|
|
132
132
|
await CoreUtils.sendResponse(response, request.stream);
|
|
133
|
-
this.logger.debug(
|
|
133
|
+
// this.logger.debug(
|
|
134
|
+
// `Successfully processed request: method=${request.method}, id=${request.id}`,
|
|
135
|
+
// );
|
|
134
136
|
}
|
|
135
137
|
catch (error) {
|
|
136
138
|
this.logger.error(`Error processing request: method=${request.method}, id=${request.id}`, error);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@olane/o-node",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.12",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "dist/src/index.js",
|
|
6
6
|
"types": "dist/src/index.d.ts",
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
"devDependencies": {
|
|
41
41
|
"@eslint/eslintrc": "^3.3.1",
|
|
42
42
|
"@eslint/js": "^9.29.0",
|
|
43
|
-
"@olane/o-test": "0.8.
|
|
43
|
+
"@olane/o-test": "0.8.12",
|
|
44
44
|
"@tsconfig/node20": "^20.1.6",
|
|
45
45
|
"@types/jest": "^30.0.0",
|
|
46
46
|
"@types/json5": "^2.2.0",
|
|
@@ -60,13 +60,13 @@
|
|
|
60
60
|
"typescript": "5.4.5"
|
|
61
61
|
},
|
|
62
62
|
"dependencies": {
|
|
63
|
-
"@olane/o-config": "0.8.
|
|
64
|
-
"@olane/o-core": "0.8.
|
|
65
|
-
"@olane/o-protocol": "0.8.
|
|
66
|
-
"@olane/o-tool": "0.8.
|
|
63
|
+
"@olane/o-config": "0.8.12",
|
|
64
|
+
"@olane/o-core": "0.8.12",
|
|
65
|
+
"@olane/o-protocol": "0.8.12",
|
|
66
|
+
"@olane/o-tool": "0.8.12",
|
|
67
67
|
"debug": "^4.4.1",
|
|
68
68
|
"dotenv": "^16.5.0",
|
|
69
69
|
"json5": "^2.2.3"
|
|
70
70
|
},
|
|
71
|
-
"gitHead": "
|
|
71
|
+
"gitHead": "97a0630c05c48f4eddee4c9149f0d7d0e23196da"
|
|
72
72
|
}
|