1
0
mirror of https://github.com/kremalicious/blog.git synced 2024-11-29 07:26:22 +01:00
blog/.jest/__fixtures__/posts.json

357 lines
72 KiB
JSON
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

{
"allMarkdownRemark": {
"edges": [
{
"node": {
"id": "6effe45d-0884-527c-9fba-6f7f567979fd",
"fileAbsolutePath": "/Users/m/Code/blog/content/photos/2019-11-03-orszaghaz-ii.md",
"html": "<p>Inside the Hungarian Parliament Building in Budapest, Hungary.</p>",
"excerpt": "Inside the Hungarian Parliament Building in Budapest, Hungary.",
"frontmatter": {
"title": "Országház II",
"linkurl": null,
"tags": null,
"image": {
"childImageSharp": {
"original": {
"src": "/static/2019-11-03-orszaghaz-ii-2dbcf257b4bdf625c24fede935d32425.jpg"
},
"fluid": {
"aspectRatio": 2.3255813953488373,
"src": "/static/2dbcf257b4bdf625c24fede935d32425/ef7a0/2019-11-03-orszaghaz-ii.jpg",
"srcSet": "/static/2dbcf257b4bdf625c24fede935d32425/23780/2019-11-03-orszaghaz-ii.jpg 100w,\n/static/2dbcf257b4bdf625c24fede935d32425/02ed9/2019-11-03-orszaghaz-ii.jpg 200w,\n/static/2dbcf257b4bdf625c24fede935d32425/ef7a0/2019-11-03-orszaghaz-ii.jpg 400w,\n/static/2dbcf257b4bdf625c24fede935d32425/ac974/2019-11-03-orszaghaz-ii.jpg 600w,\n/static/2dbcf257b4bdf625c24fede935d32425/12c26/2019-11-03-orszaghaz-ii.jpg 800w,\n/static/2dbcf257b4bdf625c24fede935d32425/24914/2019-11-03-orszaghaz-ii.jpg 3793w",
"srcWebp": "/static/2dbcf257b4bdf625c24fede935d32425/a93fc/2019-11-03-orszaghaz-ii.webp",
"srcSetWebp": "/static/2dbcf257b4bdf625c24fede935d32425/b0720/2019-11-03-orszaghaz-ii.webp 100w,\n/static/2dbcf257b4bdf625c24fede935d32425/f6188/2019-11-03-orszaghaz-ii.webp 200w,\n/static/2dbcf257b4bdf625c24fede935d32425/a93fc/2019-11-03-orszaghaz-ii.webp 400w,\n/static/2dbcf257b4bdf625c24fede935d32425/7c0bb/2019-11-03-orszaghaz-ii.webp 600w,\n/static/2dbcf257b4bdf625c24fede935d32425/d1e4e/2019-11-03-orszaghaz-ii.webp 800w,\n/static/2dbcf257b4bdf625c24fede935d32425/0a478/2019-11-03-orszaghaz-ii.webp 3793w",
"sizes": "(max-width: 400px) 100vw, 400px",
"originalImg": "/static/2dbcf257b4bdf625c24fede935d32425/24914/2019-11-03-orszaghaz-ii.jpg",
"originalName": "2019-11-03-orszaghaz-ii.jpg",
"presentationWidth": 400,
"presentationHeight": 300
}
}
}
},
"fields": {
"slug": "/orszaghaz-ii/",
"date": "November 03, 2019",
"type": "photo"
}
}
},
{
"node": {
"id": "c80697e5-681d-5fcc-9dab-c3a3821ff0b1",
"fileAbsolutePath": "/Users/m/Code/blog/content/photos/2019-11-02-orszaghaz-i.md",
"html": "<p>The Hungarian Parliament Building seen from across the Danube in Budapest, Hungary.</p>",
"excerpt": "The Hungarian Parliament Building seen from across the Danube in Budapest, Hungary.",
"frontmatter": {
"title": "Országház I",
"linkurl": null,
"tags": null,
"featured": true,
"image": {
"childImageSharp": {
"original": {
"src": "/static/2019-11-02-orszaghaz-i-36d87329aeeda296ae923606e5a4a785.jpg"
},
"fluid": {
"aspectRatio": 2.3255813953488373,
"src": "/static/36d87329aeeda296ae923606e5a4a785/ef7a0/2019-11-02-orszaghaz-i.jpg",
"srcSet": "/static/36d87329aeeda296ae923606e5a4a785/23780/2019-11-02-orszaghaz-i.jpg 100w,\n/static/36d87329aeeda296ae923606e5a4a785/02ed9/2019-11-02-orszaghaz-i.jpg 200w,\n/static/36d87329aeeda296ae923606e5a4a785/ef7a0/2019-11-02-orszaghaz-i.jpg 400w,\n/static/36d87329aeeda296ae923606e5a4a785/ac974/2019-11-02-orszaghaz-i.jpg 600w,\n/static/36d87329aeeda296ae923606e5a4a785/12c26/2019-11-02-orszaghaz-i.jpg 800w,\n/static/36d87329aeeda296ae923606e5a4a785/b9e8b/2019-11-02-orszaghaz-i.jpg 3708w",
"srcWebp": "/static/36d87329aeeda296ae923606e5a4a785/a93fc/2019-11-02-orszaghaz-i.webp",
"srcSetWebp": "/static/36d87329aeeda296ae923606e5a4a785/b0720/2019-11-02-orszaghaz-i.webp 100w,\n/static/36d87329aeeda296ae923606e5a4a785/f6188/2019-11-02-orszaghaz-i.webp 200w,\n/static/36d87329aeeda296ae923606e5a4a785/a93fc/2019-11-02-orszaghaz-i.webp 400w,\n/static/36d87329aeeda296ae923606e5a4a785/7c0bb/2019-11-02-orszaghaz-i.webp 600w,\n/static/36d87329aeeda296ae923606e5a4a785/d1e4e/2019-11-02-orszaghaz-i.webp 800w,\n/static/36d87329aeeda296ae923606e5a4a785/730f8/2019-11-02-orszaghaz-i.webp 3708w",
"sizes": "(max-width: 400px) 100vw, 400px",
"originalImg": "/static/36d87329aeeda296ae923606e5a4a785/b9e8b/2019-11-02-orszaghaz-i.jpg",
"originalName": "2019-11-02-orszaghaz-i.jpg",
"presentationWidth": 400,
"presentationHeight": 297
}
}
}
},
"fields": {
"slug": "/orszaghaz-i/",
"date": "November 02, 2019",
"type": "photo"
}
}
},
{
"node": {
"id": "2e2c9611-be7b-5bc0-a72b-6c63e2072b5a",
"fileAbsolutePath": "/Users/m/Code/blog/content/posts/2019-10-24-ocean-protocol-and-ipfs-sitting-in-the-merkle-tree/index.md",
"html": "<p>IPFS is now integrated into the Ocean Protocol stack, allowing you to take advantage of decentralized asset file hosting.</p>\n<hr>\n<blockquote>\n<p>This article was originally posted <a href=\"https://blog.oceanprotocol.com/ocean-ipfs-integration-store-asset-files-43c623c356d7\">on Medium in the Ocean Protocol blog</a>.</p>\n</blockquote>\n<hr>\n<h2 id=\"-going-decentralized\"><a href=\"#-going-decentralized\" aria-label=\" going decentralized permalink\" class=\"anchor\"><span>#</span></a>✨ Going Decentralized</h2>\n<p>With Ocean Protocol, you can use centralized storage services like S3, Azure Storage, or your own On-Premise storage to store and retrieve your asset files through <a href=\"https://docs.oceanprotocol.com/concepts/components/#osmosis-drivers\">Osmosis drivers in Brizo</a>.</p>\n<p>But storing asset files in a centralized service poses multiple problems:</p>\n<ul>\n<li>one entity controls the data</li>\n<li>one entity is legally responsible for all stored data</li>\n<li>creates a single point of failure</li>\n<li>if service goes offline, asset files cant be consumed</li>\n<li>opening up possibilities of censorship by the entity running the service, or the service itself</li>\n<li>if files are moved to another location within the same service, existing URLs break</li>\n</ul>\n<p>Initially created to store and efficiently move scientific data sets, the <a href=\"https://ipfs.io/\">InterPlanetary File System (IPFS)</a> solves all those issues with its goal of transforming the vastly centralized web into a distributed peer-to-peer network.</p>\n<p>Files are distributed among multiple nodes, eliminating the single point of failure, legal, and censorship issues. By using content-based instead of location-based addressing of files, URLs wont break if files are moved.</p>\n<p>So we defined <a href=\"https://github.com/oceanprotocol/OEPs/tree/master/15\">OEP-15</a> to make the <code>ipfs://</code> protocol a first-class citizen in the Ocean Protocol stack, allowing you to store asset files on IPFS, and use their native IPFS URLs during the publish process.</p>\n<ul>\n<li><a href=\"https://github.com/oceanprotocol/OEPs/tree/master/15\"><strong>OEP-15: oceanprotocol/OEPs</strong></a></li>\n</ul>\n<p>In short, every component in the Ocean Protocol stack now supports publishing and consuming of asset files stored in IPFS which includes support for native IPFS URLs, referencing files with their Content Identifiers (CIDs).</p>\n<h2 id=\"-ipfs-in-commons-marketplace\"><a href=\"#%EF%B8%8F-ipfs-in-commons-marketplace\" aria-label=\" ipfs in commons marketplace permalink\" class=\"anchor\"><span>#</span></a>⛲️ IPFS in Commons Marketplace</h2>\n<p>Every file stored on IPFS is public by default, so it made perfect sense using this in our <a href=\"https://commons.oceanprotocol.com\">Commons Marketplace</a> first. We went through <a href=\"https://github.com/oceanprotocol/commons/pull/191\">multiple prototypes</a> to end up with our final setup.</p>\n<p>During the publish flow you will find an extended <em>Files</em> section for adding a file from an existing URL, and for adding a local file from your device to IPFS.</p>\n<p><figure class=\"gatsby-resp-image-figure\" style=\"\">\n <span\n class=\"gatsby-resp-image-wrapper\"\n style=\"position: relative; display: block; margin-left: auto; margin-right: auto; max-width: 630px;\"\n >\n <a\n class=\"gatsby-resp-image-link\"\n href=\"/static/5ec4122379d5c270cd7d899b02d8512e/67be7/add-url.png\"\n style=\"display: block\"\n target=\"_blank\"\n rel=\"noopener\"\n >\n <span\n class=\"gatsby-resp-image-background-image\"\n style=\"padding-bottom: 49.59128065395095%; position: relative; bottom: 0; left: 0; background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAKCAIAAAA7N+mxAAAACXBIWXMAAAsSAAALEgHS3X78AAABK0lEQVQoz5VR207CQBDl/79FXww8aMSEmGBiwpsKLeX+AtKWYvc+lzpbML4Y1Mns7OzMnpzZsx1mVkpZY5t/GhF1GuZaqfL44QNY55W1LgTjvLFOGzn4S2AkaoipMmgDOggHBZVGF4gYpSfdC+DYRwQfGm5rEonP+Y8YZnGxCJbNO7+ab6qiyrd5vsvL96LY5fl2L0nZHg/7mEix2O51VbtaC5mMG5kRcJMuN8v1LMmmb8kqm8+TLJukkmTjdJFki3QWK+N0+jqpy4q1B+2E/zQ2iUTBeHkzWK+PWh2UrY0SEmWagOxB4snRejCOWj3i2Na5Xn94N3ju3Q+fRi9IGABODii3vh1aUKsjnb/KGHvdfbi5fbzq9gfDEUcFf7EzWJaQfwndbn8zAX4CfqNBBsnjvIAAAAAASUVORK5CYII='); background-size: cover; display: block;\"\n ></span>\n <img\n class=\"gatsby-resp-image-image\"\n alt=\"Add existing IPFS asset under commons.oceanprotocol.com/publish\"\n title=\"Add existing IPFS asset under commons.oceanprotocol.com/publish\"\n src=\"/static/5ec4122379d5c270cd7d899b02d8512e/0f489/add-url.png\"\n srcset=\"/static/5ec4122379d5c270cd7d899b02d8512e/896af/add-url.png 158w,\n/static/5ec4122379d5c270cd7d899b02d8512e/b70ff/add-url.png 315w,\n/static/5ec4122379d5c270cd7d899b02d8512e/0f489/add-url.png 630w,\n/static/5ec4122379d5c270cd7d899b02d8512e/85b6f/add-url.png 945w,\n/static/5ec4122379d5c270cd7d899b02d8512e/4d498/add-url.png 1260w,\n/static/5ec4122379d5c270cd7d899b02d8512e/67be7/add-url.png 1468w\"\n sizes=\"(max-width: 630px) 100vw, 630px\"\n loading=\"lazy\"\n />\n </a>\n </span>\n <figcaption class=\"gatsby-resp-image-figcaption\">Add existing IPFS asset under commons.oceanprotocol.com/publish</figcaption>\n </figure></p>\n<p>The existing URL field now supports <code>ipfs://</code> in addition to <code>http(s)://</code> so if you have an existing asset on IPFS, you can add it here and everything works as before. With the exception that the asset files will be registered with this native IPFS URL.</p>\n<p>The new IPFS drop zone provides a convenient way to add and register unpublished asset files.</p>\n<p><figure class=\"gatsby-resp-image-figure\" style=\"\">\n <span\n class=\"gatsby-resp-image-wrapper\"\n style=\"position: relative; display: block; margin-left: auto; margin-right: auto; max-width: 630px;\"\n >\n <a\n class=\"gatsby-resp-image-link\"\n href=\"/static/a539c11bfabc0066e1bae9e4ad1eaf7f/8ade4/add-to-ipfs.png\"\n style=\"display: block\"\n target=\"_blank\"\n rel=\"noopener\"\n >\n <span\n class=\"gatsby-resp-image-background-image\"\n style=\"padding-bottom: 53.036437246963565%; position: relative; bottom: 0; left: 0; background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAALCAIAAADwazoUAAAACXBIWXMAAAsSAAALEgHS3X78AAAAzklEQVQoz5WR4ZLDIAiE+/4vmvTX5aKCUCBFbG2auWTmdkxGHb9VlltKeVl+t3/KzETkhpWWlJAZiTNUIIJKgLUA+lDVK9jUrJCuuPlBZPnJyuJ7GjLbrmEta85ryjkzsfJDRRoW40wv2GfTfJ/meZrmUsC5x4lkpw9s78e9XY//rkG60QduTh028/wqMUZmRNznfXMUPLy+bo4k2nJoX/jYlAilw4IVq3s3e78tvtC+zkP9r2eLSkEAxN5biPaWtsRDSH8EZmetjGZeyOEngH+JK7oEzFwAAAAASUVORK5CYII='); background-size: cover; display: block;\"\n ></span>\n <img\n class=\"gatsby-resp-image-image\"\n alt=\"Add to IPFS from a local file under commons.oceanprotocol.com/publish\"\n title=\"Add to IPFS from a local file under commons.oceanprotocol.com/publish\"\n src=\"/static/a539c11bfabc0066e1bae9e4ad1eaf7f/0f489/add-to-ipfs.png\"\n srcset=\"/static/a539c11bfabc0066e1bae9e4ad1eaf7f/896af/add-to-ipfs.png 158w,\n/static/a539c11bfabc0066e1bae9e4ad1eaf7f/b70ff/add-to-ipfs.png 315w,\n/static/a539c11bfabc0066e1bae9e4ad1eaf7f/0f489/add-to-ipfs.png 630w,\n/static/a539c11bfabc0066e1bae9e4ad1eaf7f/85b6f/add-to-ipfs.png 945w,\n/static/a539c11bfabc0066e1bae9e4ad1eaf7f/4d498/add-to-ipfs.png 1260w,\n/static/a539c11bfabc0066e1bae9e4ad1eaf7f/8ade4/add-to-ipfs.png 1482w\"\n sizes=\"(max-width: 630px) 100vw, 630px\"\n loading=\"lazy\"\n />\n </a>\n </span>\n <figcaption class=\"gatsby-resp-image-figcaption\">Add to IPFS from a local file under commons.oceanprotocol.com/publish</figcaption>\n </figure></p>\n<p>That drop zone allows you to add a file from your local machine and add it to IPFS during the asset publish flow in a snap:</p>\n<p><img src=\"/media/e43b135d9da99ac8a07ba1897f368258/add.gif\" alt=\"The full IPFS adding flow\"></p>\n<h3 id=\"the-tech-details\"><a href=\"#the-tech-details\" aria-label=\"the tech details permalink\" class=\"anchor\"><span>#</span></a>The Tech Details</h3>\n<p>First, opening up the drop zone area will ping the IPFS node &#x26; gateway to check connectivity. Dropping or selecting a file from your device onto that area does a bunch of things in the background:</p>\n<ol>\n<li>Will add that file to an IPFS node with <a href=\"https://github.com/ipfs/js-ipfs-http-client\">js-ipfs-http-client</a>, and pin the file so it stays on our node during garbage collection. We wrapped the HTTP client into our own <a href=\"https://github.com/oceanprotocol/commons/tree/master/client/src/hooks/use-ipfs-api.tsx\">custom React Hook</a>.</li>\n<li>The file will be wrapped into a directory to preserve the original file name, so we end up with a URL like <code>ipfs://QmX5LRpEVocfks9FNDnRoK2imf2fy9mPpP4wfgaDVXWfYD/video.mp4</code>.</li>\n<li>The returned CID is used to ping that file over an IPFS gateway to make it globally available.</li>\n<li>The IPFS gateway URL is passed to our Commons Server file checker, extracting some file metadata and checking for availability of the file.</li>\n<li>The native IPFS url is passed to the list of asset files, and it will show up in the file list.</li>\n<li>Upon final asset publishing, the native IPFS URL is stored encrypted in the asset DID Descriptor Object (DDO) as defined in <a href=\"https://github.com/oceanprotocol/OEPs/blob/master/8\">OEP-8</a>.</li>\n</ol>\n<p>All these steps are required because of how files in IPFS are distributed among its nodes. When adding a file to a node (note how its not called “uploading”) it is only available on that node. Requesting that file from another node will start the distribution process of the file from the initial IPFS node, making it globally available.</p>\n<p>Also the consume flow required some changes. Whenever an asset file stored on IPFS is requested to be downloaded, multiple things related to IPFS are happening in Brizo with its shiny new <a href=\"https://github.com/oceanprotocol/osmosis-ipfs-driver\">osmosis-ipfs-driver</a>:</p>\n<ol>\n<li>The file URLs are decrypted upon successful fulfilling of all conditions.</li>\n<li>The native <code>ipfs://</code> url is mapped to its <code>https://</code> gateway URL.</li>\n<li>File is downloaded from that gateway URL.</li>\n<li>In case a direct file URL was used instead of being folder-wrapped (e.g. <code>ipfs://QmPQNaNxHkasNiJBFZht2k3zCEBkvEu1aE5VNGZ8QiT8Nj</code>), the proper file ending will be added automatically at the end of the download process, based on detected MIME type.</li>\n</ol>\n<h2 id=\"♀️-ocean-protocols-public-ipfs-node--gateway\"><a href=\"#%E2%99%80%EF%B8%8F-ocean-protocols-public-ipfs-node--gateway\" aria-label=\"♀️ ocean protocols public ipfs node gateway permalink\" class=\"anchor\"><span>#</span></a>🏄‍♀️ Ocean Protocols Public IPFS Node &#x26; Gateway</h2>\n<p>While developing this feature, it became clear we need to run our own IPFS node &#x26; gateway to have better control over the whole experience. And donating a node instead of taking away bandwidth from the main IPFS gateway (gateway.ipfs.io) felt like the right thing to do to make Juan happy.</p>\n<p>So we created <strong>ipfs.oceanprotocol.com</strong>, run by us (that is, legally speaking, BigchainDB GmbH).</p>\n<p><figure class=\"gatsby-resp-image-figure\" style=\"\">\n <span\n class=\"gatsby-resp-image-wrapper\"\n style=\"position: relative; display: block; margin-left: auto; margin-right: auto; max-width: 630px;\"\n >\n <a\n class=\"gatsby-resp-image-link\"\n href=\"/static/cd927a5f1ef84118b0e731923330cb4c/42533/ipfs-oceanprotocol.png\"\n style=\"display: block\"\n target=\"_blank\"\n rel=\"noopener\"\n >\n <span\n class=\"gatsby-resp-image-background-image\"\n style=\"padding-bottom: 69.00584795321637%; position: relative; bottom: 0; left: 0; display: block;\"\n ></span>\n <img\n class=\"gatsby-resp-image-image\"\n alt=\"Frontpage for ipfs.oceanprotocol.com\"\n title=\"Frontpage for ipfs.oceanprotocol.com\"\n src=\"/static/cd927a5f1ef84118b0e731923330cb4c/0f489/ipfs-oceanprotocol.png\"\n srcset=\"/static/cd927a5f1ef84118b0e731923330cb4c/896af/ipfs-oceanprotocol.png 158w,\n/static/cd927a5f1ef84118b0e731923330cb4c/b70ff/ipfs-oceanprotocol.png 315w,\n/static/cd927a5f1ef84118b0e731923330cb4c/0f489/ipfs-oceanprotocol.png 630w,\n/static/cd927a5f1ef84118b0e731923330cb4c/85b6f/ipfs-oceanprotocol.png 945w,\n/static/cd927a5f1ef84118b0e731923330cb4c/4d498/ipfs-oceanprotocol.png 1260w,\n/static/cd927a5f1ef84118b0e731923330cb4c/42533/ipfs-oceanprotocol.png 2736w\"\n sizes=\"(max-width: 630px) 100vw, 630px\"\n loading=\"lazy\"\n />\n </a>\n </span>\n <figcaption class=\"gatsby-resp-image-figcaption\">Frontpage for ipfs.oceanprotocol.com</figcaption>\n </figure></p>\n<p>It is setup to be a public gateway, and provide some access to its node HTTP API for everyone. This means you can use it to address any content in the IPFS network, like:</p>\n<ul>\n<li><a href=\"https://ipfs.oceanprotocol.com/ipfs/QmX5LRpEVocfks9FNDnRoK2imf2fy9mPpP4wfgaDVXWfYD/video.mp4\">https://ipfs.oceanprotocol.com/ipfs/QmX5LRpEVocfks9FNDnRoK2imf2fy9mPpP4wfgaDVXWfYD/video.mp4</a></li>\n<li><a href=\"https://ipfs.oceanprotocol.com/ipfs/QmPQNaNxHkasNiJBFZht2k3zCEBkvEu1aE5VNGZ8QiT8Nj\">https://ipfs.oceanprotocol.com/ipfs/QmPQNaNxHkasNiJBFZht2k3zCEBkvEu1aE5VNGZ8QiT8Nj</a></li>\n</ul>\n<p>At the same time all node API functionality required by Commons is open to the world, so those endpoints can be used by anyone to add files to IPFS:</p>\n<ul>\n<li><code>/api/v0/add</code></li>\n<li><code>/api/v0/version</code></li>\n<li><code>/api/v0/id</code></li>\n</ul>\n<p>As a start, this is a simple single node but we plan to gradually upgrade ipfs.oceanprotocol.com to a full <a href=\"https://cluster.ipfs.io/\">IPFS Cluster</a> of multiple nodes for best data availability.</p>\n<ul>\n<li><a href=\"https://github.com/oceanprotocol/ipfs\"><strong>GitHub: oceanprotocol/ipfs</strong></a></li>\n</ul>\n<h2 id=\"-next-possible-iterations\"><a href=\"#-next-possible-iterations\" aria-label=\" next possible iterations permalink\" class=\"anchor\"><span>#</span></a>⛴ Next Possible Iterations</h2>\n<p>Beside upgrading to an IPFS Cluster there are many ways the process will be improved over time. At the moment the drop zone in Commons only supports single file uploads, so a quick win improvement would be to allow dropping multiple files at once. Likewise, the drop zone using <a href=\"https://github.com/ipfs/js-ipfs-http-client\">js-ipfs-http-client</a> comes with some bugs when trying to upload larger files.</p>\n<p>To make the process of adding files to the IPFS node less dependent on the client browser, it could be moved into a background task in the Commons Server. This should also give more control and feedback for the process of distributing a file from the initial node to other nodes.</p>\n<p>And finally, further work may be done to store files encrypted on IPFS and implement a way to decrypt them in an Ocean Protocol network.</p>\n<hr>\n<h2 id=\"learn-more-about-the-commons-marketplace\"><a href=\"#learn-more-about-the-commons-marketplace\" aria-label=\"learn more about the commons marketplace permalink\" class=\"anchor\"><span>#</span></a>Learn more about the Commons Marketplace</h2>\n<ul>\n<li><a href=\"/the-commons-marketplace-in-pacific-network\"><strong>The Commons Marketplace in Pacific Network</strong></a></li>\n<li><a href=\"/the-commons-data-marketplace\"><strong>The Commons Data Marketplace</strong></a></li>\n</ul>\n<hr>\n<blockquote>\n<p>This article was originally posted <a href=\"https://blog.oceanprotocol.com/ocean-ipfs-integration-store-asset-files-43c623c356d7\">on Medium in the Ocean Protocol blog</a>.</p>\n</blockquote>\n<hr>",
"excerpt": "IPFS is now integrated into the Ocean Protocol stack, allowing you to take advantage of decentralized asset file hosting. This article was originally posted on Medium in the Ocean Protocol blog. ✨ Going Decentralized With Ocean Protocol, you can use…",
"frontmatter": {
"title": "Ocean Protocol and IPFS, Sitting In The Merkle Tree",
"linkurl": null,
"tags": ["oceanprotocol", "blockchain", "design", "ipfs", "web3"],
"image": {
"childImageSharp": {
"original": {
"src": "/static/ocean-protocol-and-ipfs-sitting-in-the-merkle-tree-teaser-f724bdaae38e81ec90b01ec6b8412cc8.png"
},
"fluid": {
"aspectRatio": 2.3255813953488373,
"src": "/static/f724bdaae38e81ec90b01ec6b8412cc8/687f7/ocean-protocol-and-ipfs-sitting-in-the-merkle-tree-teaser.png",
"srcSet": "/static/f724bdaae38e81ec90b01ec6b8412cc8/90a60/ocean-protocol-and-ipfs-sitting-in-the-merkle-tree-teaser.png 100w,\n/static/f724bdaae38e81ec90b01ec6b8412cc8/c23b6/ocean-protocol-and-ipfs-sitting-in-the-merkle-tree-teaser.png 200w,\n/static/f724bdaae38e81ec90b01ec6b8412cc8/687f7/ocean-protocol-and-ipfs-sitting-in-the-merkle-tree-teaser.png 400w,\n/static/f724bdaae38e81ec90b01ec6b8412cc8/a9eb1/ocean-protocol-and-ipfs-sitting-in-the-merkle-tree-teaser.png 600w,\n/static/f724bdaae38e81ec90b01ec6b8412cc8/9a629/ocean-protocol-and-ipfs-sitting-in-the-merkle-tree-teaser.png 800w,\n/static/f724bdaae38e81ec90b01ec6b8412cc8/5956c/ocean-protocol-and-ipfs-sitting-in-the-merkle-tree-teaser.png 2000w",
"srcWebp": "/static/f724bdaae38e81ec90b01ec6b8412cc8/a93fc/ocean-protocol-and-ipfs-sitting-in-the-merkle-tree-teaser.webp",
"srcSetWebp": "/static/f724bdaae38e81ec90b01ec6b8412cc8/b0720/ocean-protocol-and-ipfs-sitting-in-the-merkle-tree-teaser.webp 100w,\n/static/f724bdaae38e81ec90b01ec6b8412cc8/f6188/ocean-protocol-and-ipfs-sitting-in-the-merkle-tree-teaser.webp 200w,\n/static/f724bdaae38e81ec90b01ec6b8412cc8/a93fc/ocean-protocol-and-ipfs-sitting-in-the-merkle-tree-teaser.webp 400w,\n/static/f724bdaae38e81ec90b01ec6b8412cc8/7c0bb/ocean-protocol-and-ipfs-sitting-in-the-merkle-tree-teaser.webp 600w,\n/static/f724bdaae38e81ec90b01ec6b8412cc8/d1e4e/ocean-protocol-and-ipfs-sitting-in-the-merkle-tree-teaser.webp 800w,\n/static/f724bdaae38e81ec90b01ec6b8412cc8/eb8cf/ocean-protocol-and-ipfs-sitting-in-the-merkle-tree-teaser.webp 2000w",
"sizes": "(max-width: 400px) 100vw, 400px",
"originalImg": "/static/f724bdaae38e81ec90b01ec6b8412cc8/5956c/ocean-protocol-and-ipfs-sitting-in-the-merkle-tree-teaser.png",
"originalName": "ocean-protocol-and-ipfs-sitting-in-the-merkle-tree-teaser.png",
"presentationWidth": 400,
"presentationHeight": 140
}
}
}
},
"fields": {
"slug": "/ocean-protocol-and-ipfs-sitting-in-the-merkle-tree",
"date": "October 24, 2019",
"type": "post"
}
}
}
]
},
"allArticles": {
"edges": [
{
"node": {
"id": "6effe45d-0884-527c-9fba-6f7f567979fd",
"fileAbsolutePath": "/Users/m/Code/blog/content/photos/2019-11-03-orszaghaz-ii.md",
"html": "<p>Inside the Hungarian Parliament Building in Budapest, Hungary.</p>",
"excerpt": "Inside the Hungarian Parliament Building in Budapest, Hungary.",
"frontmatter": {
"title": "Országház II",
"linkurl": null,
"tags": null,
"image": {
"childImageSharp": {
"original": {
"src": "/static/2019-11-03-orszaghaz-ii-2dbcf257b4bdf625c24fede935d32425.jpg"
},
"fluid": {
"aspectRatio": 2.3255813953488373,
"src": "/static/2dbcf257b4bdf625c24fede935d32425/ef7a0/2019-11-03-orszaghaz-ii.jpg",
"srcSet": "/static/2dbcf257b4bdf625c24fede935d32425/23780/2019-11-03-orszaghaz-ii.jpg 100w,\n/static/2dbcf257b4bdf625c24fede935d32425/02ed9/2019-11-03-orszaghaz-ii.jpg 200w,\n/static/2dbcf257b4bdf625c24fede935d32425/ef7a0/2019-11-03-orszaghaz-ii.jpg 400w,\n/static/2dbcf257b4bdf625c24fede935d32425/ac974/2019-11-03-orszaghaz-ii.jpg 600w,\n/static/2dbcf257b4bdf625c24fede935d32425/12c26/2019-11-03-orszaghaz-ii.jpg 800w,\n/static/2dbcf257b4bdf625c24fede935d32425/24914/2019-11-03-orszaghaz-ii.jpg 3793w",
"srcWebp": "/static/2dbcf257b4bdf625c24fede935d32425/a93fc/2019-11-03-orszaghaz-ii.webp",
"srcSetWebp": "/static/2dbcf257b4bdf625c24fede935d32425/b0720/2019-11-03-orszaghaz-ii.webp 100w,\n/static/2dbcf257b4bdf625c24fede935d32425/f6188/2019-11-03-orszaghaz-ii.webp 200w,\n/static/2dbcf257b4bdf625c24fede935d32425/a93fc/2019-11-03-orszaghaz-ii.webp 400w,\n/static/2dbcf257b4bdf625c24fede935d32425/7c0bb/2019-11-03-orszaghaz-ii.webp 600w,\n/static/2dbcf257b4bdf625c24fede935d32425/d1e4e/2019-11-03-orszaghaz-ii.webp 800w,\n/static/2dbcf257b4bdf625c24fede935d32425/0a478/2019-11-03-orszaghaz-ii.webp 3793w",
"sizes": "(max-width: 400px) 100vw, 400px",
"originalImg": "/static/2dbcf257b4bdf625c24fede935d32425/24914/2019-11-03-orszaghaz-ii.jpg",
"originalName": "2019-11-03-orszaghaz-ii.jpg",
"presentationWidth": 400,
"presentationHeight": 300
}
}
}
},
"fields": {
"slug": "/orszaghaz-ii/",
"date": "November 03, 2019",
"type": "photo"
}
}
},
{
"node": {
"id": "c80697e5-681d-5fcc-9dab-c3a3821ff0b1",
"fileAbsolutePath": "/Users/m/Code/blog/content/photos/2019-11-02-orszaghaz-i.md",
"html": "<p>The Hungarian Parliament Building seen from across the Danube in Budapest, Hungary.</p>",
"excerpt": "The Hungarian Parliament Building seen from across the Danube in Budapest, Hungary.",
"frontmatter": {
"title": "Országház I",
"linkurl": null,
"tags": null,
"featured": true,
"image": {
"childImageSharp": {
"original": {
"src": "/static/2019-11-02-orszaghaz-i-36d87329aeeda296ae923606e5a4a785.jpg"
},
"fluid": {
"aspectRatio": 2.3255813953488373,
"src": "/static/36d87329aeeda296ae923606e5a4a785/ef7a0/2019-11-02-orszaghaz-i.jpg",
"srcSet": "/static/36d87329aeeda296ae923606e5a4a785/23780/2019-11-02-orszaghaz-i.jpg 100w,\n/static/36d87329aeeda296ae923606e5a4a785/02ed9/2019-11-02-orszaghaz-i.jpg 200w,\n/static/36d87329aeeda296ae923606e5a4a785/ef7a0/2019-11-02-orszaghaz-i.jpg 400w,\n/static/36d87329aeeda296ae923606e5a4a785/ac974/2019-11-02-orszaghaz-i.jpg 600w,\n/static/36d87329aeeda296ae923606e5a4a785/12c26/2019-11-02-orszaghaz-i.jpg 800w,\n/static/36d87329aeeda296ae923606e5a4a785/b9e8b/2019-11-02-orszaghaz-i.jpg 3708w",
"srcWebp": "/static/36d87329aeeda296ae923606e5a4a785/a93fc/2019-11-02-orszaghaz-i.webp",
"srcSetWebp": "/static/36d87329aeeda296ae923606e5a4a785/b0720/2019-11-02-orszaghaz-i.webp 100w,\n/static/36d87329aeeda296ae923606e5a4a785/f6188/2019-11-02-orszaghaz-i.webp 200w,\n/static/36d87329aeeda296ae923606e5a4a785/a93fc/2019-11-02-orszaghaz-i.webp 400w,\n/static/36d87329aeeda296ae923606e5a4a785/7c0bb/2019-11-02-orszaghaz-i.webp 600w,\n/static/36d87329aeeda296ae923606e5a4a785/d1e4e/2019-11-02-orszaghaz-i.webp 800w,\n/static/36d87329aeeda296ae923606e5a4a785/730f8/2019-11-02-orszaghaz-i.webp 3708w",
"sizes": "(max-width: 400px) 100vw, 400px",
"originalImg": "/static/36d87329aeeda296ae923606e5a4a785/b9e8b/2019-11-02-orszaghaz-i.jpg",
"originalName": "2019-11-02-orszaghaz-i.jpg",
"presentationWidth": 400,
"presentationHeight": 297
}
}
}
},
"fields": {
"slug": "/orszaghaz-i/",
"date": "November 02, 2019",
"type": "photo"
}
}
},
{
"node": {
"id": "2e2c9611-be7b-5bc0-a72b-6c63e2072b5a",
"fileAbsolutePath": "/Users/m/Code/blog/content/posts/2019-10-24-ocean-protocol-and-ipfs-sitting-in-the-merkle-tree/index.md",
"html": "<p>IPFS is now integrated into the Ocean Protocol stack, allowing you to take advantage of decentralized asset file hosting.</p>\n<hr>\n<blockquote>\n<p>This article was originally posted <a href=\"https://blog.oceanprotocol.com/ocean-ipfs-integration-store-asset-files-43c623c356d7\">on Medium in the Ocean Protocol blog</a>.</p>\n</blockquote>\n<hr>\n<h2 id=\"-going-decentralized\"><a href=\"#-going-decentralized\" aria-label=\" going decentralized permalink\" class=\"anchor\"><span>#</span></a>✨ Going Decentralized</h2>\n<p>With Ocean Protocol, you can use centralized storage services like S3, Azure Storage, or your own On-Premise storage to store and retrieve your asset files through <a href=\"https://docs.oceanprotocol.com/concepts/components/#osmosis-drivers\">Osmosis drivers in Brizo</a>.</p>\n<p>But storing asset files in a centralized service poses multiple problems:</p>\n<ul>\n<li>one entity controls the data</li>\n<li>one entity is legally responsible for all stored data</li>\n<li>creates a single point of failure</li>\n<li>if service goes offline, asset files cant be consumed</li>\n<li>opening up possibilities of censorship by the entity running the service, or the service itself</li>\n<li>if files are moved to another location within the same service, existing URLs break</li>\n</ul>\n<p>Initially created to store and efficiently move scientific data sets, the <a href=\"https://ipfs.io/\">InterPlanetary File System (IPFS)</a> solves all those issues with its goal of transforming the vastly centralized web into a distributed peer-to-peer network.</p>\n<p>Files are distributed among multiple nodes, eliminating the single point of failure, legal, and censorship issues. By using content-based instead of location-based addressing of files, URLs wont break if files are moved.</p>\n<p>So we defined <a href=\"https://github.com/oceanprotocol/OEPs/tree/master/15\">OEP-15</a> to make the <code>ipfs://</code> protocol a first-class citizen in the Ocean Protocol stack, allowing you to store asset files on IPFS, and use their native IPFS URLs during the publish process.</p>\n<ul>\n<li><a href=\"https://github.com/oceanprotocol/OEPs/tree/master/15\"><strong>OEP-15: oceanprotocol/OEPs</strong></a></li>\n</ul>\n<p>In short, every component in the Ocean Protocol stack now supports publishing and consuming of asset files stored in IPFS which includes support for native IPFS URLs, referencing files with their Content Identifiers (CIDs).</p>\n<h2 id=\"-ipfs-in-commons-marketplace\"><a href=\"#%EF%B8%8F-ipfs-in-commons-marketplace\" aria-label=\" ipfs in commons marketplace permalink\" class=\"anchor\"><span>#</span></a>⛲️ IPFS in Commons Marketplace</h2>\n<p>Every file stored on IPFS is public by default, so it made perfect sense using this in our <a href=\"https://commons.oceanprotocol.com\">Commons Marketplace</a> first. We went through <a href=\"https://github.com/oceanprotocol/commons/pull/191\">multiple prototypes</a> to end up with our final setup.</p>\n<p>During the publish flow you will find an extended <em>Files</em> section for adding a file from an existing URL, and for adding a local file from your device to IPFS.</p>\n<p><figure class=\"gatsby-resp-image-figure\" style=\"\">\n <span\n class=\"gatsby-resp-image-wrapper\"\n style=\"position: relative; display: block; margin-left: auto; margin-right: auto; max-width: 630px;\"\n >\n <a\n class=\"gatsby-resp-image-link\"\n href=\"/static/5ec4122379d5c270cd7d899b02d8512e/67be7/add-url.png\"\n style=\"display: block\"\n target=\"_blank\"\n rel=\"noopener\"\n >\n <span\n class=\"gatsby-resp-image-background-image\"\n style=\"padding-bottom: 49.59128065395095%; position: relative; bottom: 0; left: 0; background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAKCAIAAAA7N+mxAAAACXBIWXMAAAsSAAALEgHS3X78AAABK0lEQVQoz5VR207CQBDl/79FXww8aMSEmGBiwpsKLeX+AtKWYvc+lzpbML4Y1Mns7OzMnpzZsx1mVkpZY5t/GhF1GuZaqfL44QNY55W1LgTjvLFOGzn4S2AkaoipMmgDOggHBZVGF4gYpSfdC+DYRwQfGm5rEonP+Y8YZnGxCJbNO7+ab6qiyrd5vsvL96LY5fl2L0nZHg/7mEix2O51VbtaC5mMG5kRcJMuN8v1LMmmb8kqm8+TLJukkmTjdJFki3QWK+N0+jqpy4q1B+2E/zQ2iUTBeHkzWK+PWh2UrY0SEmWagOxB4snRejCOWj3i2Na5Xn94N3ju3Q+fRi9IGABODii3vh1aUKsjnb/KGHvdfbi5fbzq9gfDEUcFf7EzWJaQfwndbn8zAX4CfqNBBsnjvIAAAAAASUVORK5CYII='); background-size: cover; display: block;\"\n ></span>\n <img\n class=\"gatsby-resp-image-image\"\n alt=\"Add existing IPFS asset under commons.oceanprotocol.com/publish\"\n title=\"Add existing IPFS asset under commons.oceanprotocol.com/publish\"\n src=\"/static/5ec4122379d5c270cd7d899b02d8512e/0f489/add-url.png\"\n srcset=\"/static/5ec4122379d5c270cd7d899b02d8512e/896af/add-url.png 158w,\n/static/5ec4122379d5c270cd7d899b02d8512e/b70ff/add-url.png 315w,\n/static/5ec4122379d5c270cd7d899b02d8512e/0f489/add-url.png 630w,\n/static/5ec4122379d5c270cd7d899b02d8512e/85b6f/add-url.png 945w,\n/static/5ec4122379d5c270cd7d899b02d8512e/4d498/add-url.png 1260w,\n/static/5ec4122379d5c270cd7d899b02d8512e/67be7/add-url.png 1468w\"\n sizes=\"(max-width: 630px) 100vw, 630px\"\n loading=\"lazy\"\n />\n </a>\n </span>\n <figcaption class=\"gatsby-resp-image-figcaption\">Add existing IPFS asset under commons.oceanprotocol.com/publish</figcaption>\n </figure></p>\n<p>The existing URL field now supports <code>ipfs://</code> in addition to <code>http(s)://</code> so if you have an existing asset on IPFS, you can add it here and everything works as before. With the exception that the asset files will be registered with this native IPFS URL.</p>\n<p>The new IPFS drop zone provides a convenient way to add and register unpublished asset files.</p>\n<p><figure class=\"gatsby-resp-image-figure\" style=\"\">\n <span\n class=\"gatsby-resp-image-wrapper\"\n style=\"position: relative; display: block; margin-left: auto; margin-right: auto; max-width: 630px;\"\n >\n <a\n class=\"gatsby-resp-image-link\"\n href=\"/static/a539c11bfabc0066e1bae9e4ad1eaf7f/8ade4/add-to-ipfs.png\"\n style=\"display: block\"\n target=\"_blank\"\n rel=\"noopener\"\n >\n <span\n class=\"gatsby-resp-image-background-image\"\n style=\"padding-bottom: 53.036437246963565%; position: relative; bottom: 0; left: 0; background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAALCAIAAADwazoUAAAACXBIWXMAAAsSAAALEgHS3X78AAAAzklEQVQoz5WR4ZLDIAiE+/4vmvTX5aKCUCBFbG2auWTmdkxGHb9VlltKeVl+t3/KzETkhpWWlJAZiTNUIIJKgLUA+lDVK9jUrJCuuPlBZPnJyuJ7GjLbrmEta85ryjkzsfJDRRoW40wv2GfTfJ/meZrmUsC5x4lkpw9s78e9XY//rkG60QduTh028/wqMUZmRNznfXMUPLy+bo4k2nJoX/jYlAilw4IVq3s3e78tvtC+zkP9r2eLSkEAxN5biPaWtsRDSH8EZmetjGZeyOEngH+JK7oEzFwAAAAASUVORK5CYII='); background-size: cover; display: block;\"\n ></span>\n <img\n class=\"gatsby-resp-image-image\"\n alt=\"Add to IPFS from a local file under commons.oceanprotocol.com/publish\"\n title=\"Add to IPFS from a local file under commons.oceanprotocol.com/publish\"\n src=\"/static/a539c11bfabc0066e1bae9e4ad1eaf7f/0f489/add-to-ipfs.png\"\n srcset=\"/static/a539c11bfabc0066e1bae9e4ad1eaf7f/896af/add-to-ipfs.png 158w,\n/static/a539c11bfabc0066e1bae9e4ad1eaf7f/b70ff/add-to-ipfs.png 315w,\n/static/a539c11bfabc0066e1bae9e4ad1eaf7f/0f489/add-to-ipfs.png 630w,\n/static/a539c11bfabc0066e1bae9e4ad1eaf7f/85b6f/add-to-ipfs.png 945w,\n/static/a539c11bfabc0066e1bae9e4ad1eaf7f/4d498/add-to-ipfs.png 1260w,\n/static/a539c11bfabc0066e1bae9e4ad1eaf7f/8ade4/add-to-ipfs.png 1482w\"\n sizes=\"(max-width: 630px) 100vw, 630px\"\n loading=\"lazy\"\n />\n </a>\n </span>\n <figcaption class=\"gatsby-resp-image-figcaption\">Add to IPFS from a local file under commons.oceanprotocol.com/publish</figcaption>\n </figure></p>\n<p>That drop zone allows you to add a file from your local machine and add it to IPFS during the asset publish flow in a snap:</p>\n<p><img src=\"/media/e43b135d9da99ac8a07ba1897f368258/add.gif\" alt=\"The full IPFS adding flow\"></p>\n<h3 id=\"the-tech-details\"><a href=\"#the-tech-details\" aria-label=\"the tech details permalink\" class=\"anchor\"><span>#</span></a>The Tech Details</h3>\n<p>First, opening up the drop zone area will ping the IPFS node &#x26; gateway to check connectivity. Dropping or selecting a file from your device onto that area does a bunch of things in the background:</p>\n<ol>\n<li>Will add that file to an IPFS node with <a href=\"https://github.com/ipfs/js-ipfs-http-client\">js-ipfs-http-client</a>, and pin the file so it stays on our node during garbage collection. We wrapped the HTTP client into our own <a href=\"https://github.com/oceanprotocol/commons/tree/master/client/src/hooks/use-ipfs-api.tsx\">custom React Hook</a>.</li>\n<li>The file will be wrapped into a directory to preserve the original file name, so we end up with a URL like <code>ipfs://QmX5LRpEVocfks9FNDnRoK2imf2fy9mPpP4wfgaDVXWfYD/video.mp4</code>.</li>\n<li>The returned CID is used to ping that file over an IPFS gateway to make it globally available.</li>\n<li>The IPFS gateway URL is passed to our Commons Server file checker, extracting some file metadata and checking for availability of the file.</li>\n<li>The native IPFS url is passed to the list of asset files, and it will show up in the file list.</li>\n<li>Upon final asset publishing, the native IPFS URL is stored encrypted in the asset DID Descriptor Object (DDO) as defined in <a href=\"https://github.com/oceanprotocol/OEPs/blob/master/8\">OEP-8</a>.</li>\n</ol>\n<p>All these steps are required because of how files in IPFS are distributed among its nodes. When adding a file to a node (note how its not called “uploading”) it is only available on that node. Requesting that file from another node will start the distribution process of the file from the initial IPFS node, making it globally available.</p>\n<p>Also the consume flow required some changes. Whenever an asset file stored on IPFS is requested to be downloaded, multiple things related to IPFS are happening in Brizo with its shiny new <a href=\"https://github.com/oceanprotocol/osmosis-ipfs-driver\">osmosis-ipfs-driver</a>:</p>\n<ol>\n<li>The file URLs are decrypted upon successful fulfilling of all conditions.</li>\n<li>The native <code>ipfs://</code> url is mapped to its <code>https://</code> gateway URL.</li>\n<li>File is downloaded from that gateway URL.</li>\n<li>In case a direct file URL was used instead of being folder-wrapped (e.g. <code>ipfs://QmPQNaNxHkasNiJBFZht2k3zCEBkvEu1aE5VNGZ8QiT8Nj</code>), the proper file ending will be added automatically at the end of the download process, based on detected MIME type.</li>\n</ol>\n<h2 id=\"♀️-ocean-protocols-public-ipfs-node--gateway\"><a href=\"#%E2%99%80%EF%B8%8F-ocean-protocols-public-ipfs-node--gateway\" aria-label=\"♀️ ocean protocols public ipfs node gateway permalink\" class=\"anchor\"><span>#</span></a>🏄‍♀️ Ocean Protocols Public IPFS Node &#x26; Gateway</h2>\n<p>While developing this feature, it became clear we need to run our own IPFS node &#x26; gateway to have better control over the whole experience. And donating a node instead of taking away bandwidth from the main IPFS gateway (gateway.ipfs.io) felt like the right thing to do to make Juan happy.</p>\n<p>So we created <strong>ipfs.oceanprotocol.com</strong>, run by us (that is, legally speaking, BigchainDB GmbH).</p>\n<p><figure class=\"gatsby-resp-image-figure\" style=\"\">\n <span\n class=\"gatsby-resp-image-wrapper\"\n style=\"position: relative; display: block; margin-left: auto; margin-right: auto; max-width: 630px;\"\n >\n <a\n class=\"gatsby-resp-image-link\"\n href=\"/static/cd927a5f1ef84118b0e731923330cb4c/42533/ipfs-oceanprotocol.png\"\n style=\"display: block\"\n target=\"_blank\"\n rel=\"noopener\"\n >\n <span\n class=\"gatsby-resp-image-background-image\"\n style=\"padding-bottom: 69.00584795321637%; position: relative; bottom: 0; left: 0; display: block;\"\n ></span>\n <img\n class=\"gatsby-resp-image-image\"\n alt=\"Frontpage for ipfs.oceanprotocol.com\"\n title=\"Frontpage for ipfs.oceanprotocol.com\"\n src=\"/static/cd927a5f1ef84118b0e731923330cb4c/0f489/ipfs-oceanprotocol.png\"\n srcset=\"/static/cd927a5f1ef84118b0e731923330cb4c/896af/ipfs-oceanprotocol.png 158w,\n/static/cd927a5f1ef84118b0e731923330cb4c/b70ff/ipfs-oceanprotocol.png 315w,\n/static/cd927a5f1ef84118b0e731923330cb4c/0f489/ipfs-oceanprotocol.png 630w,\n/static/cd927a5f1ef84118b0e731923330cb4c/85b6f/ipfs-oceanprotocol.png 945w,\n/static/cd927a5f1ef84118b0e731923330cb4c/4d498/ipfs-oceanprotocol.png 1260w,\n/static/cd927a5f1ef84118b0e731923330cb4c/42533/ipfs-oceanprotocol.png 2736w\"\n sizes=\"(max-width: 630px) 100vw, 630px\"\n loading=\"lazy\"\n />\n </a>\n </span>\n <figcaption class=\"gatsby-resp-image-figcaption\">Frontpage for ipfs.oceanprotocol.com</figcaption>\n </figure></p>\n<p>It is setup to be a public gateway, and provide some access to its node HTTP API for everyone. This means you can use it to address any content in the IPFS network, like:</p>\n<ul>\n<li><a href=\"https://ipfs.oceanprotocol.com/ipfs/QmX5LRpEVocfks9FNDnRoK2imf2fy9mPpP4wfgaDVXWfYD/video.mp4\">https://ipfs.oceanprotocol.com/ipfs/QmX5LRpEVocfks9FNDnRoK2imf2fy9mPpP4wfgaDVXWfYD/video.mp4</a></li>\n<li><a href=\"https://ipfs.oceanprotocol.com/ipfs/QmPQNaNxHkasNiJBFZht2k3zCEBkvEu1aE5VNGZ8QiT8Nj\">https://ipfs.oceanprotocol.com/ipfs/QmPQNaNxHkasNiJBFZht2k3zCEBkvEu1aE5VNGZ8QiT8Nj</a></li>\n</ul>\n<p>At the same time all node API functionality required by Commons is open to the world, so those endpoints can be used by anyone to add files to IPFS:</p>\n<ul>\n<li><code>/api/v0/add</code></li>\n<li><code>/api/v0/version</code></li>\n<li><code>/api/v0/id</code></li>\n</ul>\n<p>As a start, this is a simple single node but we plan to gradually upgrade ipfs.oceanprotocol.com to a full <a href=\"https://cluster.ipfs.io/\">IPFS Cluster</a> of multiple nodes for best data availability.</p>\n<ul>\n<li><a href=\"https://github.com/oceanprotocol/ipfs\"><strong>GitHub: oceanprotocol/ipfs</strong></a></li>\n</ul>\n<h2 id=\"-next-possible-iterations\"><a href=\"#-next-possible-iterations\" aria-label=\" next possible iterations permalink\" class=\"anchor\"><span>#</span></a>⛴ Next Possible Iterations</h2>\n<p>Beside upgrading to an IPFS Cluster there are many ways the process will be improved over time. At the moment the drop zone in Commons only supports single file uploads, so a quick win improvement would be to allow dropping multiple files at once. Likewise, the drop zone using <a href=\"https://github.com/ipfs/js-ipfs-http-client\">js-ipfs-http-client</a> comes with some bugs when trying to upload larger files.</p>\n<p>To make the process of adding files to the IPFS node less dependent on the client browser, it could be moved into a background task in the Commons Server. This should also give more control and feedback for the process of distributing a file from the initial node to other nodes.</p>\n<p>And finally, further work may be done to store files encrypted on IPFS and implement a way to decrypt them in an Ocean Protocol network.</p>\n<hr>\n<h2 id=\"learn-more-about-the-commons-marketplace\"><a href=\"#learn-more-about-the-commons-marketplace\" aria-label=\"learn more about the commons marketplace permalink\" class=\"anchor\"><span>#</span></a>Learn more about the Commons Marketplace</h2>\n<ul>\n<li><a href=\"/the-commons-marketplace-in-pacific-network\"><strong>The Commons Marketplace in Pacific Network</strong></a></li>\n<li><a href=\"/the-commons-data-marketplace\"><strong>The Commons Data Marketplace</strong></a></li>\n</ul>\n<hr>\n<blockquote>\n<p>This article was originally posted <a href=\"https://blog.oceanprotocol.com/ocean-ipfs-integration-store-asset-files-43c623c356d7\">on Medium in the Ocean Protocol blog</a>.</p>\n</blockquote>\n<hr>",
"excerpt": "IPFS is now integrated into the Ocean Protocol stack, allowing you to take advantage of decentralized asset file hosting. This article was originally posted on Medium in the Ocean Protocol blog. ✨ Going Decentralized With Ocean Protocol, you can use…",
"frontmatter": {
"title": "Ocean Protocol and IPFS, Sitting In The Merkle Tree",
"linkurl": null,
"tags": ["oceanprotocol", "blockchain", "design", "ipfs", "web3"],
"image": {
"childImageSharp": {
"original": {
"src": "/static/ocean-protocol-and-ipfs-sitting-in-the-merkle-tree-teaser-f724bdaae38e81ec90b01ec6b8412cc8.png"
},
"fluid": {
"aspectRatio": 2.3255813953488373,
"src": "/static/f724bdaae38e81ec90b01ec6b8412cc8/687f7/ocean-protocol-and-ipfs-sitting-in-the-merkle-tree-teaser.png",
"srcSet": "/static/f724bdaae38e81ec90b01ec6b8412cc8/90a60/ocean-protocol-and-ipfs-sitting-in-the-merkle-tree-teaser.png 100w,\n/static/f724bdaae38e81ec90b01ec6b8412cc8/c23b6/ocean-protocol-and-ipfs-sitting-in-the-merkle-tree-teaser.png 200w,\n/static/f724bdaae38e81ec90b01ec6b8412cc8/687f7/ocean-protocol-and-ipfs-sitting-in-the-merkle-tree-teaser.png 400w,\n/static/f724bdaae38e81ec90b01ec6b8412cc8/a9eb1/ocean-protocol-and-ipfs-sitting-in-the-merkle-tree-teaser.png 600w,\n/static/f724bdaae38e81ec90b01ec6b8412cc8/9a629/ocean-protocol-and-ipfs-sitting-in-the-merkle-tree-teaser.png 800w,\n/static/f724bdaae38e81ec90b01ec6b8412cc8/5956c/ocean-protocol-and-ipfs-sitting-in-the-merkle-tree-teaser.png 2000w",
"srcWebp": "/static/f724bdaae38e81ec90b01ec6b8412cc8/a93fc/ocean-protocol-and-ipfs-sitting-in-the-merkle-tree-teaser.webp",
"srcSetWebp": "/static/f724bdaae38e81ec90b01ec6b8412cc8/b0720/ocean-protocol-and-ipfs-sitting-in-the-merkle-tree-teaser.webp 100w,\n/static/f724bdaae38e81ec90b01ec6b8412cc8/f6188/ocean-protocol-and-ipfs-sitting-in-the-merkle-tree-teaser.webp 200w,\n/static/f724bdaae38e81ec90b01ec6b8412cc8/a93fc/ocean-protocol-and-ipfs-sitting-in-the-merkle-tree-teaser.webp 400w,\n/static/f724bdaae38e81ec90b01ec6b8412cc8/7c0bb/ocean-protocol-and-ipfs-sitting-in-the-merkle-tree-teaser.webp 600w,\n/static/f724bdaae38e81ec90b01ec6b8412cc8/d1e4e/ocean-protocol-and-ipfs-sitting-in-the-merkle-tree-teaser.webp 800w,\n/static/f724bdaae38e81ec90b01ec6b8412cc8/eb8cf/ocean-protocol-and-ipfs-sitting-in-the-merkle-tree-teaser.webp 2000w",
"sizes": "(max-width: 400px) 100vw, 400px",
"originalImg": "/static/f724bdaae38e81ec90b01ec6b8412cc8/5956c/ocean-protocol-and-ipfs-sitting-in-the-merkle-tree-teaser.png",
"originalName": "ocean-protocol-and-ipfs-sitting-in-the-merkle-tree-teaser.png",
"presentationWidth": 400,
"presentationHeight": 140
}
}
}
},
"fields": {
"slug": "/ocean-protocol-and-ipfs-sitting-in-the-merkle-tree",
"date": "October 24, 2019",
"type": "post"
}
}
}
]
},
"allPhotos": {
"edges": [
{
"node": {
"id": "6effe45d-0884-527c-9fba-6f7f567979fd",
"fileAbsolutePath": "/Users/m/Code/blog/content/photos/2019-11-03-orszaghaz-ii.md",
"html": "<p>Inside the Hungarian Parliament Building in Budapest, Hungary.</p>",
"excerpt": "Inside the Hungarian Parliament Building in Budapest, Hungary.",
"frontmatter": {
"title": "Országház II",
"linkurl": null,
"tags": null,
"image": {
"childImageSharp": {
"original": {
"src": "/static/2019-11-03-orszaghaz-ii-2dbcf257b4bdf625c24fede935d32425.jpg"
},
"fluid": {
"aspectRatio": 2.3255813953488373,
"src": "/static/2dbcf257b4bdf625c24fede935d32425/ef7a0/2019-11-03-orszaghaz-ii.jpg",
"srcSet": "/static/2dbcf257b4bdf625c24fede935d32425/23780/2019-11-03-orszaghaz-ii.jpg 100w,\n/static/2dbcf257b4bdf625c24fede935d32425/02ed9/2019-11-03-orszaghaz-ii.jpg 200w,\n/static/2dbcf257b4bdf625c24fede935d32425/ef7a0/2019-11-03-orszaghaz-ii.jpg 400w,\n/static/2dbcf257b4bdf625c24fede935d32425/ac974/2019-11-03-orszaghaz-ii.jpg 600w,\n/static/2dbcf257b4bdf625c24fede935d32425/12c26/2019-11-03-orszaghaz-ii.jpg 800w,\n/static/2dbcf257b4bdf625c24fede935d32425/24914/2019-11-03-orszaghaz-ii.jpg 3793w",
"srcWebp": "/static/2dbcf257b4bdf625c24fede935d32425/a93fc/2019-11-03-orszaghaz-ii.webp",
"srcSetWebp": "/static/2dbcf257b4bdf625c24fede935d32425/b0720/2019-11-03-orszaghaz-ii.webp 100w,\n/static/2dbcf257b4bdf625c24fede935d32425/f6188/2019-11-03-orszaghaz-ii.webp 200w,\n/static/2dbcf257b4bdf625c24fede935d32425/a93fc/2019-11-03-orszaghaz-ii.webp 400w,\n/static/2dbcf257b4bdf625c24fede935d32425/7c0bb/2019-11-03-orszaghaz-ii.webp 600w,\n/static/2dbcf257b4bdf625c24fede935d32425/d1e4e/2019-11-03-orszaghaz-ii.webp 800w,\n/static/2dbcf257b4bdf625c24fede935d32425/0a478/2019-11-03-orszaghaz-ii.webp 3793w",
"sizes": "(max-width: 400px) 100vw, 400px",
"originalImg": "/static/2dbcf257b4bdf625c24fede935d32425/24914/2019-11-03-orszaghaz-ii.jpg",
"originalName": "2019-11-03-orszaghaz-ii.jpg",
"presentationWidth": 400,
"presentationHeight": 300
}
}
}
},
"fields": {
"slug": "/orszaghaz-ii/",
"date": "November 03, 2019",
"type": "photo"
}
}
},
{
"node": {
"id": "c80697e5-681d-5fcc-9dab-c3a3821ff0b1",
"fileAbsolutePath": "/Users/m/Code/blog/content/photos/2019-11-02-orszaghaz-i.md",
"html": "<p>The Hungarian Parliament Building seen from across the Danube in Budapest, Hungary.</p>",
"excerpt": "The Hungarian Parliament Building seen from across the Danube in Budapest, Hungary.",
"frontmatter": {
"title": "Országház I",
"linkurl": null,
"tags": null,
"featured": true,
"image": {
"childImageSharp": {
"original": {
"src": "/static/2019-11-02-orszaghaz-i-36d87329aeeda296ae923606e5a4a785.jpg"
},
"fluid": {
"aspectRatio": 2.3255813953488373,
"src": "/static/36d87329aeeda296ae923606e5a4a785/ef7a0/2019-11-02-orszaghaz-i.jpg",
"srcSet": "/static/36d87329aeeda296ae923606e5a4a785/23780/2019-11-02-orszaghaz-i.jpg 100w,\n/static/36d87329aeeda296ae923606e5a4a785/02ed9/2019-11-02-orszaghaz-i.jpg 200w,\n/static/36d87329aeeda296ae923606e5a4a785/ef7a0/2019-11-02-orszaghaz-i.jpg 400w,\n/static/36d87329aeeda296ae923606e5a4a785/ac974/2019-11-02-orszaghaz-i.jpg 600w,\n/static/36d87329aeeda296ae923606e5a4a785/12c26/2019-11-02-orszaghaz-i.jpg 800w,\n/static/36d87329aeeda296ae923606e5a4a785/b9e8b/2019-11-02-orszaghaz-i.jpg 3708w",
"srcWebp": "/static/36d87329aeeda296ae923606e5a4a785/a93fc/2019-11-02-orszaghaz-i.webp",
"srcSetWebp": "/static/36d87329aeeda296ae923606e5a4a785/b0720/2019-11-02-orszaghaz-i.webp 100w,\n/static/36d87329aeeda296ae923606e5a4a785/f6188/2019-11-02-orszaghaz-i.webp 200w,\n/static/36d87329aeeda296ae923606e5a4a785/a93fc/2019-11-02-orszaghaz-i.webp 400w,\n/static/36d87329aeeda296ae923606e5a4a785/7c0bb/2019-11-02-orszaghaz-i.webp 600w,\n/static/36d87329aeeda296ae923606e5a4a785/d1e4e/2019-11-02-orszaghaz-i.webp 800w,\n/static/36d87329aeeda296ae923606e5a4a785/730f8/2019-11-02-orszaghaz-i.webp 3708w",
"sizes": "(max-width: 400px) 100vw, 400px",
"originalImg": "/static/36d87329aeeda296ae923606e5a4a785/b9e8b/2019-11-02-orszaghaz-i.jpg",
"originalName": "2019-11-02-orszaghaz-i.jpg",
"presentationWidth": 400,
"presentationHeight": 297
}
}
}
},
"fields": {
"slug": "/orszaghaz-i/",
"date": "November 02, 2019",
"type": "photo"
}
}
},
{
"node": {
"id": "2e2c9611-be7b-5bc0-a72b-6c63e2072b5a",
"fileAbsolutePath": "/Users/m/Code/blog/content/posts/2019-10-24-ocean-protocol-and-ipfs-sitting-in-the-merkle-tree/index.md",
"html": "<p>IPFS is now integrated into the Ocean Protocol stack, allowing you to take advantage of decentralized asset file hosting.</p>\n<hr>\n<blockquote>\n<p>This article was originally posted <a href=\"https://blog.oceanprotocol.com/ocean-ipfs-integration-store-asset-files-43c623c356d7\">on Medium in the Ocean Protocol blog</a>.</p>\n</blockquote>\n<hr>\n<h2 id=\"-going-decentralized\"><a href=\"#-going-decentralized\" aria-label=\" going decentralized permalink\" class=\"anchor\"><span>#</span></a>✨ Going Decentralized</h2>\n<p>With Ocean Protocol, you can use centralized storage services like S3, Azure Storage, or your own On-Premise storage to store and retrieve your asset files through <a href=\"https://docs.oceanprotocol.com/concepts/components/#osmosis-drivers\">Osmosis drivers in Brizo</a>.</p>\n<p>But storing asset files in a centralized service poses multiple problems:</p>\n<ul>\n<li>one entity controls the data</li>\n<li>one entity is legally responsible for all stored data</li>\n<li>creates a single point of failure</li>\n<li>if service goes offline, asset files cant be consumed</li>\n<li>opening up possibilities of censorship by the entity running the service, or the service itself</li>\n<li>if files are moved to another location within the same service, existing URLs break</li>\n</ul>\n<p>Initially created to store and efficiently move scientific data sets, the <a href=\"https://ipfs.io/\">InterPlanetary File System (IPFS)</a> solves all those issues with its goal of transforming the vastly centralized web into a distributed peer-to-peer network.</p>\n<p>Files are distributed among multiple nodes, eliminating the single point of failure, legal, and censorship issues. By using content-based instead of location-based addressing of files, URLs wont break if files are moved.</p>\n<p>So we defined <a href=\"https://github.com/oceanprotocol/OEPs/tree/master/15\">OEP-15</a> to make the <code>ipfs://</code> protocol a first-class citizen in the Ocean Protocol stack, allowing you to store asset files on IPFS, and use their native IPFS URLs during the publish process.</p>\n<ul>\n<li><a href=\"https://github.com/oceanprotocol/OEPs/tree/master/15\"><strong>OEP-15: oceanprotocol/OEPs</strong></a></li>\n</ul>\n<p>In short, every component in the Ocean Protocol stack now supports publishing and consuming of asset files stored in IPFS which includes support for native IPFS URLs, referencing files with their Content Identifiers (CIDs).</p>\n<h2 id=\"-ipfs-in-commons-marketplace\"><a href=\"#%EF%B8%8F-ipfs-in-commons-marketplace\" aria-label=\" ipfs in commons marketplace permalink\" class=\"anchor\"><span>#</span></a>⛲️ IPFS in Commons Marketplace</h2>\n<p>Every file stored on IPFS is public by default, so it made perfect sense using this in our <a href=\"https://commons.oceanprotocol.com\">Commons Marketplace</a> first. We went through <a href=\"https://github.com/oceanprotocol/commons/pull/191\">multiple prototypes</a> to end up with our final setup.</p>\n<p>During the publish flow you will find an extended <em>Files</em> section for adding a file from an existing URL, and for adding a local file from your device to IPFS.</p>\n<p><figure class=\"gatsby-resp-image-figure\" style=\"\">\n <span\n class=\"gatsby-resp-image-wrapper\"\n style=\"position: relative; display: block; margin-left: auto; margin-right: auto; max-width: 630px;\"\n >\n <a\n class=\"gatsby-resp-image-link\"\n href=\"/static/5ec4122379d5c270cd7d899b02d8512e/67be7/add-url.png\"\n style=\"display: block\"\n target=\"_blank\"\n rel=\"noopener\"\n >\n <span\n class=\"gatsby-resp-image-background-image\"\n style=\"padding-bottom: 49.59128065395095%; position: relative; bottom: 0; left: 0; background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAKCAIAAAA7N+mxAAAACXBIWXMAAAsSAAALEgHS3X78AAABK0lEQVQoz5VR207CQBDl/79FXww8aMSEmGBiwpsKLeX+AtKWYvc+lzpbML4Y1Mns7OzMnpzZsx1mVkpZY5t/GhF1GuZaqfL44QNY55W1LgTjvLFOGzn4S2AkaoipMmgDOggHBZVGF4gYpSfdC+DYRwQfGm5rEonP+Y8YZnGxCJbNO7+ab6qiyrd5vsvL96LY5fl2L0nZHg/7mEix2O51VbtaC5mMG5kRcJMuN8v1LMmmb8kqm8+TLJukkmTjdJFki3QWK+N0+jqpy4q1B+2E/zQ2iUTBeHkzWK+PWh2UrY0SEmWagOxB4snRejCOWj3i2Na5Xn94N3ju3Q+fRi9IGABODii3vh1aUKsjnb/KGHvdfbi5fbzq9gfDEUcFf7EzWJaQfwndbn8zAX4CfqNBBsnjvIAAAAAASUVORK5CYII='); background-size: cover; display: block;\"\n ></span>\n <img\n class=\"gatsby-resp-image-image\"\n alt=\"Add existing IPFS asset under commons.oceanprotocol.com/publish\"\n title=\"Add existing IPFS asset under commons.oceanprotocol.com/publish\"\n src=\"/static/5ec4122379d5c270cd7d899b02d8512e/0f489/add-url.png\"\n srcset=\"/static/5ec4122379d5c270cd7d899b02d8512e/896af/add-url.png 158w,\n/static/5ec4122379d5c270cd7d899b02d8512e/b70ff/add-url.png 315w,\n/static/5ec4122379d5c270cd7d899b02d8512e/0f489/add-url.png 630w,\n/static/5ec4122379d5c270cd7d899b02d8512e/85b6f/add-url.png 945w,\n/static/5ec4122379d5c270cd7d899b02d8512e/4d498/add-url.png 1260w,\n/static/5ec4122379d5c270cd7d899b02d8512e/67be7/add-url.png 1468w\"\n sizes=\"(max-width: 630px) 100vw, 630px\"\n loading=\"lazy\"\n />\n </a>\n </span>\n <figcaption class=\"gatsby-resp-image-figcaption\">Add existing IPFS asset under commons.oceanprotocol.com/publish</figcaption>\n </figure></p>\n<p>The existing URL field now supports <code>ipfs://</code> in addition to <code>http(s)://</code> so if you have an existing asset on IPFS, you can add it here and everything works as before. With the exception that the asset files will be registered with this native IPFS URL.</p>\n<p>The new IPFS drop zone provides a convenient way to add and register unpublished asset files.</p>\n<p><figure class=\"gatsby-resp-image-figure\" style=\"\">\n <span\n class=\"gatsby-resp-image-wrapper\"\n style=\"position: relative; display: block; margin-left: auto; margin-right: auto; max-width: 630px;\"\n >\n <a\n class=\"gatsby-resp-image-link\"\n href=\"/static/a539c11bfabc0066e1bae9e4ad1eaf7f/8ade4/add-to-ipfs.png\"\n style=\"display: block\"\n target=\"_blank\"\n rel=\"noopener\"\n >\n <span\n class=\"gatsby-resp-image-background-image\"\n style=\"padding-bottom: 53.036437246963565%; position: relative; bottom: 0; left: 0; background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAALCAIAAADwazoUAAAACXBIWXMAAAsSAAALEgHS3X78AAAAzklEQVQoz5WR4ZLDIAiE+/4vmvTX5aKCUCBFbG2auWTmdkxGHb9VlltKeVl+t3/KzETkhpWWlJAZiTNUIIJKgLUA+lDVK9jUrJCuuPlBZPnJyuJ7GjLbrmEta85ryjkzsfJDRRoW40wv2GfTfJ/meZrmUsC5x4lkpw9s78e9XY//rkG60QduTh028/wqMUZmRNznfXMUPLy+bo4k2nJoX/jYlAilw4IVq3s3e78tvtC+zkP9r2eLSkEAxN5biPaWtsRDSH8EZmetjGZeyOEngH+JK7oEzFwAAAAASUVORK5CYII='); background-size: cover; display: block;\"\n ></span>\n <img\n class=\"gatsby-resp-image-image\"\n alt=\"Add to IPFS from a local file under commons.oceanprotocol.com/publish\"\n title=\"Add to IPFS from a local file under commons.oceanprotocol.com/publish\"\n src=\"/static/a539c11bfabc0066e1bae9e4ad1eaf7f/0f489/add-to-ipfs.png\"\n srcset=\"/static/a539c11bfabc0066e1bae9e4ad1eaf7f/896af/add-to-ipfs.png 158w,\n/static/a539c11bfabc0066e1bae9e4ad1eaf7f/b70ff/add-to-ipfs.png 315w,\n/static/a539c11bfabc0066e1bae9e4ad1eaf7f/0f489/add-to-ipfs.png 630w,\n/static/a539c11bfabc0066e1bae9e4ad1eaf7f/85b6f/add-to-ipfs.png 945w,\n/static/a539c11bfabc0066e1bae9e4ad1eaf7f/4d498/add-to-ipfs.png 1260w,\n/static/a539c11bfabc0066e1bae9e4ad1eaf7f/8ade4/add-to-ipfs.png 1482w\"\n sizes=\"(max-width: 630px) 100vw, 630px\"\n loading=\"lazy\"\n />\n </a>\n </span>\n <figcaption class=\"gatsby-resp-image-figcaption\">Add to IPFS from a local file under commons.oceanprotocol.com/publish</figcaption>\n </figure></p>\n<p>That drop zone allows you to add a file from your local machine and add it to IPFS during the asset publish flow in a snap:</p>\n<p><img src=\"/media/e43b135d9da99ac8a07ba1897f368258/add.gif\" alt=\"The full IPFS adding flow\"></p>\n<h3 id=\"the-tech-details\"><a href=\"#the-tech-details\" aria-label=\"the tech details permalink\" class=\"anchor\"><span>#</span></a>The Tech Details</h3>\n<p>First, opening up the drop zone area will ping the IPFS node &#x26; gateway to check connectivity. Dropping or selecting a file from your device onto that area does a bunch of things in the background:</p>\n<ol>\n<li>Will add that file to an IPFS node with <a href=\"https://github.com/ipfs/js-ipfs-http-client\">js-ipfs-http-client</a>, and pin the file so it stays on our node during garbage collection. We wrapped the HTTP client into our own <a href=\"https://github.com/oceanprotocol/commons/tree/master/client/src/hooks/use-ipfs-api.tsx\">custom React Hook</a>.</li>\n<li>The file will be wrapped into a directory to preserve the original file name, so we end up with a URL like <code>ipfs://QmX5LRpEVocfks9FNDnRoK2imf2fy9mPpP4wfgaDVXWfYD/video.mp4</code>.</li>\n<li>The returned CID is used to ping that file over an IPFS gateway to make it globally available.</li>\n<li>The IPFS gateway URL is passed to our Commons Server file checker, extracting some file metadata and checking for availability of the file.</li>\n<li>The native IPFS url is passed to the list of asset files, and it will show up in the file list.</li>\n<li>Upon final asset publishing, the native IPFS URL is stored encrypted in the asset DID Descriptor Object (DDO) as defined in <a href=\"https://github.com/oceanprotocol/OEPs/blob/master/8\">OEP-8</a>.</li>\n</ol>\n<p>All these steps are required because of how files in IPFS are distributed among its nodes. When adding a file to a node (note how its not called “uploading”) it is only available on that node. Requesting that file from another node will start the distribution process of the file from the initial IPFS node, making it globally available.</p>\n<p>Also the consume flow required some changes. Whenever an asset file stored on IPFS is requested to be downloaded, multiple things related to IPFS are happening in Brizo with its shiny new <a href=\"https://github.com/oceanprotocol/osmosis-ipfs-driver\">osmosis-ipfs-driver</a>:</p>\n<ol>\n<li>The file URLs are decrypted upon successful fulfilling of all conditions.</li>\n<li>The native <code>ipfs://</code> url is mapped to its <code>https://</code> gateway URL.</li>\n<li>File is downloaded from that gateway URL.</li>\n<li>In case a direct file URL was used instead of being folder-wrapped (e.g. <code>ipfs://QmPQNaNxHkasNiJBFZht2k3zCEBkvEu1aE5VNGZ8QiT8Nj</code>), the proper file ending will be added automatically at the end of the download process, based on detected MIME type.</li>\n</ol>\n<h2 id=\"♀️-ocean-protocols-public-ipfs-node--gateway\"><a href=\"#%E2%99%80%EF%B8%8F-ocean-protocols-public-ipfs-node--gateway\" aria-label=\"♀️ ocean protocols public ipfs node gateway permalink\" class=\"anchor\"><span>#</span></a>🏄‍♀️ Ocean Protocols Public IPFS Node &#x26; Gateway</h2>\n<p>While developing this feature, it became clear we need to run our own IPFS node &#x26; gateway to have better control over the whole experience. And donating a node instead of taking away bandwidth from the main IPFS gateway (gateway.ipfs.io) felt like the right thing to do to make Juan happy.</p>\n<p>So we created <strong>ipfs.oceanprotocol.com</strong>, run by us (that is, legally speaking, BigchainDB GmbH).</p>\n<p><figure class=\"gatsby-resp-image-figure\" style=\"\">\n <span\n class=\"gatsby-resp-image-wrapper\"\n style=\"position: relative; display: block; margin-left: auto; margin-right: auto; max-width: 630px;\"\n >\n <a\n class=\"gatsby-resp-image-link\"\n href=\"/static/cd927a5f1ef84118b0e731923330cb4c/42533/ipfs-oceanprotocol.png\"\n style=\"display: block\"\n target=\"_blank\"\n rel=\"noopener\"\n >\n <span\n class=\"gatsby-resp-image-background-image\"\n style=\"padding-bottom: 69.00584795321637%; position: relative; bottom: 0; left: 0; display: block;\"\n ></span>\n <img\n class=\"gatsby-resp-image-image\"\n alt=\"Frontpage for ipfs.oceanprotocol.com\"\n title=\"Frontpage for ipfs.oceanprotocol.com\"\n src=\"/static/cd927a5f1ef84118b0e731923330cb4c/0f489/ipfs-oceanprotocol.png\"\n srcset=\"/static/cd927a5f1ef84118b0e731923330cb4c/896af/ipfs-oceanprotocol.png 158w,\n/static/cd927a5f1ef84118b0e731923330cb4c/b70ff/ipfs-oceanprotocol.png 315w,\n/static/cd927a5f1ef84118b0e731923330cb4c/0f489/ipfs-oceanprotocol.png 630w,\n/static/cd927a5f1ef84118b0e731923330cb4c/85b6f/ipfs-oceanprotocol.png 945w,\n/static/cd927a5f1ef84118b0e731923330cb4c/4d498/ipfs-oceanprotocol.png 1260w,\n/static/cd927a5f1ef84118b0e731923330cb4c/42533/ipfs-oceanprotocol.png 2736w\"\n sizes=\"(max-width: 630px) 100vw, 630px\"\n loading=\"lazy\"\n />\n </a>\n </span>\n <figcaption class=\"gatsby-resp-image-figcaption\">Frontpage for ipfs.oceanprotocol.com</figcaption>\n </figure></p>\n<p>It is setup to be a public gateway, and provide some access to its node HTTP API for everyone. This means you can use it to address any content in the IPFS network, like:</p>\n<ul>\n<li><a href=\"https://ipfs.oceanprotocol.com/ipfs/QmX5LRpEVocfks9FNDnRoK2imf2fy9mPpP4wfgaDVXWfYD/video.mp4\">https://ipfs.oceanprotocol.com/ipfs/QmX5LRpEVocfks9FNDnRoK2imf2fy9mPpP4wfgaDVXWfYD/video.mp4</a></li>\n<li><a href=\"https://ipfs.oceanprotocol.com/ipfs/QmPQNaNxHkasNiJBFZht2k3zCEBkvEu1aE5VNGZ8QiT8Nj\">https://ipfs.oceanprotocol.com/ipfs/QmPQNaNxHkasNiJBFZht2k3zCEBkvEu1aE5VNGZ8QiT8Nj</a></li>\n</ul>\n<p>At the same time all node API functionality required by Commons is open to the world, so those endpoints can be used by anyone to add files to IPFS:</p>\n<ul>\n<li><code>/api/v0/add</code></li>\n<li><code>/api/v0/version</code></li>\n<li><code>/api/v0/id</code></li>\n</ul>\n<p>As a start, this is a simple single node but we plan to gradually upgrade ipfs.oceanprotocol.com to a full <a href=\"https://cluster.ipfs.io/\">IPFS Cluster</a> of multiple nodes for best data availability.</p>\n<ul>\n<li><a href=\"https://github.com/oceanprotocol/ipfs\"><strong>GitHub: oceanprotocol/ipfs</strong></a></li>\n</ul>\n<h2 id=\"-next-possible-iterations\"><a href=\"#-next-possible-iterations\" aria-label=\" next possible iterations permalink\" class=\"anchor\"><span>#</span></a>⛴ Next Possible Iterations</h2>\n<p>Beside upgrading to an IPFS Cluster there are many ways the process will be improved over time. At the moment the drop zone in Commons only supports single file uploads, so a quick win improvement would be to allow dropping multiple files at once. Likewise, the drop zone using <a href=\"https://github.com/ipfs/js-ipfs-http-client\">js-ipfs-http-client</a> comes with some bugs when trying to upload larger files.</p>\n<p>To make the process of adding files to the IPFS node less dependent on the client browser, it could be moved into a background task in the Commons Server. This should also give more control and feedback for the process of distributing a file from the initial node to other nodes.</p>\n<p>And finally, further work may be done to store files encrypted on IPFS and implement a way to decrypt them in an Ocean Protocol network.</p>\n<hr>\n<h2 id=\"learn-more-about-the-commons-marketplace\"><a href=\"#learn-more-about-the-commons-marketplace\" aria-label=\"learn more about the commons marketplace permalink\" class=\"anchor\"><span>#</span></a>Learn more about the Commons Marketplace</h2>\n<ul>\n<li><a href=\"/the-commons-marketplace-in-pacific-network\"><strong>The Commons Marketplace in Pacific Network</strong></a></li>\n<li><a href=\"/the-commons-data-marketplace\"><strong>The Commons Data Marketplace</strong></a></li>\n</ul>\n<hr>\n<blockquote>\n<p>This article was originally posted <a href=\"https://blog.oceanprotocol.com/ocean-ipfs-integration-store-asset-files-43c623c356d7\">on Medium in the Ocean Protocol blog</a>.</p>\n</blockquote>\n<hr>",
"excerpt": "IPFS is now integrated into the Ocean Protocol stack, allowing you to take advantage of decentralized asset file hosting. This article was originally posted on Medium in the Ocean Protocol blog. ✨ Going Decentralized With Ocean Protocol, you can use…",
"frontmatter": {
"title": "Ocean Protocol and IPFS, Sitting In The Merkle Tree",
"linkurl": null,
"tags": ["oceanprotocol", "blockchain", "design", "ipfs", "web3"],
"image": {
"childImageSharp": {
"original": {
"src": "/static/ocean-protocol-and-ipfs-sitting-in-the-merkle-tree-teaser-f724bdaae38e81ec90b01ec6b8412cc8.png"
},
"fluid": {
"aspectRatio": 2.3255813953488373,
"src": "/static/f724bdaae38e81ec90b01ec6b8412cc8/687f7/ocean-protocol-and-ipfs-sitting-in-the-merkle-tree-teaser.png",
"srcSet": "/static/f724bdaae38e81ec90b01ec6b8412cc8/90a60/ocean-protocol-and-ipfs-sitting-in-the-merkle-tree-teaser.png 100w,\n/static/f724bdaae38e81ec90b01ec6b8412cc8/c23b6/ocean-protocol-and-ipfs-sitting-in-the-merkle-tree-teaser.png 200w,\n/static/f724bdaae38e81ec90b01ec6b8412cc8/687f7/ocean-protocol-and-ipfs-sitting-in-the-merkle-tree-teaser.png 400w,\n/static/f724bdaae38e81ec90b01ec6b8412cc8/a9eb1/ocean-protocol-and-ipfs-sitting-in-the-merkle-tree-teaser.png 600w,\n/static/f724bdaae38e81ec90b01ec6b8412cc8/9a629/ocean-protocol-and-ipfs-sitting-in-the-merkle-tree-teaser.png 800w,\n/static/f724bdaae38e81ec90b01ec6b8412cc8/5956c/ocean-protocol-and-ipfs-sitting-in-the-merkle-tree-teaser.png 2000w",
"srcWebp": "/static/f724bdaae38e81ec90b01ec6b8412cc8/a93fc/ocean-protocol-and-ipfs-sitting-in-the-merkle-tree-teaser.webp",
"srcSetWebp": "/static/f724bdaae38e81ec90b01ec6b8412cc8/b0720/ocean-protocol-and-ipfs-sitting-in-the-merkle-tree-teaser.webp 100w,\n/static/f724bdaae38e81ec90b01ec6b8412cc8/f6188/ocean-protocol-and-ipfs-sitting-in-the-merkle-tree-teaser.webp 200w,\n/static/f724bdaae38e81ec90b01ec6b8412cc8/a93fc/ocean-protocol-and-ipfs-sitting-in-the-merkle-tree-teaser.webp 400w,\n/static/f724bdaae38e81ec90b01ec6b8412cc8/7c0bb/ocean-protocol-and-ipfs-sitting-in-the-merkle-tree-teaser.webp 600w,\n/static/f724bdaae38e81ec90b01ec6b8412cc8/d1e4e/ocean-protocol-and-ipfs-sitting-in-the-merkle-tree-teaser.webp 800w,\n/static/f724bdaae38e81ec90b01ec6b8412cc8/eb8cf/ocean-protocol-and-ipfs-sitting-in-the-merkle-tree-teaser.webp 2000w",
"sizes": "(max-width: 400px) 100vw, 400px",
"originalImg": "/static/f724bdaae38e81ec90b01ec6b8412cc8/5956c/ocean-protocol-and-ipfs-sitting-in-the-merkle-tree-teaser.png",
"originalName": "ocean-protocol-and-ipfs-sitting-in-the-merkle-tree-teaser.png",
"presentationWidth": 400,
"presentationHeight": 140
}
}
}
},
"fields": {
"slug": "/ocean-protocol-and-ipfs-sitting-in-the-merkle-tree",
"date": "October 24, 2019",
"type": "post"
}
}
}
]
}
}