@olane/o-core 0.2.2 → 0.3.1
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/core/core.node.d.ts +1 -0
- package/dist/core/core.node.d.ts.map +1 -1
- package/dist/core/core.node.js +31 -5
- package/dist/core/utils/core.utils.d.ts +8 -0
- package/dist/core/utils/core.utils.d.ts.map +1 -1
- package/dist/core/utils/core.utils.js +15 -2
- package/dist/index.d.ts +1 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -2
- package/dist/node/node.d.ts.map +1 -1
- package/dist/node/node.js +1 -0
- package/package.json +4 -4
- package/dist/node-host/host.node.d.ts +0 -12
- package/dist/node-host/host.node.d.ts.map +0 -1
- package/dist/node-host/host.node.js +0 -22
- package/dist/node-host/index.d.ts +0 -2
- package/dist/node-host/index.d.ts.map +0 -1
- package/dist/node-host/index.js +0 -1
package/dist/core/core.node.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"core.node.d.ts","sourceRoot":"","sources":["../../src/core/core.node.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,MAAM,EACN,YAAY,EACZ,SAAS,EAET,MAAM,EACP,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,UAAU,EAAE,MAAM,uCAAuC,CAAC;AACnE,OAAO,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAC;AACvD,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC1C,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAC3C,OAAO,EAAE,QAAQ,EAAE,MAAM,gCAAgC,CAAC;AAC1D,OAAO,EAAE,kBAAkB,EAAE,MAAM,+BAA+B,CAAC;AACnE,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAChD,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACpD,OAAO,EAAE,OAAO,EAAE,MAAM,mBAA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lC,kBAAkB;IA6BlB,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC;IAkB3B,QAAQ,IAAI,OAAO,CAAC,IAAI,CAAC;IA8BzB,OAAO,CACX,cAAc,EAAE,QAAQ,EACxB,aAAa,EAAE,QAAQ,GACtB,OAAO,CAAC,WAAW,CAAC;IA2BV,QAAQ,IAAI,OAAO,CAAC,IAAI,CAAC;IAWtC;;;OAGG;IACU,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IAuBnC;;OAEG;IACU,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;CAanC"}
|
package/dist/core/core.node.js
CHANGED
|
@@ -114,6 +114,16 @@ export class oCoreNode {
|
|
|
114
114
|
return result;
|
|
115
115
|
}
|
|
116
116
|
async translateAddress(addressWithLeaderTransports) {
|
|
117
|
+
// determine if this is external
|
|
118
|
+
const isInternal = this.isInternalAddress(addressWithLeaderTransports);
|
|
119
|
+
if (!isInternal) {
|
|
120
|
+
// external address, so we need to route
|
|
121
|
+
this.logger.debug('Address is external, routing...', addressWithLeaderTransports);
|
|
122
|
+
return {
|
|
123
|
+
nextHopAddress: new oAddress('o://leader', addressWithLeaderTransports.libp2pTransports),
|
|
124
|
+
targetAddress: addressWithLeaderTransports,
|
|
125
|
+
};
|
|
126
|
+
}
|
|
117
127
|
let targetAddress = addressWithLeaderTransports;
|
|
118
128
|
let nextHopAddress = addressWithLeaderTransports;
|
|
119
129
|
// handle static address translation for search based upon base functionality
|
|
@@ -126,6 +136,22 @@ export class oCoreNode {
|
|
|
126
136
|
targetAddress: targetAddress,
|
|
127
137
|
};
|
|
128
138
|
}
|
|
139
|
+
isInternalAddress(addressWithLeaderTransports) {
|
|
140
|
+
if (addressWithLeaderTransports.libp2pTransports?.length > 0) {
|
|
141
|
+
// transports are provided, let's see if they match our known leaders
|
|
142
|
+
const leaderTransports = this.type === NodeType.LEADER
|
|
143
|
+
? this.address.libp2pTransports
|
|
144
|
+
: this.config.leader?.libp2pTransports;
|
|
145
|
+
this.logger.debug('Leader transports: ', leaderTransports);
|
|
146
|
+
if (leaderTransports && leaderTransports.length > 0) {
|
|
147
|
+
this.logger.debug('Address transports: ', addressWithLeaderTransports.libp2pTransports);
|
|
148
|
+
// compare against our known leaders
|
|
149
|
+
const isInternal = leaderTransports.some((t) => addressWithLeaderTransports.libp2pTransports.includes(t));
|
|
150
|
+
return isInternal;
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
return true;
|
|
154
|
+
}
|
|
129
155
|
/**
|
|
130
156
|
* Use a tool explicitly
|
|
131
157
|
* @param addressWithLeaderTransports
|
|
@@ -135,7 +161,7 @@ export class oCoreNode {
|
|
|
135
161
|
*/
|
|
136
162
|
async use(addressWithLeaderTransports, data) {
|
|
137
163
|
const { nextHopAddress, targetAddress } = await this.translateAddress(addressWithLeaderTransports);
|
|
138
|
-
this.logger.debug('Using address: ', targetAddress.toString());
|
|
164
|
+
this.logger.debug('Using address, target: ', targetAddress.toString(), 'nextHop: ', nextHopAddress.toString());
|
|
139
165
|
const connection = await this.connect(nextHopAddress, targetAddress);
|
|
140
166
|
// communicate the payload to the target node
|
|
141
167
|
const response = await connection.send({
|
|
@@ -153,28 +179,28 @@ export class oCoreNode {
|
|
|
153
179
|
this.logger.debug('Advertising to network our static and absolute addresses...');
|
|
154
180
|
// advertise the absolute address to the network with timeout
|
|
155
181
|
const absoluteAddressCid = await this.address.toCID();
|
|
156
|
-
this.logger.debug('Advertising absolute address: ', absoluteAddressCid);
|
|
157
182
|
try {
|
|
158
183
|
// Add timeout to prevent hanging
|
|
159
184
|
await this.advertiseValueToNetwork(absoluteAddressCid);
|
|
160
|
-
this.logger.debug('Successfully advertised absolute address');
|
|
161
185
|
}
|
|
162
186
|
catch (error) {
|
|
163
187
|
this.logger.warn('Failed to advertise absolute address (this is normal for isolated nodes):', error.message);
|
|
164
188
|
}
|
|
165
189
|
// advertise the static address to the network with timeout
|
|
166
190
|
const staticAddressCid = await this.staticAddress.toCID();
|
|
167
|
-
this.logger.debug('Advertising static address: ', staticAddressCid);
|
|
168
191
|
try {
|
|
169
192
|
// Add timeout to prevent hanging
|
|
170
193
|
await this.advertiseValueToNetwork(staticAddressCid);
|
|
171
|
-
this.logger.debug('Successfully advertised static address');
|
|
172
194
|
}
|
|
173
195
|
catch (error) {
|
|
174
196
|
this.logger.warn('Failed to advertise static address (this is normal for isolated nodes):', error.message);
|
|
175
197
|
}
|
|
176
198
|
}
|
|
177
199
|
async unregister() {
|
|
200
|
+
if (this.type === NodeType.LEADER) {
|
|
201
|
+
this.logger.debug('Skipping unregistration, node is leader');
|
|
202
|
+
return;
|
|
203
|
+
}
|
|
178
204
|
const address = new oAddress('o://register');
|
|
179
205
|
// attempt to unregister from the network
|
|
180
206
|
const params = {
|
|
@@ -6,6 +6,14 @@ import { CID } from 'multiformats';
|
|
|
6
6
|
export declare class CoreUtils {
|
|
7
7
|
static generatePeerId(): Promise<any>;
|
|
8
8
|
static generatePrivateKey(seed: string): Promise<any>;
|
|
9
|
+
/**
|
|
10
|
+
* Convert any user phrase to exactly 32 bytes for Ed25519 key generation.
|
|
11
|
+
* This function uses SHA-256 hashing to ensure:
|
|
12
|
+
* - Deterministic: Same phrase always produces same seed
|
|
13
|
+
* - Uniform distribution: Good entropy even for weak phrases
|
|
14
|
+
* - Exactly 32 bytes: Meets Ed25519 cryptographic requirements
|
|
15
|
+
*/
|
|
16
|
+
static phraseToSeedBytes(phrase: string): Uint8Array;
|
|
9
17
|
static phraseToSeed(phrase: string): string;
|
|
10
18
|
static childAddress(parentAddress: oAddress, childAddress: oAddress): oAddress;
|
|
11
19
|
static sendResponse(response: oResponse, stream: Stream): Promise<void>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"core.utils.d.ts","sourceRoot":"","sources":["../../../src/core/utils/core.utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,MAAM,EAGP,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,C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
|
}
|
|
13
13
|
static async generatePrivateKey(seed) {
|
|
14
|
-
|
|
14
|
+
// Convert any user phrase to exactly 32 bytes using SHA-256
|
|
15
|
+
const seedBytes = CoreUtils.phraseToSeedBytes(seed);
|
|
15
16
|
const privateKey = await generateKeyPairFromSeed('Ed25519', seedBytes);
|
|
16
17
|
return privateKey;
|
|
17
18
|
}
|
|
18
|
-
|
|
19
|
+
/**
|
|
20
|
+
* Convert any user phrase to exactly 32 bytes for Ed25519 key generation.
|
|
21
|
+
* This function uses SHA-256 hashing to ensure:
|
|
22
|
+
* - Deterministic: Same phrase always produces same seed
|
|
23
|
+
* - Uniform distribution: Good entropy even for weak phrases
|
|
24
|
+
* - Exactly 32 bytes: Meets Ed25519 cryptographic requirements
|
|
25
|
+
*/
|
|
26
|
+
static phraseToSeedBytes(phrase) {
|
|
27
|
+
// Use SHA-256 to create a consistent 32-byte hash
|
|
28
|
+
const hash = createHash('sha256').update(phrase, 'utf8').digest();
|
|
29
|
+
return new Uint8Array(hash);
|
|
30
|
+
}
|
|
31
|
+
// Legacy utility function to convert any phrase into a 32-character hex string
|
|
19
32
|
static phraseToSeed(phrase) {
|
|
20
33
|
// Use SHA-256 to create a consistent 32-byte hash
|
|
21
34
|
const hash = createHash('sha256').update(phrase).digest('hex');
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
export * from './core/index.js';
|
|
2
2
|
export * from './node/index.js';
|
|
3
|
-
export * from './node-virtual/index.js';
|
|
4
|
-
export * from './node-host/index.js';
|
|
5
3
|
export * from './error/index.js';
|
|
6
4
|
export * from './plan/index.js';
|
|
5
|
+
export * from './node-virtual/index.js';
|
|
7
6
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC;AAChC,cAAc,iBAAiB,CAAC;AAChC,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC;AAChC,cAAc,iBAAiB,CAAC;AAChC,cAAc,kBAAkB,CAAC;AACjC,cAAc,iBAAiB,CAAC;AAChC,cAAc,yBAAyB,CAAC"}
|
package/dist/index.js
CHANGED
package/dist/node/node.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"node.d.ts","sourceRoot":"","sources":["../../src/node/node.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,YAAY,EAKZ,MAAM,EACP,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAIL,QAAQ,EAER,SAAS,EACT,QAAQ,EACR,SAAS,EACV,MAAM,kBAAkB,CAAC;AAG1B,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAKhE,OAAO,EAAE,WAAW,EAAE,MAAM,mCAAmC,CAAC;AAMhE,8BAAsB,KAAM,SAAQ,SAAS;IACpC,eAAe,EAAG,eAAe,CAAC;IAClC,UAAU,EAAE,KAAK,EAAE,CAAM;IACzB,cAAc,EAAE,QAAQ,EAAE,CAAM;IAEvC,QAAQ,IAAI,IAAI;IAMV,eAAe,CAAC,SAAS,EAAE,QAAQ,GAAG,OAAO,CAAC,WAAW,CAAC;IAyBhE,QAAQ,CAAC,mBAAmB,IAAI,GAAG,EAAE;IAErC,OAAO,IAAI,MAAM,EAAE;IAMb,qBAAqB,CACzB,OAAO,EAAE,QAAQ,EACjB,OAAO,EAAE,QAAQ,GAChB,OAAO,CAAC,SAAS,CAAC;IAOrB,mBAAmB,CAAC,OAAO,EAAE,QAAQ,GAAG,OAAO;IAQ/C,aAAa,CAAC,OAAO,EAAE,QAAQ,GAAG,MAAM;IAIlC,WAAW,CAAC,OAAO,EAAE,QAAQ,GAAG;QAAE,MAAM,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,GA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AAO,EAAE,QAAQ,GAChB,OAAO,CAAC,SAAS,CAAC;IAOrB,mBAAmB,CAAC,OAAO,EAAE,QAAQ,GAAG,OAAO;IAQ/C,aAAa,CAAC,OAAO,EAAE,QAAQ,GAAG,MAAM;IAIlC,WAAW,CAAC,OAAO,EAAE,QAAQ,GAAG;QAAE,MAAM,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,GAAG,CAAC;IAgEvE;;;;OAIG;IACG,YAAY,CAAC,OAAO,EAAE,QAAQ,GAAG,OAAO,CAAC,GAAG,CAAC;IA2B7C,oBAAoB,CAAC,OAAO,EAAE,QAAQ,GAAG,OAAO,CAAC,GAAG,CAAC;IASrD,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IAOtB,aAAa,IAAI,OAAO,CAAC,IAAI,CAAC;IA2C9B,mBAAmB,CAAC,OAAO,EAAE,QAAQ,GAAG,OAAO,CAAC,GAAG,CAAC;IAIpD,eAAe,CAAC,OAAO,EAAE,QAAQ,GAAG,OAAO,CAAC,GAAG,CAAC;IAYtD,YAAY,CAAC,IAAI,EAAE,KAAK,GAAG,IAAI;IAK/B,eAAe,CAAC,IAAI,EAAE,KAAK,GAAG,IAAI;IAIlC;;;OAGG;IACG,SAAS,IAAI,OAAO,CAAC,YAAY,CAAC;IA4ElC,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC;IAyBjC,sBAAsB;IAIhB,QAAQ,IAAI,OAAO,CAAC,IAAI,CAAC;CAOhC"}
|
package/dist/node/node.js
CHANGED
|
@@ -214,6 +214,7 @@ export class oNode extends oCoreNode {
|
|
|
214
214
|
};
|
|
215
215
|
// if the seed is provided, use it to generate the private key
|
|
216
216
|
if (this.config.seed) {
|
|
217
|
+
this.logger.debug('Seed provided, generating private key...');
|
|
217
218
|
const privateKey = await CoreUtils.generatePrivateKey(this.config.seed);
|
|
218
219
|
params.privateKey = privateKey;
|
|
219
220
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@olane/o-core",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
},
|
|
27
27
|
"repository": {
|
|
28
28
|
"type": "git",
|
|
29
|
-
"url": "git+https://github.com/olane-labs/
|
|
29
|
+
"url": "git+https://github.com/olane-labs/olane.git"
|
|
30
30
|
},
|
|
31
31
|
"author": "Olane Inc.",
|
|
32
32
|
"license": "ISC",
|
|
@@ -54,8 +54,8 @@
|
|
|
54
54
|
"typescript": "^5.8.3"
|
|
55
55
|
},
|
|
56
56
|
"peerDependencies": {
|
|
57
|
-
"@olane/o-config": "^0.
|
|
58
|
-
"@olane/o-protocol": "^0.
|
|
57
|
+
"@olane/o-config": "^0.3.1",
|
|
58
|
+
"@olane/o-protocol": "^0.3.1"
|
|
59
59
|
},
|
|
60
60
|
"dependencies": {
|
|
61
61
|
"chalk": "^5.4.1",
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { oNode } from '../node/node.js';
|
|
2
|
-
/**
|
|
3
|
-
* A standalone node that can be used to host other nodes.
|
|
4
|
-
* Can be useful for separating various buckets of functionality.
|
|
5
|
-
* Think about microservice best practices.
|
|
6
|
-
* These nodes are addressable via TCP/IP.
|
|
7
|
-
*/
|
|
8
|
-
export declare class oHostNode extends oNode {
|
|
9
|
-
initialize(): Promise<void>;
|
|
10
|
-
configureTransports(): any[];
|
|
11
|
-
}
|
|
12
|
-
//# sourceMappingURL=host.node.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"host.node.d.ts","sourceRoot":"","sources":["../../src/node-host/host.node.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AAExC;;;;;GAKG;AACH,qBAAa,SAAU,SAAQ,KAAK;IAC5B,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC;IAKjC,mBAAmB,IAAI,GAAG,EAAE;CAQ7B"}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { defaultLibp2pConfig, memory } from '@olane/o-config';
|
|
2
|
-
import { oNode } from '../node/node.js';
|
|
3
|
-
/**
|
|
4
|
-
* A standalone node that can be used to host other nodes.
|
|
5
|
-
* Can be useful for separating various buckets of functionality.
|
|
6
|
-
* Think about microservice best practices.
|
|
7
|
-
* These nodes are addressable via TCP/IP.
|
|
8
|
-
*/
|
|
9
|
-
export class oHostNode extends oNode {
|
|
10
|
-
async initialize() {
|
|
11
|
-
// start the current node
|
|
12
|
-
await super.initialize();
|
|
13
|
-
}
|
|
14
|
-
configureTransports() {
|
|
15
|
-
return [
|
|
16
|
-
memory(),
|
|
17
|
-
...(this.config.network?.transports ||
|
|
18
|
-
defaultLibp2pConfig.transports ||
|
|
19
|
-
[]),
|
|
20
|
-
];
|
|
21
|
-
}
|
|
22
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/node-host/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC"}
|
package/dist/node-host/index.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './host.node.js';
|