homepage: https://github.com/sigrlami/api-rpc-pegnet#readme
changelog-type: ''
hash: 04b285dcf7f84f3cd1b86b3dd888d1646e7648283826c7adafb7e518afe0635a
test-bench-deps: {}
maintainer: sergey.bushnyak@sigrlami.eu
synopsis: simple json-rpc client for PegNet
changelog: ''
basic-deps:
  http-client: -any
  json-alt: -any
  bytestring: -any
  aeson-casing: -any
  base: ! '>=4.7 && <5'
  time: -any
  remote-json-client: -any
  text: -any
  remote-monad: -any
  network: -any
  remote-json: -any
  http-client-tls: -any
  transformers: -any
  http-conduit: -any
  aeson: -any
all-versions:
- 0.1.0.0
author: Sergey Bushnyak
latest: 0.1.0.0
description-type: markdown
description: |
  # Haskell JSON-RPC client for PegNet

  [![Build Status](https://travis-ci.com/kompendium-llc/api-rpc-factom.svg?branch=master)](https://travis-ci.com/kompendium-llc/api-rpc-factom)
  [![License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/kompendium-llc/api-rpc-factom/blob/master/LICENSE)

  A JSON-RPC Haskell client for the PegNet [API](https://github.com/pegnet/pegnetd/wiki/API). Each response has special ADT(algebraic data type) that automatically converted from JSON response.

  # Installation

  You can install package from [Hackage](https://hackage.haskell.org/package/api-rpc-factom) and build with Cabal, but we recommend to use [Stack](https://haskellstack.org) tool. Add to you dependencies in stack.yaml and cabal file dependency `- api-rpc-factom`.

  To run and test fromrepository

  1. Build with stack
  ```bash
  $ stack build
  ```

  2. Load REPL with stack for evaluation
  ```
  $ stack repl
  ```

  3. execute required methods

  ## Usage

  for basic daemon functionality

  1. import with

  ```haskell
  import PegNet.RPC.Api
  ```
  or load in REPL.

  2. build communication session with
  ```
  weakSession (traceSendAPI "" $ clientSendAPI endpoint)
  ```

  3. run required methods inside `RPC` monad

  #### Retreiving a sync status

  ```haskell
  -- build communication session
  let s = weakSession (traceSendAPI "" $ clientSendAPI endpoint)

  -- run Remote Monad
  h <- send s $ do
           -- run specific events by executing exposed
           h <- reqGetSyncStatus
           return h
  -- show converted ADT
  print h
  -- or use for special business logic
  ```
license-name: MIT

Update from Hackage at 2019-11-03T23:34:21Z
Update from Hackage at 2019-11-03T23:34:21Z
