0.30.2 (2021-08-11)
0.30.1 (2021-08-11)
- race condition in
getFormat
(#299) (a53ebcf), closes /github.com/ipld/js-ipld/blob/021b4195b2c1254c323a9f370507fbaa0a42a112/src/index.js#L65-L76
0.30.0 (2021-04-28)
- buffer@6 removes support for IE and Safari < 10
0.29.0 (2021-03-11)
0.28.0 (2020-11-09)
- update deps (10c3777)
- updates ipld-block to 0.11.0 which is not compatible
with earlier versions (fails
expect(v11Block).to.deep.equal(v10Block)
for example)
0.27.3 (2020-10-29)
- use correct property when checking if resolver exists (b412899)
0.27.2 (2020-10-27)
- expose getFormat function (78c8769)
0.27.1 (2020-08-05)
0.27.0 (2020-08-05)
- create buffers from decoded multihash digests (#287) (28ecc2f)
- update all deps to versions that return uint8arrays (#286) (75037ea)
-
- CIDs returned from
put*
methods have breaking API changes See see multiformats/js-cid#117 for changes
- CIDs returned from
0.26.4 (2020-07-24)
0.26.3 (2020-06-09)
- package: update ipld-raw to version 5.0.0 (75787e0)
0.26.2 (2020-04-27)
- add buffer (15307a1)
0.26.1 (2020-04-23)
- support passing AbortSignals to the configured blockservice (89335da)
0.26.0 (2020-04-23)
- Revert "Revert "fix: update deps and use ipld-block"" (4ec1f74)
- Use ipld-block instead of ipfs-block
This reverts commit 6af9449eeaa215587a97c6b8963b93a1482341fe.
0.25.5 (2020-04-23)
0.25.4 (2020-04-22)
- update deps and use ipld-block (9bd8aee)
- package: update cids to version 0.8.0 (ee554e7)
- minor improvement to path handling in Node.js tests (ea53bb3)
0.25.3 (2020-01-13)
- package: update multicodec to version 1.0.0 (2b661da)
- package: update typical to version 6.0.0 (2a9506a)
0.25.2 (2019-10-30)
0.25.1 (2019-10-30)
- package: update merge-options to version 2.0.0 (c55c869)
0.25.0 (2019-08-01)
- make code promisify free (23de2e4)
- Everyone upgrading to this release also needs to upgrade ipfs-block-service, ipfs-repo and ipld-in-memory.
This commit uses the new async API of:
- ipfs-block-service >= 0.16.0
- ipfs-repo >=0.27.0
- ipld-in-memory >= 3.0.0
If your library has a dependency on any of those, you likely also need to upgrade to at least those versions.
0.24.1 (2019-05-15)
- respect the
cidVersion
option (b1a3a2a)
0.24.0 (2019-05-10)
- update dependencies (7232eea)
- v1 CIDs now default to base32 encoding
Previous versions returned a base58 encoded string when toString()
/
toBaseEncodedString()
was called on a CIDv1. It now returns a base32
encoded string.
0.23.0 (2019-05-08)
- use the cleaned up IPLD Format API (108aef0)
- All formats now return data according to the IPLD Data Model
The most important change is that now all formats return links as CID instances
and no longer as the JSON representation ({"/": "base-encoded-cid"}
.
0.22.0 (2019-03-21)
- add dynamically loaded format via addFormat() (95536cd)
- don't throw if it's not a proper old-style link (38be898)
- error if loadFormat() is not a function (4ad1ee4)
- use a version of typical where async iterators are supported (43176ca)
- use promisify-es6 instead of Nodes.js' promisify (79e521c)
- add single item functions (945fc61)
- implementation of the new
addFormat/removeFormat()
functions (12b436b) - implementation of the new
get()
function (743e679) - implementation of the new
put()
function (8b737b1) - implementation of the new
remove()
function (08c1e0e) - implementation of the new
resolve()
function (162473b) - implementation of the new
tree()
function (9801765) - make addFormat() and removeFormat() return the instance (5f62fe0)
- put/get/remove functions are renamed
This commit introduces single item functions which are called put()
/get()
,remove()
.
In order to put, get or remove multiple items you need to call
putMany()
,getMany()
/removeMany()
now.
- This replaces the
treeStream()
function.
The API docs for it:
Returns all the paths that can be resolved into.
cid
(CID
, required): the CID to get the paths from.path
(IPLD Path
, default: ''): the path to start to retrieve the other paths from.options
:recursive
(bool
, default: false): whether to get the paths recursively or not.false
resolves only the paths of the given CID.
Returns an async iterator of all the paths (as Strings) you could resolve into.
- They replace the
support.add()
andsupport.rm()
functions.
The API docs for it:
.addFormat(ipldFormatImplementation)
:
Add support for an IPLD Format
ipldFormatImplementation
(IPLD Format
, required): the implementation of an IPLD Format.
.removeFormat(codec)
:
Remove support for an IPLD Format
codec
(multicodec
, required): the codec of the IPLD Format to remove.
remove()
has a new API.
The API docs for it:
Remove IPLD Nodes by the given
cids
cids
(Iterable<CID>
): the CIDs of the IPLD Nodes that should be removed.
Throws an error if any of the Blocks can’t be removed. This operation is not atomic, some Blocks might have already been removed.
get()
is replacing thegetMany()
function.
The API docs for it:
Retrieve several IPLD Nodes at once.
cids
(Iterable<CID>
): the CIDs of the IPLD Nodes that should be retrieved.
Returns an async iterator with the IPLD Nodes that correspond to the given cids
.
Throws an error if a IPLD Node can’t be retrieved.
- The API of
put()
changes.
The API docs for it:
Stores the given IPLD Nodes of a recognized IPLD Format.
nodes
(Iterable<Object>
): deserialized IPLD nodes that should be inserted.format
(multicodec
, required): the multicodec of the format that IPLD Node should be encoded in.options
is applied to any of thenodes
and is an object with the following properties:hashAlg
(multicodec
, default: hash algorithm of the given multicodec): the hashing algorithm that is used to calculate the CID.cidVersion
(boolean
, default: 1): the CID version to use.onlyHash
(boolean
, default: false): if true the serialized form of the IPLD Node will not be passed to the underlying block store.
Returns an async iterator with the CIDs of the serialized IPLD Nodes.
- The
codec
parameter inoptions.loadFormat()
is a number
Instead of returnign the name of the codec as string, the codec code (a number) is now returned.
So if you e.g. check within the function for a certain format, it changes from:
async loadFormat (codec) {
if (codec !== 'dag-cbor') …
}
To:
async loadFormat (codec) {
if (codec !== multicodec.DAG_CBOR) …
}
- your custom format loading function needs to be an async now.
So the signature for options.loadFormat
is no longer:
function (codec, callback)
but
async functiont (codec)
resolve()
replaces parts ofget()
.
The API docs for it:
Retrieves IPLD Nodes along the
path
that is rooted atcid
.
cid
(CID
, required): the CID the resolving starts.path
(IPLD Path
, required): the path that should be resolved.
Returns an async iterator of all the IPLD Nodes that were traversed during the path resolving. Every element is an object with these fields:
remainderPath
(string
): the part of the path that wasn’t resolved yet.value
(*
): the value where the resolved path points to. If further traversing is possible, then the value is a CID object linking to another IPLD Node. If it was possible to fully resolve the path,value
is the value thepath
points to. So if you need the CID of the IPLD Node you’re currently at, just take thevalue
of the previously returned IPLD Node.
0.21.1 (2019-01-25)
0.21.0 (2019-01-16)
- This module no longer exports an
inMemory
utility to create an IPLD instance that uses a block service that stores data in memory. Please use theipld-in-memory
module instead.
License: MIT Signed-off-by: Alan Shaw [email protected]
0.20.2 (2018-12-19)
- linting passes again (4fc3c6e)
0.20.1 (2018-11-19)
0.20.0 (2018-11-10)
- updates ipld-dag-pb dep to version (add49fe), closes ipld/js-ipld-dag-pb#99 ipld/js-ipld-dag-pb#99
- DAGNodes no longer have
.cid
or.multihash
properties - see
0.19.3 (2018-11-09)
- dynamic format loading (b41033b), closes /github.com/ipld/js-ipld/pull/164#discussion_r228121092
0.19.2 (2018-11-07)
- fail fast for missing format (ebd2d1b)
0.19.1 (2018-10-27)
0.19.0 (2018-10-25)
- Not all IPLD Formats are included by default
By default only the ipld-dag-cbor, ipld-dag-pb and [raw] IPLD Formats are included. If you want to use other IPLD Formats you need to pass them into the constructor.
The code to restore the old behaviour could look like this:
const ipldBitcoin = require('ipld-bitcoin')
const ipldDagCbor = require('ipld-dag-cbor')
const ipldDagPb = require('ipld-dag-pb')
const ipldEthAccountSnapshot = require('ipld-ethereum').ethAccountSnapshot
const ipldEthBlock = require('ipld-ethereum').ethBlock
const ipldEthBlockList = require('ipld-ethereum').ethBlockList
const ipldEthStateTrie = require('ipld-ethereum').ethStateTrie
const ipldEthStorageTrie = require('ipld-ethereum').ethStorageTrie
const ipldEthTrie = require('ipld-ethereum').ethTxTrie
const ipldEthTx = require('ipld-ethereum').ethTx
const ipldGit = require('ipld-git')
const ipldRaw = require('ipld-raw')
const ipldZcash = require('ipld-zcash')
…
const ipld = new Ipld({
blockService: blockService,
formats: [
ipldBitcoin, ipldDagCbor, ipldDagPb, ipldEthAccountSnapshot,
ipldEthBlock, ipldEthBlockList, ipldEthStateTrie, ipldEthStorageTrie,
ipldEthTrie, ipldEthTx, ipldGit, ipldRaw, ipldZcash
]
})
- The IPLD constructor is no longer taking a BlockService as its
only parameter, but an objects object with
blockService
as a key.
You need to upgrade your code if you initialize IPLD.
Prior to this change:
const ipld = new Ipld(blockService)
Now:
const ipld = new Ipld({blockService: blockService})
0.18.0 (2018-10-12)
- The API for dag-cbor changed.
Links are no longer represented as JSON objects (
{"/": "base-encoded-cid"}
, but as CID objects.get()
andgetStream()
now always return links as CID objects.put()
also takes CID objects as input. Link represented as old-style JSON objects is still supported, but deprecated.
Example:
Prior to this change:
const cid = new CID('QmXed8RihWcWFXRRmfSRG9yFjEbXNxu1bDwgCFAN8Dxcq5')
ipld.put({link: {'/': cid.toBaseEncodedString()}}, {format: 'dag-cbor'}, (err, putCid) => {
ipld.get(putCid, (err, result) => {
console.log(result.value)
})
})
Output:
{ link:
{ '/':
<Buffer 12 20 8a…> } }
Now:
const cid = new CID('QmXed8RihWcWFXRRmfSRG9yFjEbXNxu1bDwgCFAN8Dxcq5')
ipld.put({link: cid}, {format: 'dag-cbor'}, (err, putCid) => {
ipld.get(putCid, (err, result) => {
console.log(result.value)
})
})
Output:
{ link:
CID {
codec: 'dag-pb',
version: 0,
multihash:
<Buffer 12 20 8a…> } }
See ipld/ipld#44 for more information on why this change was made.
0.17.4 (2018-09-25)
- use package-table vs custom script (366176c)
- lazy load format resolvers (f4a094a)
0.17.3 (2018-07-17)
- put: pass CID options to resolver (a419048)
0.17.2 (2018-05-29)
0.17.1 (2018-05-29)
- "resolver exists" error message typo (d3d78e0)
0.17.0 (2018-04-11)
0.16.0 (2018-04-09)
- handle required options for IPLDResolver.put (3612289)
0.15.0 (2018-02-26)
- resolvers expect binary data (03eaa25)
- All packages that depend on
ipld-resolver
need to change their dependency.
Within your package that depends on ipld-resolver
do:
npm uninstall ipld-resolver
npm intall ipld
Then search for all imports of ipld-resolver
and change from
const IPLDResolver = require('ipld-resolver')
to
const Ipld = require('ipld')
0.14.1 (2017-11-07)
0.14.0 (2017-11-06)
0.13.4 (2017-10-11)
0.13.3 (2017-10-07)
0.13.2 (2017-09-07)
0.13.1 (2017-09-02)
0.13.0 (2017-07-23)
0.12.1 (2017-07-11)
- update ethereum resolvers (f258c9e)
0.12.0 (2017-07-04)
0.11.1 (2017-05-23)
0.11.0 (2017-03-22)
- migrate to new ipfs-block and block-service api (c7dd494)
0.10.1 (2017-03-16)
0.10.0 (2017-03-13)
0.9.0 (2017-02-11)
0.8.1 (2017-02-09)
0.8.0 (2017-02-08)
0.7.1 (2017-02-08)
0.7.0 (2017-02-08)
0.6.0 (2017-02-02)
0.5.0 (2017-02-02)
0.4.3 (2017-01-29)
0.4.2 (2017-01-29)
- switch to dag-cbor 0.8.2, the switch to borc in 0.8.3 introduced a bug (948ca6a)
0.4.1 (2016-12-13)
0.4.0 (2016-12-08)
0.3.1 (2016-12-01)
0.3.0 (2016-11-24)
0.2.0 (2016-11-03)
0.1.2 (2016-10-30)
0.1.1 (2016-10-26)
- point to the right memory store (c8ce7c2)
0.1.0 (2016-10-26)
- Add basic resolve function (a138a06)
- add ipld-dag-cbor to the mix (a186055)
- create a resolver in memory when no block-service is passed (00d5d46)
- drop getRecursive functions (05d4e74)
- follow new dag-pb interface (from new interface-ipld-format (91ecfa4)
- main resolver (understands dag-pb) (0818945)
- move resolver to async IPLD format API, update dag-pb tests (39db563)
- resolve through different formats (7978fd6)
- support for ipld-dag-pb (436f44c)
- Update API, use new block-service, block and ipld-dag-pb (edee5fa)
- update dag-cbor tests to async API, solve dag-cbor bug (733876b)
- upgrade to latest spec (c2ec9fe)