js-ipfs 0.34.0 released

by Alan Shaw on 2019-01-17

Speed and flexibility, new IPFS for a new year!

🔦 Highlights

🏎 Reading Protobuf DAG nodes is super fast

Reading Protobuf DAG nodes just got a serious speed boost as well as a memory reduction. Previously Protobuf DAG nodes (dag-pb nodes for short) carried a multihash property (a CIDv0) with them. This used up loads of CPU time calculating the hash for a given node as it was retrieved from storage and with the advent of CIDv1 there was no guarantee the hashing algorithm and length were correct.

So, we removed it! 🦖 …but that had the unfortunate consequence of making the object API a whole lot less useful when writing data - the DAG nodes you got back were basically the data you put in. Hence the object API was refactored to return CIDs instead of DAG nodes for write operations…and we all lived happily ever after.

🚤 Adding content is blazingly fast

We found a bottleneck that meant the bigger the file you added to IPFS, the longer it would take - oh no 😭! Good news folks, we’ve seen the speed of adding large files increase by 50% or more in some cases! 💥

Read all about it in the pull request notes.

🎄 HAMT support added to MFS

We’re putting the whole of npm on IPFS! These days npm is like 5.3 terabytes of data and it’s all going in MFS. This is super rad, but we needed a good sharding strategy because 5TB is a lorra lorra files.

If you’re curious about npm on IPFS, check out the project here.

📣 IPNS over pubsub and DHT

Get informed of IPNS record updates and read and publish your IPNS records to the DHT. It’s all there and it’s all awesome. For those of you new to IPNS, let me give you the lowdown - IPNS puts the mutable in immutable 🤣 It’s an age old problem, content addressing is rad and all that, but if I change something the hash changes - 👎 boo…but wait, IPNS solves this, you get a permenant address for changeable content - hooray \o/.

IPNS over pubsub gets the word out quicker to peers that are interested when an IPNS record changes. IPNS over DHT allows peers to find and resolve your IPNS address to some content in the first place! In the next JS IPFS release (0.35) the DHT will be enabled by default and it’s going to be epic.

⚾️ CID handling improvements

Smoosh your CIDs into whatever version you like - you can now add data under a version 0 CID and get it back using a version 1 CID and vice versa. Now that you have this freedom you can encode them with whatever multibase encoding you like. Version 0 CIDs are all base58btc but if you convert to a version 1 CID you can encode it with base2, base32, base64url or whatever:

# base2
# base32
# base58btc
# base64url

This is all work to smooth out the eventual transition to base32 CIDv1 by default - a move to allow CIDs to be used as valid URL origins. Have a read of this for more.

To help you craft your artisanal CIDs we’ve introduced a --cid-base option to a bunch of CLI commands (and ?cid-base option to a bunch of HTTP API endpoints). Check it out:

jsipfs add file.txt --cid-base=base32
added bafybeibns4lrebrxaymvyshgmki5biwh6cd53idxfpen6ysomzrywtsm44 file.txt

💪 Deps got upgrades!

We got you covered with WebUI 2.3 (quic support, responsive navbar, and a language selector), libp2p 0.24 and many other upgrades giving you a faster and smaller JS IPFS.

🏗 API Changes

❤️ Huge thank you to everyone that made this release possible

By alphabetical order, here are all the humans that contributed to the release:

🙌🏽 Want to contribute?

Would you like to contribute to the IPFS project and don’t know how? Well, there are a few places you can get started:

⁉️ Do you have questions?

The best place to ask your questions about IPFS, how it works and what you can do with it is at discuss.ipfs.io. We are also available at the #ipfs channel on Freenode.