{"id":13687308,"url":"https://github.com/fission-codes/ipfs-haskell","last_synced_at":"2025-12-11T23:16:00.984Z","repository":{"id":36631835,"uuid":"223307747","full_name":"fission-codes/ipfs-haskell","owner":"fission-codes","description":"IPFS wrapper for Haskell","archived":false,"fork":false,"pushed_at":"2023-04-04T06:39:26.000Z","size":188,"stargazers_count":43,"open_issues_count":3,"forks_count":5,"subscribers_count":5,"default_branch":"main","last_synced_at":"2025-04-03T04:56:18.373Z","etag":null,"topics":["content-addressing","ipfs","library"],"latest_commit_sha":null,"homepage":"https://hackage.haskell.org/package/ipfs","language":"Haskell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/fission-codes.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":".github/CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2019-11-22T02:33:36.000Z","updated_at":"2024-09-12T14:51:39.000Z","dependencies_parsed_at":"2023-07-12T15:50:12.597Z","dependency_job_id":null,"html_url":"https://github.com/fission-codes/ipfs-haskell","commit_stats":{"total_commits":55,"total_committers":6,"mean_commits":9.166666666666666,"dds":0.4545454545454546,"last_synced_commit":"487da6822d33f038200f46b39dde00a6c1bbe5de"},"previous_names":["fission-suite/ipfs-haskell"],"tags_count":0,"template":false,"template_full_name":"fission-codes/project-template","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fission-codes%2Fipfs-haskell","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fission-codes%2Fipfs-haskell/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fission-codes%2Fipfs-haskell/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fission-codes%2Fipfs-haskell/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fission-codes","download_url":"https://codeload.github.com/fission-codes/ipfs-haskell/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248132462,"owners_count":21053045,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["content-addressing","ipfs","library"],"created_at":"2024-08-02T15:00:52.153Z","updated_at":"2025-12-11T23:16:00.925Z","avatar_url":"https://github.com/fission-codes.png","language":"Haskell","funding_links":[],"categories":["Haskell"],"sub_categories":[],"readme":"# ipfs-haskell\n\n[![Build Status](https://travis-ci.org/fission-suite/PROJECTNAME.svg?branch=master)](https://travis-ci.org/fission-suite/ipfs-haskell)\n[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://github.com/fission-suite/blob/master/LICENSE)\n[![Maintainability](https://api.codeclimate.com/v1/badges/44fb6a8a0cfd88bc41ef/maintainability)](https://codeclimate.com/github/fission-suite/ipfs-haskell/maintainability)\n[![Built by FISSION](https://img.shields.io/badge/⌘-Built_by_FISSION-purple.svg)](https://fission.codes)\n[![Discord](https://img.shields.io/discord/478735028319158273.svg)](https://discord.gg/zAQBDEq)\n[![Discourse](https://img.shields.io/discourse/https/talk.fission.codes/topics)](https://talk.fission.codes)\n\nDocumentation: [ipfs on hackage](http://hackage.haskell.org/package/ipfs)\n\nA library for integrating IPFS into your haskell applications. Interact with the IPFS network by shelling out to a local IPFS node or communicating via the HTTP interface of a remote node. \n\n# QuickStart\n\nDefine instances for `MonadLocalIPFS` and/or `MonadRemoteIPFS`. Each requires only one function:\n\n```haskell\nclass Monad m =\u003e MonadRemoteIPFS m where\n  runRemote :: Servant.ClientM a -\u003e m (Either Servant.ClientError a)\n\nclass Monad m =\u003e MonadLocalIPFS m where\n  runLocal ::\n       [IPFS.Opt]\n    -\u003e Lazy.ByteString\n    -\u003e m (Either Process.Error Process.RawMessage)\n```\n\nWe use RIO processes to shell out to a local IPFS node and Servant for HTTP requests to a remote node.\n\nAfter that, simply add `MonadLocalIPFS m` as a constraint to a function and you'll be able to call IPFS within it.\nFor instance:\n```haskell\nimport           Network.IPFS\nimport qualified Network.IPFS.Add        as IPFS\nimport           Network.IPFS.File.Types as File\n\nadd ::\n  MonadLocalIPFS  m\n  =\u003e File.Serialzed\n  -\u003e m ()\nadd (Serialized rawData) = IPFS.addRaw rawData \u003e\u003e= \\case\n  Right newCID -\u003e \n    -- ...\n  Left err -\u003e\n    -- ...\n\n```\n\nYou can see example instances below:\n```haskell\ninstance\n  ( HasProcessContext cfg\n  , HasLogFunc cfg\n  , Has IPFS.BinPath cfg\n  , Has IPFS.Timeout cfg\n  )\n  =\u003e MonadLocalIPFS (RIO cfg) where\n    runLocal opts arg = do\n      IPFS.BinPath ipfs \u003c- view hasLens\n      IPFS.Timeout secs \u003c- view hasLens\n      let opts' = (\"--timeout=\" \u003c\u003e show secs \u003c\u003e \"s\") : opts\n\n      runProc readProcess ipfs (byteStringInput arg) byteStringOutput opts' \u003e\u003e= \\case\n        (ExitSuccess, contents, _) -\u003e\n          return $ Right contents\n        (ExitFailure _, _, stdErr)\n          | Lazy.isSuffixOf \"context deadline exceeded\" stdErr -\u003e\n              return . Left $ Process.Timeout secs\n          | otherwise -\u003e\n            return . Left $ Process.UnknownErr stdErr\n\ninstance\n  ( Has IPFS.URL     cfg\n  , Has HTTP.Manager cfg\n  )\n  =\u003e MonadRemoteIPFS (RIO cfg) where\n    runRemote query = do\n      IPFS.URL url \u003c- view hasLens\n      manager      \u003c- view hasLens\n\n      url\n        \u0026 mkClientEnv manager\n        \u0026 runClientM query\n        \u0026 liftIO\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffission-codes%2Fipfs-haskell","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffission-codes%2Fipfs-haskell","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffission-codes%2Fipfs-haskell/lists"}