All Projects → fission-suite → ipfs-haskell

fission-suite / ipfs-haskell

Licence: Apache-2.0 license
IPFS wrapper for Haskell

Programming Languages

haskell
3896 projects
Nix
1067 projects
Makefile
30231 projects

Projects that are alternatives of or similar to ipfs-haskell

demo-ipfs-todo
Simple ToDo app using window.ipfs
Stars: ✭ 16 (-56.76%)
Mutual labels:  ipfs
ipfs-add-from-url
A command line executable to add a file to IPFS from a URL instead of a file path
Stars: ✭ 24 (-35.14%)
Mutual labels:  ipfs
kotal
Blockchain Kubernetes Operator
Stars: ✭ 137 (+270.27%)
Mutual labels:  ipfs
nftool
A suite of tools for NFT generative art.
Stars: ✭ 145 (+291.89%)
Mutual labels:  ipfs
pollinations
Generate Art
Stars: ✭ 100 (+170.27%)
Mutual labels:  ipfs
nebula-crawler
🌌 A libp2p DHT crawler, monitor, and measurement tool that exposes timely information about DHT networks.
Stars: ✭ 97 (+162.16%)
Mutual labels:  ipfs
martianpins
Self hosted IPFS pinning service.
Stars: ✭ 23 (-37.84%)
Mutual labels:  ipfs
ipfs-chat
Real-time P2P messenger using go-ipfs pubsub. TUI. End-to-end encrypted texting & file-sharing. NAT traversal.
Stars: ✭ 84 (+127.03%)
Mutual labels:  ipfs
superhighway84
USENET-inspired, uncensorable, decentralized internet discussion system running on IPFS & OrbitDB
Stars: ✭ 437 (+1081.08%)
Mutual labels:  ipfs
ehr-blockchain
Electronic Health Record (EHR) and Electronic Medical Record (EMR) systems. However, they still face some issues regarding the security of medical records, user ownership of data, data integrity etc. The solution to these issues could be the use of a novel technology, i.e., Blockchain. This technology offers to provide a secure, temper-proof pl…
Stars: ✭ 41 (+10.81%)
Mutual labels:  ipfs
ipfs-eth-database
An example of usage IPFS in Ethereum Smart Contracts
Stars: ✭ 55 (+48.65%)
Mutual labels:  ipfs
php-ipfs-api
php client library for ipfs
Stars: ✭ 46 (+24.32%)
Mutual labels:  ipfs
thegraph-react
⚛️ React bindings for helping build decentralized applications quickly on Ethereum and IPFS using GraphQL.
Stars: ✭ 31 (-16.22%)
Mutual labels:  ipfs
almonit-plugin
ENS+IPFS Firefox plugin by Almonit
Stars: ✭ 17 (-54.05%)
Mutual labels:  ipfs
ipfs-blog
IPFS Blog & News
Stars: ✭ 31 (-16.22%)
Mutual labels:  ipfs
ethereum-dapp-ipfs-node.js-mongodb
以太坊开发DApp实战教程——用区块链、星际文件系统(IPFS)、Node.js和MongoDB来构建电商平台
Stars: ✭ 46 (+24.32%)
Mutual labels:  ipfs
go-stellar-ipfs
🌀 A library that is a bridge between Stellar and IPFS.
Stars: ✭ 25 (-32.43%)
Mutual labels:  ipfs
denarius
Denarius [$D] is a PoW/PoS Hybrid Cryptocurrency with Tribus a new PoW Hashing Algo built specifically for D, one of a kind hybrid masternodes called Fortuna Stakes, atomic swaps, staking, mining, IPFS, optional Native Tor and I2P, and much more!
Stars: ✭ 105 (+183.78%)
Mutual labels:  ipfs
origin-website
The code powering our website
Stars: ✭ 36 (-2.7%)
Mutual labels:  ipfs
ipfs-dag-builder-vis
See how the DAGs get built
Stars: ✭ 19 (-48.65%)
Mutual labels:  ipfs

ipfs-haskell

Build Status License Maintainability Built by FISSION Discord Discourse

Documentation: ipfs on hackage

A 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.

QuickStart

Define instances for MonadLocalIPFS and/or MonadRemoteIPFS. Each requires only one function:

class Monad m => MonadRemoteIPFS m where
  runRemote :: Servant.ClientM a -> m (Either Servant.ClientError a)

class Monad m => MonadLocalIPFS m where
  runLocal ::
       [IPFS.Opt]
    -> Lazy.ByteString
    -> m (Either Process.Error Process.RawMessage)

We use RIO processes to shell out to a local IPFS node and Servant for HTTP requests to a remote node.

After that, simply add MonadLocalIPFS m as a constraint to a function and you'll be able to call IPFS within it. For instance:

import           Network.IPFS
import qualified Network.IPFS.Add        as IPFS
import           Network.IPFS.File.Types as File

add ::
  MonadLocalIPFS  m
  => File.Serialzed
  -> m ()
add (Serialized rawData) = IPFS.addRaw rawData >>= \case
  Right newCID -> 
    -- ...
  Left err ->
    -- ...

You can see example instances below:

instance
  ( HasProcessContext cfg
  , HasLogFunc cfg
  , Has IPFS.BinPath cfg
  , Has IPFS.Timeout cfg
  )
  => MonadLocalIPFS (RIO cfg) where
    runLocal opts arg = do
      IPFS.BinPath ipfs <- view hasLens
      IPFS.Timeout secs <- view hasLens
      let opts' = ("--timeout=" <> show secs <> "s") : opts

      runProc readProcess ipfs (byteStringInput arg) byteStringOutput opts' >>= \case
        (ExitSuccess, contents, _) ->
          return $ Right contents
        (ExitFailure _, _, stdErr)
          | Lazy.isSuffixOf "context deadline exceeded" stdErr ->
              return . Left $ Process.Timeout secs
          | otherwise ->
            return . Left $ Process.UnknownErr stdErr

instance
  ( Has IPFS.URL     cfg
  , Has HTTP.Manager cfg
  )
  => MonadRemoteIPFS (RIO cfg) where
    runRemote query = do
      IPFS.URL url <- view hasLens
      manager      <- view hasLens

      url
        & mkClientEnv manager
        & runClientM query
        & liftIO
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].