Skip to content
This repository was archived by the owner on Feb 12, 2024. It is now read-only.

Commit 6eeaca4

Browse files
authored
fix(pubsub): multibase in pubsub http rpc (#3922)
This PR aims to restore interop with go-ipfs by applying the same changes as in ipfs/kubo#8183 TLDR is that we clean up and unify the API. BREAKING CHANGE: We had to make breaking changes to `pubsub` commands sent over HTTP RPC to fix data corruption caused by topic names and payload bytes that included `\n`. More details in ipfs/kubo#7939 and ipfs/kubo#8183
1 parent 33f1034 commit 6eeaca4

File tree

23 files changed

+159
-82
lines changed

23 files changed

+159
-82
lines changed

.github/workflows/test.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -331,9 +331,9 @@ jobs:
331331
- name: ipfs browser exchange files
332332
repo: https://github.com/ipfs-examples/js-ipfs-browser-exchange-files.git
333333
deps: ipfs-core@$PWD/packages/ipfs-core/dist,ipfs@$PWD/packages/ipfs/dist,ipfs-core-types@$PWD/packages/ipfs-core-types/dist,ipfs-http-client@$PWD/packages/ipfs-http-client/dist
334-
- name: ipfs browser ipns publish
335-
repo: https://github.com/ipfs-examples/js-ipfs-browser-ipns-publish.git
336-
deps: ipfs-core@$PWD/packages/ipfs-core/dist,ipfs-http-client@$PWD/packages/ipfs-http-client/dist
334+
#- name: ipfs browser ipns publish TODO: re-enable after example bumped to go-ipfs 0.11 and ipfs-http-client from https://github.com/ipfs/js-ipfs/pull/3922
335+
# repo: https://github.com/ipfs-examples/js-ipfs-browser-ipns-publish.git
336+
# deps: ipfs-core@$PWD/packages/ipfs-core/dist,ipfs-http-client@$PWD/packages/ipfs-http-client/dist
337337
- name: ipfs browser mfs
338338
repo: https://github.com/ipfs-examples/js-ipfs-browser-mfs.git
339339
deps: ipfs-core@$PWD/packages/ipfs-core/dist
@@ -373,9 +373,9 @@ jobs:
373373
- name: ipfs custom libp2p
374374
repo: https://github.com/ipfs-examples/js-ipfs-custom-libp2p.git
375375
deps: ipfs-core@$PWD/packages/ipfs-core/dist
376-
- name: ipfs-http-client browser pubsub
377-
repo: https://github.com/ipfs-examples/js-ipfs-http-client-browser-pubsub.git
378-
deps: ipfs-http-client@$PWD/packages/ipfs-http-client/dist,ipfs@$PWD/packages/ipfs/dist
376+
#- name: ipfs-http-client browser pubsub TODO: re-enable after example bumped to go-ipfs 0.11 and ipfs-http-client from https://github.com/ipfs/js-ipfs/pull/3922
377+
# repo: https://github.com/ipfs-examples/js-ipfs-http-client-browser-pubsub.git
378+
# deps: ipfs-http-client@$PWD/packages/ipfs-http-client/dist,ipfs@$PWD/packages/ipfs/dist
379379
- name: ipfs-http-client bundle webpack
380380
repo: https://github.com/ipfs-examples/js-ipfs-http-client-bundle-webpack.git
381381
deps: ipfs-http-client@$PWD/packages/ipfs-http-client/dist,ipfs@$PWD/packages/ipfs/dist

packages/interface-ipfs-core/src/add.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -463,9 +463,9 @@ export function testAdd (factory, options) {
463463
sharding: true
464464
},
465465
config: {
466-
// enable sharding for go
467-
Experimental: {
468-
ShardingEnabled: true
466+
// enable sharding for go with automatic threshold dropped to the minimum so it shards everything
467+
Internal: {
468+
UnixFSShardingSizeThreshold: '1B'
469469
}
470470
}
471471
}

packages/interface-ipfs-core/src/files/cp.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -358,9 +358,9 @@ export function testCp (factory, options) {
358358
sharding: true
359359
},
360360
config: {
361-
// enable sharding for go
362-
Experimental: {
363-
ShardingEnabled: true
361+
// enable sharding for go with automatic threshold dropped to the minimum so it shards everything
362+
Internal: {
363+
UnixFSShardingSizeThreshold: '1B'
364364
}
365365
}
366366
}

packages/interface-ipfs-core/src/files/ls.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -174,9 +174,9 @@ export function testLs (factory, options) {
174174
sharding: true
175175
},
176176
config: {
177-
// enable sharding for go
178-
Experimental: {
179-
ShardingEnabled: true
177+
// enable sharding for go with automatic threshold dropped to the minimum so it shards everything
178+
Internal: {
179+
UnixFSShardingSizeThreshold: '1B'
180180
}
181181
}
182182
}

packages/interface-ipfs-core/src/files/mkdir.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -235,9 +235,9 @@ export function testMkdir (factory, options) {
235235
sharding: true
236236
},
237237
config: {
238-
// enable sharding for go
239-
Experimental: {
240-
ShardingEnabled: true
238+
// enable sharding for go with automatic threshold dropped to the minimum so it shards everything
239+
Internal: {
240+
UnixFSShardingSizeThreshold: '1B'
241241
}
242242
}
243243
}

packages/interface-ipfs-core/src/files/mv.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -120,9 +120,9 @@ export function testMv (factory, options) {
120120
sharding: true
121121
},
122122
config: {
123-
// enable sharding for go
124-
Experimental: {
125-
ShardingEnabled: true
123+
// enable sharding for go with automatic threshold dropped to the minimum so it shards everything
124+
Internal: {
125+
UnixFSShardingSizeThreshold: '1B'
126126
}
127127
}
128128
}

packages/interface-ipfs-core/src/files/read.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -124,9 +124,9 @@ export function testRead (factory, options) {
124124
sharding: true
125125
},
126126
config: {
127-
// enable sharding for go
128-
Experimental: {
129-
ShardingEnabled: true
127+
// enable sharding for go with automatic threshold dropped to the minimum so it shards everything
128+
Internal: {
129+
UnixFSShardingSizeThreshold: '1B'
130130
}
131131
}
132132
}

packages/interface-ipfs-core/src/files/rm.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -143,9 +143,9 @@ export function testRm (factory, options) {
143143
sharding: true
144144
},
145145
config: {
146-
// enable sharding for go
147-
Experimental: {
148-
ShardingEnabled: true
146+
// enable sharding for go with automatic threshold dropped to the minimum so it shards everything
147+
Internal: {
148+
UnixFSShardingSizeThreshold: '1B'
149149
}
150150
}
151151
}

packages/interface-ipfs-core/src/files/stat.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -382,9 +382,9 @@ export function testStat (factory, options) {
382382
sharding: true
383383
},
384384
config: {
385-
// enable sharding for go
386-
Experimental: {
387-
ShardingEnabled: true
385+
// enable sharding for go with automatic threshold dropped to the minimum so it shards everything
386+
Internal: {
387+
UnixFSShardingSizeThreshold: '1B'
388388
}
389389
}
390390
}

packages/interface-ipfs-core/src/files/write.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -661,9 +661,9 @@ export function testWrite (factory, options) {
661661
sharding: true
662662
},
663663
config: {
664-
// enable sharding for go
665-
Experimental: {
666-
ShardingEnabled: true
664+
// enable sharding for go with automatic threshold dropped to the minimum so it shards everything
665+
Internal: {
666+
UnixFSShardingSizeThreshold: '1B'
667667
}
668668
}
669669
}

0 commit comments

Comments
 (0)