@helia/libp2p 1.0.0 → 1.0.1-ef258e7e
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/index.min.js +51 -51
- package/dist/index.min.js.map +4 -4
- package/dist/src/routing.d.ts.map +1 -1
- package/dist/src/routing.js +2 -1
- package/dist/src/routing.js.map +1 -1
- package/package.json +5 -4
- package/src/routing.ts +3 -2
- package/dist/typedoc-urls.json +0 -9
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"routing.d.ts","sourceRoot":"","sources":["../../src/routing.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"routing.d.ts","sourceRoot":"","sources":["../../src/routing.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAkB,MAAM,EAAkB,MAAM,kBAAkB,CAAA;AAC9E,OAAO,KAAK,EAAE,MAAM,EAAY,MAAM,mBAAmB,CAAA;AAsDzD,wBAAgB,aAAa,CAAE,MAAM,EAAE,MAAM,GAAG,MAAM,CAErD"}
|
package/dist/src/routing.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { peerIdFromCID } from '@libp2p/peer-id';
|
|
2
2
|
import map from 'it-map';
|
|
3
|
+
import { withArrayBuffer } from 'uint8arrays/with-array-buffer';
|
|
3
4
|
function peerInfoToPeer(info) {
|
|
4
5
|
return {
|
|
5
6
|
...info,
|
|
@@ -28,7 +29,7 @@ class Libp2pRouter {
|
|
|
28
29
|
await this.libp2p.contentRouting.put(key, value, options);
|
|
29
30
|
}
|
|
30
31
|
async get(key, options) {
|
|
31
|
-
return this.libp2p.contentRouting.get(key, options);
|
|
32
|
+
return withArrayBuffer(await this.libp2p.contentRouting.get(key, options));
|
|
32
33
|
}
|
|
33
34
|
async findPeer(peerId, options) {
|
|
34
35
|
return peerInfoToPeer(await this.libp2p.peerRouting.findPeer(peerIdFromCID(peerId), options));
|
package/dist/src/routing.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"routing.js","sourceRoot":"","sources":["../../src/routing.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAA;AAC/C,OAAO,GAAG,MAAM,QAAQ,CAAA;
|
|
1
|
+
{"version":3,"file":"routing.js","sourceRoot":"","sources":["../../src/routing.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAA;AAC/C,OAAO,GAAG,MAAM,QAAQ,CAAA;AACxB,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAA;AAK/D,SAAS,cAAc,CAAE,IAAc;IACrC,OAAO;QACL,GAAG,IAAI;QACP,EAAE,EAAE,IAAI,CAAC,EAAE,CAAC,KAAK,EAAE;KACpB,CAAA;AACH,CAAC;AAED,MAAM,YAAY;IACA,IAAI,GAAG,eAAe,CAAA;IACrB,MAAM,CAAQ;IAE/B,YAAa,MAAc;QACzB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAA;IACtB,CAAC;IAED,KAAK,CAAC,OAAO,CAAE,GAAQ,EAAE,OAAwB;QAC/C,MAAM,IAAI,CAAC,MAAM,CAAC,cAAc,CAAC,OAAO,CAAC,GAAG,EAAE,OAAO,CAAC,CAAA;IACxD,CAAC;IAED,KAAK,CAAC,eAAe,CAAE,GAAQ,EAAE,OAAwB;QACvD,MAAM,IAAI,CAAC,MAAM,CAAC,cAAc,CAAC,eAAe,CAAC,GAAG,EAAE,OAAO,CAAC,CAAA;IAChE,CAAC;IAED,KAAK,CAAC,CAAE,aAAa,CAAE,GAAQ,EAAE,OAAwB;QACvD,KAAM,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,MAAM,CAAC,cAAc,CAAC,aAAa,CAAC,GAAG,EAAE,OAAO,CAAC,EAAE,IAAI,CAAC,EAAE,CAAC,CAAC;YAC3E,OAAO,EAAE,IAAI,CAAC,IAAI;YAClB,GAAG,cAAc,CAAC,IAAI,CAAC;SACxB,CAAC,CAAC,CAAA;IACL,CAAC;IAED,KAAK,CAAC,GAAG,CAAE,GAAe,EAAE,KAAiB,EAAE,OAAwB;QACrE,MAAM,IAAI,CAAC,MAAM,CAAC,cAAc,CAAC,GAAG,CAAC,GAAG,EAAE,KAAK,EAAE,OAAO,CAAC,CAAA;IAC3D,CAAC;IAED,KAAK,CAAC,GAAG,CAAE,GAAe,EAAE,OAAwB;QAClD,OAAO,eAAe,CAAC,MAAM,IAAI,CAAC,MAAM,CAAC,cAAc,CAAC,GAAG,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC,CAAA;IAC5E,CAAC;IAED,KAAK,CAAC,QAAQ,CAAE,MAAW,EAAE,OAAwB;QACnD,OAAO,cAAc,CAAC,MAAM,IAAI,CAAC,MAAM,CAAC,WAAW,CAAC,QAAQ,CAAC,aAAa,CAAC,MAAM,CAAC,EAAE,OAAO,CAAC,CAAC,CAAA;IAC/F,CAAC;IAED,KAAK,CAAC,CAAE,eAAe,CAAE,GAAe,EAAE,OAAwB;QAChE,KAAM,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,MAAM,CAAC,WAAW,CAAC,eAAe,CAAC,GAAG,EAAE,OAAO,CAAC,EAAE,cAAc,CAAC,CAAA;IACpF,CAAC;IAED,QAAQ;QACN,OAAO,gBAAgB,CAAA;IACzB,CAAC;CACF;AAED,MAAM,UAAU,aAAa,CAAE,MAAc;IAC3C,OAAO,IAAI,YAAY,CAAC,MAAM,CAAC,CAAA;AACjC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@helia/libp2p",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.1-ef258e7e",
|
|
4
4
|
"description": "libp2p functionality for Helia",
|
|
5
5
|
"license": "Apache-2.0 OR MIT",
|
|
6
6
|
"homepage": "https://github.com/ipfs/helia/tree/main/packages/libp2p#readme",
|
|
@@ -50,9 +50,9 @@
|
|
|
50
50
|
"dependencies": {
|
|
51
51
|
"@chainsafe/libp2p-noise": "^17.0.0",
|
|
52
52
|
"@chainsafe/libp2p-yamux": "^8.0.1",
|
|
53
|
-
"@helia/delegated-routing-client": "
|
|
53
|
+
"@helia/delegated-routing-client": "1.0.1-ef258e7e",
|
|
54
54
|
"@helia/delegated-routing-v1-http-api-client": "^8.0.0",
|
|
55
|
-
"@helia/interface": "
|
|
55
|
+
"@helia/interface": "7.0.1-ef258e7e",
|
|
56
56
|
"@ipshipyard/libp2p-auto-tls": "^2.0.1",
|
|
57
57
|
"@libp2p/autonat": "^3.0.21",
|
|
58
58
|
"@libp2p/bootstrap": "^12.0.24",
|
|
@@ -76,7 +76,8 @@
|
|
|
76
76
|
"@multiformats/dns": "^1.0.13",
|
|
77
77
|
"it-map": "^3.1.6",
|
|
78
78
|
"libp2p": "^3.3.3",
|
|
79
|
-
"multiformats": "^14.0.0"
|
|
79
|
+
"multiformats": "^14.0.0",
|
|
80
|
+
"uint8arrays": "^6.1.1"
|
|
80
81
|
},
|
|
81
82
|
"devDependencies": {
|
|
82
83
|
"aegir": "^48.0.11",
|
package/src/routing.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { peerIdFromCID } from '@libp2p/peer-id'
|
|
2
2
|
import map from 'it-map'
|
|
3
|
+
import { withArrayBuffer } from 'uint8arrays/with-array-buffer'
|
|
3
4
|
import type { Peer, Provider, Router, RoutingOptions } from '@helia/interface'
|
|
4
5
|
import type { Libp2p, PeerInfo } from '@libp2p/interface'
|
|
5
6
|
import type { CID } from 'multiformats'
|
|
@@ -38,8 +39,8 @@ class Libp2pRouter implements Router {
|
|
|
38
39
|
await this.libp2p.contentRouting.put(key, value, options)
|
|
39
40
|
}
|
|
40
41
|
|
|
41
|
-
async get (key: Uint8Array, options?: RoutingOptions): Promise<Uint8Array
|
|
42
|
-
return this.libp2p.contentRouting.get(key, options)
|
|
42
|
+
async get (key: Uint8Array, options?: RoutingOptions): Promise<Uint8Array<ArrayBuffer>> {
|
|
43
|
+
return withArrayBuffer(await this.libp2p.contentRouting.get(key, options))
|
|
43
44
|
}
|
|
44
45
|
|
|
45
46
|
async findPeer (peerId: CID, options?: RoutingOptions): Promise<Peer> {
|
package/dist/typedoc-urls.json
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"CreateLibp2pOptions": "https://ipfs.github.io/helia/interfaces/_helia_libp2p.CreateLibp2pOptions.html",
|
|
3
|
-
"DefaultLibp2pServices": "https://ipfs.github.io/helia/interfaces/_helia_libp2p.DefaultLibp2pServices.html",
|
|
4
|
-
"HeliaWithLibp2p": "https://ipfs.github.io/helia/interfaces/_helia_libp2p.HeliaWithLibp2p.html",
|
|
5
|
-
".:HeliaWithLibp2p": "https://ipfs.github.io/helia/interfaces/_helia_libp2p.HeliaWithLibp2p.html",
|
|
6
|
-
"libp2pDefaults": "https://ipfs.github.io/helia/functions/_helia_libp2p.libp2pDefaults.html",
|
|
7
|
-
"withLibp2p": "https://ipfs.github.io/helia/functions/_helia_libp2p.withLibp2p.html",
|
|
8
|
-
".:withLibp2p": "https://ipfs.github.io/helia/functions/_helia_libp2p.withLibp2p.html"
|
|
9
|
-
}
|