{"id":26469757,"url":"https://github.com/ocdbytes/ipfs_dump_repo","last_synced_at":"2026-04-17T19:04:29.521Z","repository":{"id":184688695,"uuid":"672313435","full_name":"ocdbytes/IPFS_DUMP_REPO","owner":"ocdbytes","description":"This repository contains all the feature examples with IPFS using helia and ipfs-js. This repository contains the documentation of all the components in IPFS and how they are used by the infrastructure","archived":false,"fork":false,"pushed_at":"2023-09-26T15:50:13.000Z","size":1265,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-19T17:09:13.887Z","etag":null,"topics":["helia","ipfs","ipfs-js","javascript","merkle-dag","unixfs"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ocdbytes.png","metadata":{"files":{"readme":"Readme.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2023-07-29T16:39:31.000Z","updated_at":"2023-10-17T01:36:26.000Z","dependencies_parsed_at":null,"dependency_job_id":"d086a9e6-cc56-4660-987e-6ee5538a2604","html_url":"https://github.com/ocdbytes/IPFS_DUMP_REPO","commit_stats":null,"previous_names":["arun89-crypto/ipfs_dump_repo","ocdbytes/ipfs_dump_repo"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ocdbytes/IPFS_DUMP_REPO","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ocdbytes%2FIPFS_DUMP_REPO","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ocdbytes%2FIPFS_DUMP_REPO/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ocdbytes%2FIPFS_DUMP_REPO/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ocdbytes%2FIPFS_DUMP_REPO/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ocdbytes","download_url":"https://codeload.github.com/ocdbytes/IPFS_DUMP_REPO/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ocdbytes%2FIPFS_DUMP_REPO/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31941845,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-17T17:29:20.459Z","status":"ssl_error","status_checked_at":"2026-04-17T17:28:47.801Z","response_time":62,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["helia","ipfs","ipfs-js","javascript","merkle-dag","unixfs"],"created_at":"2025-03-19T17:09:17.453Z","updated_at":"2026-04-17T19:04:29.505Z","avatar_url":"https://github.com/ocdbytes.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# IPFS\n\n![IPFS_IMAGE](./Assets/ipfs.png)\n**Project Apollo archive on IPFS Divided into several Merkle DAGs**\n\nThis doc contains the ipfs commands and info.\n\n## Contents\n\n- [IPFS](#ipfs)\n  - [Contents](#contents)\n  - [File Structure](#file-structure)\n  - [What is CID ?](#what-is-cid-)\n  - [What is Merkle DAG (Directed Acrylic Graphs) ?](#what-is-merkle-dag-directed-acrylic-graphs-)\n    - [Example of how merkle DAGs allow us to counter the duplication of content github also uses merkle DAGs to manage the version control without duplication. Ethereum also uses this.](#example-of-how-merkle-dags-allow-us-to-counter-the-duplication-of-content-github-also-uses-merkle-dags-to-manage-the-version-control-without-duplication-ethereum-also-uses-this)\n  - [Commands](#commands)\n  - [What is IPFS-JS ?](#what-is-ipfs-js-)\n  - [What is Helia ?](#what-is-helia-)\n  - [CID explorers](#cid-explorers)\n\n## File Structure\n\n- [Assets/](./Assets/)\n- [utils/](./utils/)\n  - [create_node.js](./utils/create_node.js)\n  - [files.js](./utils/files.js)\n- [src/](./src/)\n  - [index.js](./src/index.js)\n  - [nodes_dial.js](./src/nodes_dial.js)\n  - [unixfs_nodes.js](./src/unixfs_nodes.js)\n- package.json\n- Readme.md\n\nFolder Description :\n\n- Assets : Contains all the doc related images or text files\n- utils : This folder contains the utility scripts for different IPFS functions such as files module etc.\n- src : This folder contains the implementation of the helia nodes and unixfs etc.\n\nSetup :\n\n```sh\nyarn\n```\n\n## What is CID ?\n\nCID is defined as content identifier.\nA CID is a single identifier that contains both a cryptographic hash and a codec, which holds information about how to interpret that data. Codecs encode and decode data in certain formats.\n\n```txt\n[source : proto.school]\n\n+-------+------------------------------+\n| Codec | Multihash                    |\n+-------+------------------------------+\n\n\n+------------------------------+\n| Codec                        |\n+------------------------------+\n|                              |\n| Multihash                    |\n| +----------+---------------+ |\n| |Hash Type | Hash Value    | |\n| +----------+---------------+ |\n|                              |\n+------------------------------+\n```\n\n## What is Merkle DAG (Directed Acrylic Graphs) ?\n\nMerkle DAG are types of graphs that are both Acyclic, Directed and the edge of the Graph is defined by the CID of the entity attached to the node.\n\nWe have :\n\n- leaf nodes\n- connecting nodes\n\nHow data is transformed and how CID is related to the ancestors ?\n\n![Merkle 1](./Assets/Merkle1.svg)\n![Merkle 2](./Assets/Merkle2.svg)\n\n**Image Source : Proto.school**\n\nHere if I change the contents of a one fish image it's CID will also be changed and it will lead to change of the CID of it's subsequent ancestors till the root node of the graph.\n\n```txt\n[source : proto.school]\n```\n\nIn a Merkle DAG, the CID of each node depends, in turn, on the CIDs of each of its children.\nAs such, the CID of a root node uniquely identifies not just that node, but the entire DAG of which it’s the root!\nAs a result, we can extend all of the awesome security, integrity, and permanence guarantees of CIDs to our data structure itself,\nand not just the data that it contains!\n\nHave you ever made a temporary backup copy of a file directory during some editing process,\nthen found the two directories months later and wondered whether their contents were still identical?\nRather than laboriously comparing files, you could compute a Merkle DAG for each copy: if the CIDs of the root directory matched,\nyou’d know you could safely delete one and free up some space on your hard drive!\n\n### Example of how merkle DAGs allow us to counter the duplication of content github also uses merkle DAGs to manage the version control without duplication. Ethereum also uses this.\n\nFor an example of small-scale data duplication, consider the use case of tracking changes files in a directory over time (this is often called versioning).\nOne change we could make to this directory is to delete the \"fish\" directory, replacing it with a directory called \"dogs\".\nThese changes result in a new DAG, representing an updated state of the directory. However, all of the nodes representing the \"cats\" directory and its files are common to both DAGs.\nTherefore, we can reuse them, as depicted below, where the orange nodes represent nodes that are only used in the original DAG,\nthe green nodes represent those that are common to both, and the blue nodes represent the extra nodes needed for the new state.\n\n![Merkle 3](./Assets/Merkle3.svg)\n\nThis means that we can actually store both versions of the \"pics\" directory,\nwithout taking up twice as much space as it takes to store a single version!\nGit, a common version control system, uses Merkle DAGs in a very similar way to track changes to source code in software projects!\n\n## Commands\n\n1. **ipfs id**\n\nThis command will give the IPFS id.\n\n```sh\nipfs id\n```\n\nOUTPUT :\n\n```sh\n{\n \"ID\": \"\u003cID\u003e\",\n \"PublicKey\": \"\u003cPUBLIC_KEY\u003e\",\n \"Addresses\": null,\n \"AgentVersion\": \"kubo/0.21.0/\",\n \"ProtocolVersion\": \"ipfs/0.1.0\",\n \"Protocols\": null\n}\n```\n\n2. **ipfs daemon**\n\nThis command will run the ipfs daemon on your system\n\n```sh\nipfs daemon\n```\n\nOUTPUT :\n\n```sh\nInitializing daemon...\nKubo version: 0.21.0\nRepo version: 14\nSystem version: amd64/darwin\nGolang version: go1.19.10\nSwarm listening on /ip4/127.0.0.1/tcp/4001\nSwarm listening on /ip4/127.0.0.1/udp/4001/quic\nSwarm listening on /ip4/127.0.0.1/udp/4001/quic-v1\nSwarm listening on /ip4/127.0.0.1/udp/4001/quic-v1/webtransport/certhash/uEiAjfmrXqorLFs8UwvgyYuZWE6KSptUbxdmXurxbC6Mtew/certhash/uEiDrdsdmj4QFuh_kV0LuNPDB5E_Vk4jixta7HF0dCs90MA\nSwarm listening on /ip4/127.94.0.1/tcp/4001\nSwarm listening on /ip4/127.94.0.1/udp/4001/quic\nSwarm listening on /ip4/127.94.0.1/udp/4001/quic-v1\n.....\n.....\n.....\nRPC API server listening on /ip4/127.0.0.1/tcp/5001\nWebUI: http://127.0.0.1:5001/webui\nGateway server listening on /ip4/127.0.0.1/tcp/8080\nDaemon is ready\n```\n\n3. **Add Files**\n\nThere are several ways you can add and wrap the files. Run this command to see all the options\n\n```sh\nipfs add --help\n```\n\nWays to add file :\n\n- Using `ipfs add`\n\n```sh\nipfs add \u003cfile_path\u003e\n```\n\nEg :\n\n```sh\nipfs add 8-SoNnsagShzqdhbo.png\n\nadded QmZNwQ8zpNEUVf4EpSYqTxYfkjHaFV4ipnymHC8LM26jDm 8-SoNnsagShzqdhbo.png\n 408.22 KiB / 408.22 KiB [=========================================================================================================================================================================] 100.00%\n```\n\nHere the file hash is : `QmZNwQ8zpNEUVf4EpSYqTxYfkjHaFV4ipnymHC8LM26jDm`\n\n- Using `curl` with ipfs api\n\n```sh\ncurl -F file=@\u003cfile_path\u003e \"http://127.0.0.1:5001/api/v0/add\"\n```\n\nEg :\n\n```sh\nipfs curl -F file=@8-SoNnsagShzqdhbo.png \"http://127.0.0.1:5001/api/v0/add\"\n\n# Response :\n\n{\n    \"Name\":\"8-SoNnsagShzqdhbo.png\",\n    \"Hash\":\"QmZNwQ8zpNEUVf4EpSYqTxYfkjHaFV4ipnymHC8LM26jDm\",\n    \"Size\":\"418150\"\n}\n```\n\n4. **Run Public Node (config)**\n\n```sh\nipfs config --json API.HTTPHeaders.Access-Control-Allow-Origin '[\"*\"]'\nipfs config --json API.HTTPHeaders.Access-Control-Allow-Methods '[\"GET\", \"POST\", \"OPTIONS\", \"PUT\"]'\nipfs config --json API.HTTPHeaders.Access-Control-Allow-Headers '[\"Authorization\"]'\nipfs config --json API.HTTPHeaders.Access-Control-Expose-Headers '[\"Location\"]'\nipfs config --json API.HTTPHeaders.Access-Control-Allow-Credentials '[\"true\"]'\n\n# After running (running required once only not everytime)\n\nipfs daemon\n# ---[or]---\nipfs daemon \u0026 # for background process\n```\n\n## What is IPFS-JS ?\n\nIPFS-JS is a deprecated framework that is used to interact with the IPFS node to add files getting stats\n\n## What is Helia ?\n\nHelia is a new version of ipfs client that is used to interact with the IPFS module and insert data or manipulate our data as we wish. It is a better option than ipfs-js and is very light compared to it.\n\nIt majorly contains 4 modules :\n\n- Blockstore\n- Datastore\n- Pinning\n- libp2p\n\nBlockstore :\n\n- put/get blocks\n- bitswap backed by local store\n\nDatastore :\n\n- put/get data keys\n- IPNS names\n- DHT (Distributed Hash Table) provider records\n\nPinning :\n\n- Garbage Collection\n\nLibp2p :\n\n- Pub/Sub\n- DHT\n- Protocol Streams\n\nRun files :\n\n```sh\nnode src/\u003cfilename\u003e\n```\n\nHelia also gives us a very good option to get the logs of what is happening in the process using some ENV variables\n\n```sh\nDEBUG=* node src/unixfs_nodes.js\n```\n\nThe output will look something like this :\n\n![helia screen o/p](./Assets/helia1.png)\n\n## CID explorers\n\nIPLD EXPLORER : \u003chttps://explore.ipld.io/#/explore/bafkreicwbat3xkt2xedhzk4uzfm5ketqsll2kdhlri572vdjlto3bjpzgi\u003e\n\nCID EXPLORER : \u003chttps://cid.ipfs.tech/#bafkreicwbat3xkt2xedhzk4uzfm5ketqsll2kdhlri572vdjlto3bjpzgi\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Focdbytes%2Fipfs_dump_repo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Focdbytes%2Fipfs_dump_repo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Focdbytes%2Fipfs_dump_repo/lists"}