go-ipfs 0.10.0 Release
We're happy to announce go-ipfs 0.10.0. This release brings some big changes to the IPLD internals of go-ipfs that make working with non-UnixFS DAGs easier than ever. There are also a variety of new commands and configuration options available.
As usual, this release includes important fixes, some of which may be critical for security. Unless the fix addresses a bug being exploited in the wild, the fix will not be called out in the release notes. Please make sure to update ASAP. See our release process for details.
🛠 TLDR: BREAKING CHANGES
ipfs dag get
- default output changed to
dag-json
- dag-pb (e.g. unixfs) field names changed - impacts userland code that works with
dag-pb objects returned by dag get
- no longer emits an additional new-line character at the end of the data output
ipfs dag put
- defaults changed to reduce ambiguity and surprises: input is now assumed to be
dag-json, and data is serialized to dag-cbor at rest.
--format and --input-enc were removed and replaced with --store-codec and --input-codec
- codec names now match the ones defined in the multicodec table
- dag-pb (e.g. unixfs) field names changed - impacts userland code that works with
dag-pb objects stored via dag put
Keep reading to learn more details.
🔦 Highlights
🌲 IPLD Levels Up
The handling of data serialization as well as many aspects of DAG traversal and pathing have been migrated from older libraries, including go-merkledag and go-ipld-format to the new go-ipld-prime library and its components. This allows us to use many of the newer tools afforded by go-ipld-prime, stricter and more uniform codec implementations, support for additional (pluggable) codecs, and some minor performance improvements.
This is significant refactor of a core component that touches many parts of IPFS, and does come with some breaking changes:
- IPLD plugins:
- The
PluginIPLD interface has been changed to utilize go-ipld-prime. There is a demonstration of the change in the bundled git plugin.
- The semantics of
dag put and dag get change:
dag get now takes the output-codec option which accepts a multicodec name used to encode the output. By default this is dag-json, which is a strict and deterministic subset of JSON created by the IPLD team. Users may notice differences from the previously plain Go JSON output, particularly where bytes are concerned which are now encoded using a form similar to CIDs: {"/":{"bytes":"unpadded-base64-bytes"}} rather than the previously Go-specific plain padded base64 string. See the dag-json specification for an explanation of these forms.
dag get no longer prints an additional new-line character at the end of the encoded block output. This means that the output as presented by dag get are the exact bytes of the requested node. A round-trip of such bytes back in through dag put using the same codec should result in the same CID.
dag put uses the input-codec option to specify the multicodec name of the format data is being provided in, and the store-codec option to specify the multicodec name of the format the data should be stored in at rest. These formerly defaulted to json and cbor respectively. They now default to dag-json and dag-cbor respectively but may be changed to any supported codec (bundled or loaded via plugin) by its multicodec name.
- The
json and cbor multicodec names (as used by input-enc and format options) are now no longer aliases for dag-json and dag-cbor respectively. Instead, they now refer to their proper multicodec types. cbor refers to a plain CBOR format, which will not encode CIDs and does not have strict deterministic encoding rules. json is a plain JSON format, which also won't encode CIDs and will encode bytes in the Go-specific padded base64 string format rather than the dag-json method of byte encoding. See https://ipld.io/specs/codecs/ for more information on IPLD codecs.
protobuf is no longer used as the codec name for dag-pb
- The codec name
raw is used to mean Bytes in the IPLD Data Model
- UnixFS refactor. The dag-pb codec, which is used to encode UnixFS data for IPFS, is now represented through the
dag API in a form that mirrors the protobuf schema used to define the binary format. This unifies the implementations and specification of dag-pb across the IPLD and IPFS stacks. Previously, additional layers of code for file and directory handling within IPFS between protobuf serialization and UnixFS obscured the protobuf representation. Much of this code has now been replaced and there are fewer layers of transformation. This means that interacting with dag-pb data via the dag API will use different forms:
- Previously, using
dag get on a dag-pb block would present the block serialized as JSON as {"data":"padded-base64-bytes","links":[{"Name":"foo","Size":100,"Cid":{"/":"Qm..."}},...]}.
- Now, the dag-pb data with dag-json codec for output will be serialized using the data model from the dag-pb specification:
{"Data":{"/":{"bytes":"unpadded-base64-bytes"}},"Links":[{"Name":"foo","Tsize":100,"Hash":{"/":"Qm..."}},...]}. Aside from the change in byte formatting, most field names have changed: data → Data, links → Links, Size → Tsize, Cid → Hash. Note that this output can be changed now using the output-codec option to specify an alternative codec.
- Similarly, using
dag put and a store-codec option of dag-pb now requires that the input conform to this dag-pb specified form. Previously, input using {"data":"...","links":[...]} was accepted, now it must be {"Data":"...","Links":[...]}.
- Previously it was not possible to use paths to navigate to any of these properties of a dag-pb node, the only possible paths were named links, e.g.
dag get QmFoo/NamedLink where NamedLink was one of the links whose name was NamedLink. This functionality remains the same, but by prefixing the path with /ipld/ we enter data model pathing semantics and can dag get /ipld/QmFoo/Links/0/Hash to navigate to links or /ipld/QmFoo/Data to simply retrieve the data section of the node, for example.
- ℹ See the dag-pb specification for details on the codec and its data model representation.
- ℹ See this detailed write-up for further background on these changes.
Ⓜ Multibase Command
go-ipfs now provides utility commands for working with multibase:
$ echo -n hello | ipfs multibase encode -b base16 > file-mbase16
$ cat file-mbase16
f68656c6c6f
$ ipfs multibase decode file-mbase16
hello
$ cat file-mbase16 | ipfs multibase decode
hello
$ ipfs multibase transcode -b base2 file-mbase16
00110100001100101011011000110110001101111
See ipfs multibase --help for more examples.
🔨 Bitswap now supports greater configurability
This release adds an Internal section to the configuration file that is designed to help advanced users optimize their setups without needing a custom binary. The Internal section is not guaranteed to be the same from release to release and may not be covered by migrations. If you use the Internal section you should be making sure to check the config documentation between releases for any changes.
🐚 Programmatic shell completions command
ipfs commands completion bash will generate a bash completion script for go-ipfs commands
📜 Profile collection command
Performance profiles can now be collected using ipfs diag profile. If you need to do some debugging or have an issue to submit the collected profiles are very useful to have around.
🍎 Mac OS notarized binaries
The go-ipfs and related migration binaries (for both Intel and Apple Sillicon) are now signed and notarized to make Mac OS installation easier.
👨👩👦 Improved MDNS
There is a completed implementation of the revised libp2p MDNS spec. This should result in better MDNS discovery and better local/offline operation as a result.
🚗 CAR import statistics
dag import command now supports --stats option which will include the number of imported blocks and their total size in the output.
🕸 Peering command
This release adds swarm peering command for easy management of the peering subsystem. Peer in the peering subsystem is maintained to be connected at all times, and gets reconnected on disconnect with a back-off.
See ipfs swarm peering --help for more details.
✅ Release Checklist
For each RC published in each stage:
- version string in
version.go has been updated (in the release-vX.Y.Z branch).
- tag commit with
vX.Y.Z-rcN
- upload to dist.ipfs.io
- Build: https://github.com/ipfs/distributions#usage.
- Pin the resulting release.
- Make a PR against ipfs/distributions with the updated versions, including the new hash in the PR comment.
- Ask the infra team to update the DNSLink record for dist.ipfs.io to point to the new distribution.
- cut a pre-release on github and upload the result of the ipfs/distributions build in the previous step.
- Announce the RC:
Checklist:
⁉️ 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 #lobby:ipfs.io Matrix channel which is bridged with other chat platforms.
go-ipfs 0.10.0 Release
We're happy to announce go-ipfs 0.10.0. This release brings some big changes to the IPLD internals of go-ipfs that make working with non-UnixFS DAGs easier than ever. There are also a variety of new commands and configuration options available.
As usual, this release includes important fixes, some of which may be critical for security. Unless the fix addresses a bug being exploited in the wild, the fix will not be called out in the release notes. Please make sure to update ASAP. See our release process for details.
🛠 TLDR: BREAKING CHANGES
ipfs dag getdag-jsondag-pbobjects returned bydag getipfs dag putdag-json, and data is serialized todag-cborat rest.--formatand--input-encwere removed and replaced with--store-codecand--input-codecdag-pbobjects stored viadag putKeep reading to learn more details.
🔦 Highlights
🌲 IPLD Levels Up
The handling of data serialization as well as many aspects of DAG traversal and pathing have been migrated from older libraries, including go-merkledag and go-ipld-format to the new go-ipld-prime library and its components. This allows us to use many of the newer tools afforded by go-ipld-prime, stricter and more uniform codec implementations, support for additional (pluggable) codecs, and some minor performance improvements.
This is significant refactor of a core component that touches many parts of IPFS, and does come with some breaking changes:
PluginIPLDinterface has been changed to utilize go-ipld-prime. There is a demonstration of the change in the bundled git plugin.dag putanddag getchange:dag getnow takes theoutput-codecoption which accepts a multicodec name used to encode the output. By default this isdag-json, which is a strict and deterministic subset of JSON created by the IPLD team. Users may notice differences from the previously plain Go JSON output, particularly where bytes are concerned which are now encoded using a form similar to CIDs:{"/":{"bytes":"unpadded-base64-bytes"}}rather than the previously Go-specific plain padded base64 string. See the dag-json specification for an explanation of these forms.dag getno longer prints an additional new-line character at the end of the encoded block output. This means that the output as presented bydag getare the exact bytes of the requested node. A round-trip of such bytes back in throughdag putusing the same codec should result in the same CID.dag putuses theinput-codecoption to specify the multicodec name of the format data is being provided in, and thestore-codecoption to specify the multicodec name of the format the data should be stored in at rest. These formerly defaulted tojsonandcborrespectively. They now default todag-jsonanddag-cborrespectively but may be changed to any supported codec (bundled or loaded via plugin) by its multicodec name.jsonandcbormulticodec names (as used byinput-encandformatoptions) are now no longer aliases fordag-jsonanddag-cborrespectively. Instead, they now refer to their proper multicodec types.cborrefers to a plain CBOR format, which will not encode CIDs and does not have strict deterministic encoding rules.jsonis a plain JSON format, which also won't encode CIDs and will encode bytes in the Go-specific padded base64 string format rather than the dag-json method of byte encoding. See https://ipld.io/specs/codecs/ for more information on IPLD codecs.protobufis no longer used as the codec name fordag-pbrawis used to mean Bytes in the IPLD Data ModeldagAPI in a form that mirrors the protobuf schema used to define the binary format. This unifies the implementations and specification of dag-pb across the IPLD and IPFS stacks. Previously, additional layers of code for file and directory handling within IPFS between protobuf serialization and UnixFS obscured the protobuf representation. Much of this code has now been replaced and there are fewer layers of transformation. This means that interacting with dag-pb data via thedagAPI will use different forms:dag geton a dag-pb block would present the block serialized as JSON as{"data":"padded-base64-bytes","links":[{"Name":"foo","Size":100,"Cid":{"/":"Qm..."}},...]}.{"Data":{"/":{"bytes":"unpadded-base64-bytes"}},"Links":[{"Name":"foo","Tsize":100,"Hash":{"/":"Qm..."}},...]}. Aside from the change in byte formatting, most field names have changed:data→Data,links→Links,Size→Tsize,Cid→Hash. Note that this output can be changed now using theoutput-codecoption to specify an alternative codec.dag putand astore-codecoption ofdag-pbnow requires that the input conform to this dag-pb specified form. Previously, input using{"data":"...","links":[...]}was accepted, now it must be{"Data":"...","Links":[...]}.dag get QmFoo/NamedLinkwhereNamedLinkwas one of the links whose name wasNamedLink. This functionality remains the same, but by prefixing the path with/ipld/we enter data model pathing semantics and candag get /ipld/QmFoo/Links/0/Hashto navigate to links or/ipld/QmFoo/Datato simply retrieve the data section of the node, for example.Ⓜ Multibase Command
go-ipfs now provides utility commands for working with multibase:
See
ipfs multibase --helpfor more examples.🔨 Bitswap now supports greater configurability
This release adds an
Internalsection to the configuration file that is designed to help advanced users optimize their setups without needing a custom binary. TheInternalsection is not guaranteed to be the same from release to release and may not be covered by migrations. If you use theInternalsection you should be making sure to check the config documentation between releases for any changes.🐚 Programmatic shell completions command
ipfs commands completion bashwill generate a bash completion script for go-ipfs commands📜 Profile collection command
Performance profiles can now be collected using
ipfs diag profile. If you need to do some debugging or have an issue to submit the collected profiles are very useful to have around.🍎 Mac OS notarized binaries
The go-ipfs and related migration binaries (for both Intel and Apple Sillicon) are now signed and notarized to make Mac OS installation easier.
👨👩👦 Improved MDNS
There is a completed implementation of the revised libp2p MDNS spec. This should result in better MDNS discovery and better local/offline operation as a result.
🚗 CAR import statistics
dag importcommand now supports--statsoption which will include the number of imported blocks and their total size in the output.🕸 Peering command
This release adds
swarm peeringcommand for easy management of the peering subsystem. Peer in the peering subsystem is maintained to be connected at all times, and gets reconnected on disconnect with a back-off.See
ipfs swarm peering --helpfor more details.✅ Release Checklist
For each RC published in each stage:
version.gohas been updated (in therelease-vX.Y.Zbranch).vX.Y.Z-rcNChecklist:
release-vX.Y.Z) frommasterand make any further release related changes to this branch. If any "non-trivial" changes (see the footnotes of docs/releases.md for a definition) get added to the release, uncheck all the checkboxes and return to this stage.version.goin themasterbranch tovX.(Y+1).0-dev.make test)make test_go_lint)./bin/mkreleaselogto generate a nice starter listversion.gohas been updated.release-vX.Y.Zinto thereleasebranch.releasebranch) withvX.Y.Z.Announce it on the IPFS Users Mailing Listreleasebranch back intomaster, ignoring the changes toversion.go(keep the-devversion from master).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
#lobby:ipfs.ioMatrix channel which is bridged with other chat platforms.