This repository has been archived by the owner on Feb 12, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
It is now possible to pass in options for IPLD. This makes it possible to pass in the formats that IPFS should support. With version 0.19.0 of js-ipld the default formats are *only* [dag-cbor] and [dag-pb]. BREAKING CHANGE: js-ipfs supports dag-cbor and dag-pb by default only If you use js-ipfs as a library, only [dag-cbor] and [dag-pb] are bundled by default. If you want to use additional formats, you need to pass them into the constructor. This example code shows how to get the same behaviour as before: ```js 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 node = new IPFS({ ipld: { formats: [ ipldBitcoin, ipldDagCbor, ipldDagPb, ipldEthAccountSnapshot, ipldEthBlock, ipldEthBlockList, ipldEthStateTrie, ipldEthStorageTrie, ipldEthTrie, ipldEthTx, ipldGit, ipldRaw, ipldZcash ] } }) ``` There is no change on the js-ipfs command line tool, it still supports all those formats. [dag-cbor]: https://github.com/ipld/js-ipld-dag-cbor [dag-pb]: https://github.com/ipld/js-ipld-dag-pp
- Loading branch information
Showing
5 changed files
with
50 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters