Skip to content
This repository has been archived by the owner on Sep 28, 2021. It is now read-only.

chore: update ipld formats #25

Merged
merged 6 commits into from
May 21, 2019
Merged

chore: update ipld formats #25

merged 6 commits into from
May 21, 2019

Conversation

achingbrain
Copy link
Member

@achingbrain achingbrain commented May 19, 2019

Not a direct dependency of this module but ipld-dag-pb changed the case of some property names that are used by this module.

The tests probably won't pass until a new version of IPFS is released.

We really need to break the dependency in this module.

BREAKING CHANGE: The default string encoding for version 1 CIDs has changed to base32

refs: ipfs/js-ipfs#1995
closes: #18

Alan Shaw and others added 2 commits May 12, 2019 08:13
BREAKING CHANGE: v1 CIDs created by this module now default to base32 encoding when stringified

refs: ipfs/js-ipfs#1995

License: MIT
Signed-off-by: Alan Shaw <[email protected]>
Not a direct dependency of this module but ipld-dag-pb changed the
case of some property names that are used by this module.
Alan Shaw added 2 commits May 20, 2019 22:18
@alanshaw
Copy link
Member

alanshaw commented May 21, 2019

I ran these against the branch this PR is blocking and they passed!

ipfs/js-ipfs#2068

$ npm test

> [email protected] test /Users/alan/Code/protocol-labs/js-ipfs-http-response
> aegir test -t node

Test Node.js
Warning: Could not find any test files matching pattern: test/node.js


  resolve file (CIDv0)
Swarm listening on /ip4/127.0.0.1/tcp/57336/ipfs/QmVcSypeVpVEeCWZe6p9JJGun2mb8ewYYY7XTntrK7NcCU
Swarm listening on /p2p-circuit/ipfs/QmVcSypeVpVEeCWZe6p9JJGun2mb8ewYYY7XTntrK7NcCU
Swarm listening on /p2p-circuit/ip4/127.0.0.1/tcp/57336/ipfs/QmVcSypeVpVEeCWZe6p9JJGun2mb8ewYYY7XTntrK7NcCU
    ✓ should resolve a CIDv0

  resolve file (CIDv1)
Swarm listening on /ip4/127.0.0.1/tcp/57353/ipfs/QmTkRo8dNBeVC7UFt2gcVRUXfUHAKsKWb36Bd1qanagjUu
Swarm listening on /p2p-circuit/ipfs/QmTkRo8dNBeVC7UFt2gcVRUXfUHAKsKWb36Bd1qanagjUu
Swarm listening on /p2p-circuit/ip4/127.0.0.1/tcp/57353/ipfs/QmTkRo8dNBeVC7UFt2gcVRUXfUHAKsKWb36Bd1qanagjUu
    ✓ should resolve a CIDv1

  resolve directory (CIDv0)
Swarm listening on /ip4/127.0.0.1/tcp/57370/ipfs/QmPwMq8W2EVEYo7oL3wksdTPfN3gjYGacUMgkwjcZEvWGq
Swarm listening on /p2p-circuit/ipfs/QmPwMq8W2EVEYo7oL3wksdTPfN3gjYGacUMgkwjcZEvWGq
Swarm listening on /p2p-circuit/ip4/127.0.0.1/tcp/57370/ipfs/QmPwMq8W2EVEYo7oL3wksdTPfN3gjYGacUMgkwjcZEvWGq
    ✓ should return the list of files of a directory
    ✓ should return the pp.txt file
    ✓ should return the holmes.txt file

  resolve directory (CIDv1)
Swarm listening on /ip4/127.0.0.1/tcp/57397/ipfs/QmcbeinnyxFKPfqd1dJcxrpnJoKRr4xTYSHZGGAmi3JZnV
Swarm listening on /p2p-circuit/ipfs/QmcbeinnyxFKPfqd1dJcxrpnJoKRr4xTYSHZGGAmi3JZnV
Swarm listening on /p2p-circuit/ip4/127.0.0.1/tcp/57397/ipfs/QmcbeinnyxFKPfqd1dJcxrpnJoKRr4xTYSHZGGAmi3JZnV
    ✓ should return the list of files of a directory
    ✓ should return the pp.txt file
    ✓ should return the holmes.txt file

  resolve web page (CIDv0)
Swarm listening on /ip4/127.0.0.1/tcp/57428/ipfs/QmUPaf78raFjSjmsTAJAUzjSJHoCgkFZRG2BoUmDELHrNP
Swarm listening on /p2p-circuit/ipfs/QmUPaf78raFjSjmsTAJAUzjSJHoCgkFZRG2BoUmDELHrNP
Swarm listening on /p2p-circuit/ip4/127.0.0.1/tcp/57428/ipfs/QmUPaf78raFjSjmsTAJAUzjSJHoCgkFZRG2BoUmDELHrNP
    ✓ should return the entry point of a web page when a trying to fetch a directory containing a web page

  resolve web page (CIDv1)
Swarm listening on /ip4/127.0.0.1/tcp/57452/ipfs/QmR5QkaFjPdNHCaqqNVNtheLy6eHLxhWKoBY5GvYXZTJZz
Swarm listening on /p2p-circuit/ipfs/QmR5QkaFjPdNHCaqqNVNtheLy6eHLxhWKoBY5GvYXZTJZz
Swarm listening on /p2p-circuit/ip4/127.0.0.1/tcp/57452/ipfs/QmR5QkaFjPdNHCaqqNVNtheLy6eHLxhWKoBY5GvYXZTJZz
    ✓ should return the entry point of a web page when a trying to fetch a directory containing a web page

  mime-types
Swarm listening on /ip4/127.0.0.1/tcp/57481/ipfs/QmPwvoyJaTqWh2WinmANMWtrzPSTcx9oXSk6f8MeX2Yi97
Swarm listening on /p2p-circuit/ipfs/QmPwvoyJaTqWh2WinmANMWtrzPSTcx9oXSk6f8MeX2Yi97
Swarm listening on /p2p-circuit/ip4/127.0.0.1/tcp/57481/ipfs/QmPwvoyJaTqWh2WinmANMWtrzPSTcx9oXSk6f8MeX2Yi97
    ✓ should return the correct mime-type for pp.txt
    ✓ should return the correct mime-type for cat.jpg
    ✓ should return the correct mime-type for index.html
    ✓ should return the correct mime-type for hexagons.svg
    ✓ should return the correct mime-type for hexagons.svg

  resolve file (CIDv0)
Swarm listening on /ip4/127.0.0.1/tcp/57523/ipfs/QmaUQHJJVFSmRDC8sKZ1fyhKigLY4A8UVu47SCqxiE3pgT
Swarm listening on /p2p-circuit/ipfs/QmaUQHJJVFSmRDC8sKZ1fyhKigLY4A8UVu47SCqxiE3pgT
Swarm listening on /p2p-circuit/ip4/127.0.0.1/tcp/57523/ipfs/QmaUQHJJVFSmRDC8sKZ1fyhKigLY4A8UVu47SCqxiE3pgT
    ✓ should resolve a multihash
    ✓ should resolve a cid

  resolve file (CIDv1)
Swarm listening on /ip4/127.0.0.1/tcp/57554/ipfs/QmQNFbfhNfVbwjz7mhWCnEDM5wFHzFZppeJbwbuwGbBsFG
Swarm listening on /p2p-circuit/ipfs/QmQNFbfhNfVbwjz7mhWCnEDM5wFHzFZppeJbwbuwGbBsFG
Swarm listening on /p2p-circuit/ip4/127.0.0.1/tcp/57554/ipfs/QmQNFbfhNfVbwjz7mhWCnEDM5wFHzFZppeJbwbuwGbBsFG
    ✓ should resolve a multihash
    ✓ should resolve a cid

  resolve directory (CIDv0)
Swarm listening on /ip4/127.0.0.1/tcp/57585/ipfs/QmTUQWkn7fmPPHwkTREFpsjRZYYBHgoUC4svJ52NRpVTnZ
Swarm listening on /p2p-circuit/ipfs/QmTUQWkn7fmPPHwkTREFpsjRZYYBHgoUC4svJ52NRpVTnZ
Swarm listening on /p2p-circuit/ip4/127.0.0.1/tcp/57585/ipfs/QmTUQWkn7fmPPHwkTREFpsjRZYYBHgoUC4svJ52NRpVTnZ
    ✓ should throw an error when trying to fetch a directory
    ✓ should return HTML listing of files of a directory

  resolve directory (CIDv1)
Swarm listening on /ip4/127.0.0.1/tcp/57620/ipfs/QmbmZDnRqSKBKVDq63Eknpi2LibyByf8cot4gzorxCgChL
Swarm listening on /p2p-circuit/ipfs/QmbmZDnRqSKBKVDq63Eknpi2LibyByf8cot4gzorxCgChL
Swarm listening on /p2p-circuit/ip4/127.0.0.1/tcp/57620/ipfs/QmbmZDnRqSKBKVDq63Eknpi2LibyByf8cot4gzorxCgChL
    ✓ should throw an error when trying to fetch a directory
    ✓ should return HTML listing of files of a directory

  resolve web page (CIDv0)
Swarm listening on /ip4/127.0.0.1/tcp/57655/ipfs/QmNhCxtWxu1u816T7z655RdhSiKonh7ammQwKwhZdipTGr
Swarm listening on /p2p-circuit/ipfs/QmNhCxtWxu1u816T7z655RdhSiKonh7ammQwKwhZdipTGr
Swarm listening on /p2p-circuit/ip4/127.0.0.1/tcp/57655/ipfs/QmNhCxtWxu1u816T7z655RdhSiKonh7ammQwKwhZdipTGr
    ✓ should throw an error when trying to fetch a directory containing a web page
    ✓ should return the entry point of a web page when a trying to fetch a directory containing a web page

  resolve web page (CIDv1)
Swarm listening on /ip4/127.0.0.1/tcp/57694/ipfs/QmStQAv2qzENUTGy9zsnx9sYZBJ9BLgwkHySDYFSzfPXnW
Swarm listening on /p2p-circuit/ipfs/QmStQAv2qzENUTGy9zsnx9sYZBJ9BLgwkHySDYFSzfPXnW
Swarm listening on /p2p-circuit/ip4/127.0.0.1/tcp/57694/ipfs/QmStQAv2qzENUTGy9zsnx9sYZBJ9BLgwkHySDYFSzfPXnW
    ✓ should throw an error when trying to fetch a directory containing a web page
    ✓ should return the entry point of a web page when a trying to fetch a directory containing a web page


  27 passing (9s)

Copy link
Member

@vasco-santos vasco-santos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes look good to me!

@vasco-santos vasco-santos merged commit 529613a into master May 21, 2019
@vasco-santos vasco-santos deleted the update-ipld-formats branch May 21, 2019 10:56
alanshaw pushed a commit to ipfs/js-ipfs that referenced this pull request May 21, 2019
…2068)

This is part of the Awesome Endeavour: Async Iterators: #1670

Depends on

* [x] ipld/js-ipld-dag-pb#137
* [x] ipfs-inactive/interface-js-ipfs-core#473
* [x] ipfs-inactive/js-ipfs-http-client#1010
* [x] ipfs/js-ipfs-http-response#25

resolves #1995

BREAKING CHANGE: The default string encoding for version 1 CIDs has changed to `base32`.

IPLD formats have been updated to the latest versions. IPLD nodes returned by `ipfs.dag` and `ipfs.object` commands have significant breaking changes. If you are using these commands in your application you are likely to encounter the following changes to `dag-pb` nodes (the default node type that IPFS creates):

* `DAGNode` properties have been renamed as follows:
    * `data` => `Data`
    * `links` => `Links`
    * `size` => `size` (Note: no change)
* `DAGLink` properties have been renamed as follows:
    * `cid` => `Hash`
    * `name` => `Name`
    * `size` => `Tsize`

See CHANGELOGs for each IPLD format for it's respective changes, you can read more about the [`dag-pb` changes in the CHANGELOG](https:/ipld/js-ipld-dag-pb/blob/master)

License: MIT
Signed-off-by: Alan Shaw <[email protected]>
@vasco-santos vasco-santos mentioned this pull request May 21, 2019
1 task
oliveriosousa pushed a commit to ipfs-examples/js-ipfs-examples that referenced this pull request Jul 26, 2021
…#2068)

This is part of the Awesome Endeavour: Async Iterators: ipfs/js-ipfs#1670

Depends on

* [x] ipld/js-ipld-dag-pb#137
* [x] ipfs-inactive/interface-js-ipfs-core#473
* [x] ipfs-inactive/js-ipfs-http-client#1010
* [x] ipfs/js-ipfs-http-response#25

resolves #1995

BREAKING CHANGE: The default string encoding for version 1 CIDs has changed to `base32`.

IPLD formats have been updated to the latest versions. IPLD nodes returned by `ipfs.dag` and `ipfs.object` commands have significant breaking changes. If you are using these commands in your application you are likely to encounter the following changes to `dag-pb` nodes (the default node type that IPFS creates):

* `DAGNode` properties have been renamed as follows:
    * `data` => `Data`
    * `links` => `Links`
    * `size` => `size` (Note: no change)
* `DAGLink` properties have been renamed as follows:
    * `cid` => `Hash`
    * `name` => `Name`
    * `size` => `Tsize`

See CHANGELOGs for each IPLD format for it's respective changes, you can read more about the [`dag-pb` changes in the CHANGELOG](https:/ipld/js-ipld-dag-pb/blob/master)

License: MIT
Signed-off-by: Alan Shaw <[email protected]>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants