File tree 10 files changed +18
-13
lines changed
10 files changed +18
-13
lines changed Original file line number Diff line number Diff line change 68
68
"async" : " ^3.1.0" ,
69
69
"browser-process-platform" : " ~0.1.1" ,
70
70
"go-ipfs-dep" : " ^0.4.22" ,
71
- "interface-ipfs-core" : " ^0.129 .0" ,
72
- "ipfsd-ctl" : " ^1.0.2 " ,
71
+ "interface-ipfs-core" : " ^0.131 .0" ,
72
+ "ipfsd-ctl" : " ^2. 1.0" ,
73
73
"it-all" : " ^1.0.1" ,
74
74
"it-concat" : " ^1.0.0" ,
75
75
"it-pipe" : " ^1.1.0" ,
Original file line number Diff line number Diff line change @@ -23,7 +23,7 @@ function toCoreInterface (res) {
23
23
return {
24
24
provideBufLen : res . ProvideBufLen ,
25
25
wantlist : ( res . Wantlist || [ ] ) . map ( k => new CID ( k [ '/' ] ) ) ,
26
- peers : ( res . Peers || [ ] ) . map ( p => new CID ( p ) ) ,
26
+ peers : ( res . Peers || [ ] ) ,
27
27
blocksReceived : new Big ( res . BlocksReceived ) ,
28
28
dataReceived : new Big ( res . DataReceived ) ,
29
29
blocksSent : new Big ( res . BlocksSent ) ,
Original file line number Diff line number Diff line change @@ -37,7 +37,7 @@ module.exports = configure(({ ky }) => {
37
37
// https://github.com/ipfs/go-ipfs/blob/eb11f569b064b960d1aba4b5b8ca155a3bd2cb21/core/commands/dht.go#L395-L396
38
38
for ( const { ID , Addrs } of message . Responses ) {
39
39
return {
40
- id : new CID ( ID ) ,
40
+ id : ID ,
41
41
addrs : ( Addrs || [ ] ) . map ( a => multiaddr ( a ) )
42
42
}
43
43
}
Original file line number Diff line number Diff line change @@ -35,7 +35,7 @@ module.exports = configure(({ ky }) => {
35
35
if ( message . Type === 4 && message . Responses ) {
36
36
for ( const { ID , Addrs } of message . Responses ) {
37
37
yield {
38
- id : new CID ( ID ) ,
38
+ id : ID ,
39
39
addrs : ( Addrs || [ ] ) . map ( a => multiaddr ( a ) )
40
40
}
41
41
}
Original file line number Diff line number Diff line change @@ -36,7 +36,7 @@ module.exports = configure(({ ky }) => {
36
36
message . id = new CID ( message . id )
37
37
if ( message . responses ) {
38
38
message . responses = message . responses . map ( ( { ID , Addrs } ) => ( {
39
- id : new CID ( ID ) ,
39
+ id : ID ,
40
40
addrs : ( Addrs || [ ] ) . map ( a => multiaddr ( a ) )
41
41
} ) )
42
42
} else {
Original file line number Diff line number Diff line change @@ -38,7 +38,7 @@ module.exports = configure(({ ky }) => {
38
38
message . id = new CID ( message . id )
39
39
if ( message . responses ) {
40
40
message . responses = message . responses . map ( ( { ID , Addrs } ) => ( {
41
- id : new CID ( ID ) ,
41
+ id : ID ,
42
42
addrs : ( Addrs || [ ] ) . map ( a => multiaddr ( a ) )
43
43
} ) )
44
44
}
Original file line number Diff line number Diff line change @@ -26,7 +26,7 @@ module.exports = configure(({ ky }) => {
26
26
message = toCamel ( message )
27
27
message . id = new CID ( message . id )
28
28
message . responses = ( message . responses || [ ] ) . map ( ( { ID , Addrs } ) => ( {
29
- id : new CID ( ID ) ,
29
+ id : ID ,
30
30
addrs : ( Addrs || [ ] ) . map ( a => multiaddr ( a ) )
31
31
} ) )
32
32
yield message
Original file line number Diff line number Diff line change 2
2
3
3
const configure = require ( './lib/configure' )
4
4
const toCamel = require ( './lib/object-to-camel' )
5
+ const multiaddr = require ( 'multiaddr' )
5
6
6
7
module . exports = configure ( ( { ky } ) => {
7
8
return async options => {
@@ -14,6 +15,12 @@ module.exports = configure(({ ky }) => {
14
15
searchParams : options . searchParams
15
16
} ) . json ( )
16
17
17
- return toCamel ( res )
18
+ const output = toCamel ( res )
19
+
20
+ if ( output . addresses ) {
21
+ output . addresses = output . addresses . map ( ma => multiaddr ( ma ) )
22
+ }
23
+
24
+ return output
18
25
}
19
26
} )
Original file line number Diff line number Diff line change 1
1
'use strict'
2
2
3
- const CID = require ( 'cids' )
4
3
const multiaddr = require ( 'multiaddr' )
5
4
const configure = require ( '../lib/configure' )
6
5
@@ -16,7 +15,7 @@ module.exports = configure(({ ky }) => {
16
15
} ) . json ( )
17
16
18
17
return Object . keys ( res . Addrs ) . map ( id => ( {
19
- id : new CID ( id ) ,
18
+ id,
20
19
addrs : ( res . Addrs [ id ] || [ ] ) . map ( a => multiaddr ( a ) )
21
20
} ) )
22
21
}
Original file line number Diff line number Diff line change 1
1
'use strict'
2
2
3
3
const multiaddr = require ( 'multiaddr' )
4
- const CID = require ( 'cids' )
5
4
const configure = require ( '../lib/configure' )
6
5
7
6
module . exports = configure ( ( { ky } ) => {
@@ -25,7 +24,7 @@ module.exports = configure(({ ky }) => {
25
24
const info = { }
26
25
try {
27
26
info . addr = multiaddr ( peer . Addr )
28
- info . peer = new CID ( peer . Peer )
27
+ info . peer = peer . Peer
29
28
} catch ( error ) {
30
29
info . error = error
31
30
info . rawPeerInfo = peer
You can’t perform that action at this time.
0 commit comments