api-rpc-pegnet: simple json-rpc client for PegNet

[ library, mit, web ] [ Propose Tags ]

simple json-rpc client for PegNet integration

[Skip to Readme]
Versions [faq]
Dependencies aeson, aeson-casing, base (>=4.7 && <5), bytestring, http-client, http-client-tls, http-conduit, json-alt, network, remote-json, remote-json-client, remote-monad, text, time, transformers [details]
License MIT
Copyright Copyright: (c) 2019 Sergey Bushnyak
Author Sergey Bushnyak
Maintainer sergey.bushnyak@sigrlami.eu
Category Web
Home page https://github.com/sigrlami/api-rpc-pegnet#readme
Bug tracker https://github.com/sigrlami/api-rpc-pegnet/issues
Source repo head: git clone https://github.com/sigrlami/api-rpc-pegnet
Uploaded by sigrlami at Sun Nov 3 23:25:36 UTC 2019
Distributions NixOS:
Downloads 27 total (27 in the last 30 days)
Rating (no votes yet) [estimated by rule of succession]
Your Rating
  • λ
  • λ
  • λ
Status Hackage Matrix CI
Docs not available [build log]
All reported builds failed as of 2019-11-04 [all 3 reports]


  • PegNet
    • RPC
      • PegNet.RPC.Api


Maintainer's Corner

For package maintainers and hackage trustees

Readme for api-rpc-pegnet-

[back to package description]

Haskell JSON-RPC client for PegNet

Build Status License

A JSON-RPC Haskell client for the PegNet API. Each response has special ADT(algebraic data type) that automatically converted from JSON response.


You can install package from Hackage and build with Cabal, but we recommend to use Stack tool. Add to you dependencies in stack.yaml and cabal file dependency - api-rpc-factom.

To run and test fromrepository

  1. Build with stack
$ stack build
  1. Load REPL with stack for evaluation
$ stack repl
  1. execute required methods


for basic daemon functionality

  1. import with
import PegNet.RPC.Api

or load in REPL.

  1. build communication session with
weakSession (traceSendAPI "" $ clientSendAPI endpoint)
  1. run required methods inside RPC monad

Retreiving a sync status

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