Skip to content
This repository was archived by the owner on Mar 10, 2020. It is now read-only.

Commit c153482

Browse files
committed
feat: store blocks under multihash key
Related to ipfs/js-ipfs#2415
1 parent a5aa139 commit c153482

File tree

2 files changed

+11
-4
lines changed

2 files changed

+11
-4
lines changed

README.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -236,9 +236,9 @@ const ipfs = ipfsClient({
236236
- [`ipfs.refs(ipfsPath, [options], [callback])`](https://github.com/ipfs/interface-ipfs-core/blob/master/SPEC/REFS.md#refs)
237237
- [`ipfs.refsReadableStream(ipfsPath, [options], [callback])`](https://github.com/ipfs/interface-ipfs-core/blob/master/SPEC/REFS.md#refsreadablestream)
238238
- [`ipfs.refsPullStream(ipfsPath, [options], [callback])`](https://github.com/ipfs/interface-ipfs-core/blob/master/SPEC/REFS.md#refspullstream)
239-
- [`ipfs.refs.local([callback])`](https://github.com/ipfs/interface-ipfs-core/blob/master/SPEC/REFS.md#refslocal)
240-
- [`ipfs.refs.localReadableStream([callback])`](https://github.com/ipfs/interface-ipfs-core/blob/master/SPEC/REFS.md#refslocalreadablestream)
241-
- [`ipfs.refs.localPullStream([callback])`](https://github.com/ipfs/interface-ipfs-core/blob/master/SPEC/REFS.md#refslocalpullstream)
239+
- [`ipfs.refs.local([options], [callback])`](https://github.com/ipfs/interface-ipfs-core/blob/master/SPEC/REFS.md#refslocal)
240+
- [`ipfs.refs.localReadableStream([options], [callback])`](https://github.com/ipfs/interface-ipfs-core/blob/master/SPEC/REFS.md#refslocalreadablestream)
241+
- [`ipfs.refs.localPullStream([options], [callback])`](https://github.com/ipfs/interface-ipfs-core/blob/master/SPEC/REFS.md#refslocalpullstream)
242242

243243
#### Graph
244244

src/files-regular/refs-local.js

+8-1
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,17 @@ module.exports = configure(({ ky }) => {
99
return async function * refsLocal (options) {
1010
options = options || {}
1111

12+
const searchParams = new URLSearchParams()
13+
14+
if (options.multihash !== undefined) {
15+
searchParams.set('multihash', options.multihash)
16+
}
17+
1218
const res = await ky.get('refs/local', {
1319
timeout: options.timeout,
1420
signal: options.signal,
15-
headers: options.headers
21+
headers: options.headers,
22+
searchParams
1623
})
1724

1825
for await (const file of ndjson(toIterable(res.body))) {

0 commit comments

Comments
 (0)