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

Commit

Permalink
feat: store blocks under multihash key
Browse files Browse the repository at this point in the history
  • Loading branch information
AuHau committed Oct 15, 2019
1 parent a5aa139 commit c153482
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -236,9 +236,9 @@ const ipfs = ipfsClient({
- [`ipfs.refs(ipfsPath, [options], [callback])`](https://github.com/ipfs/interface-ipfs-core/blob/master/SPEC/REFS.md#refs)
- [`ipfs.refsReadableStream(ipfsPath, [options], [callback])`](https://github.com/ipfs/interface-ipfs-core/blob/master/SPEC/REFS.md#refsreadablestream)
- [`ipfs.refsPullStream(ipfsPath, [options], [callback])`](https://github.com/ipfs/interface-ipfs-core/blob/master/SPEC/REFS.md#refspullstream)
- [`ipfs.refs.local([callback])`](https://github.com/ipfs/interface-ipfs-core/blob/master/SPEC/REFS.md#refslocal)
- [`ipfs.refs.localReadableStream([callback])`](https://github.com/ipfs/interface-ipfs-core/blob/master/SPEC/REFS.md#refslocalreadablestream)
- [`ipfs.refs.localPullStream([callback])`](https://github.com/ipfs/interface-ipfs-core/blob/master/SPEC/REFS.md#refslocalpullstream)
- [`ipfs.refs.local([options], [callback])`](https://github.com/ipfs/interface-ipfs-core/blob/master/SPEC/REFS.md#refslocal)
- [`ipfs.refs.localReadableStream([options], [callback])`](https://github.com/ipfs/interface-ipfs-core/blob/master/SPEC/REFS.md#refslocalreadablestream)
- [`ipfs.refs.localPullStream([options], [callback])`](https://github.com/ipfs/interface-ipfs-core/blob/master/SPEC/REFS.md#refslocalpullstream)

#### Graph

Expand Down
9 changes: 8 additions & 1 deletion src/files-regular/refs-local.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,17 @@ module.exports = configure(({ ky }) => {
return async function * refsLocal (options) {
options = options || {}

const searchParams = new URLSearchParams()

if (options.multihash !== undefined) {
searchParams.set('multihash', options.multihash)
}

const res = await ky.get('refs/local', {
timeout: options.timeout,
signal: options.signal,
headers: options.headers
headers: options.headers,
searchParams
})

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

0 comments on commit c153482

Please sign in to comment.