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

[ library, mit, web ] [ Propose Tags ]

simple json-rpc client for PegNet integration


[Skip to Readme]

Modules

[Last Documentation]

  • PegNet
    • RPC
      • PegNet.RPC.Api

Downloads

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees

Candidates

  • No Candidates
Versions [RSS] 0.1.0.0, 0.1.1.0, 0.1.1.1, 0.1.1.2
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 2019-11-03T23:25:36Z
Distributions
Downloads 1363 total (14 in the last 30 days)
Rating (no votes yet) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs not available [build log]
All reported builds failed as of 2019-11-04 [all 3 reports]

Readme for api-rpc-pegnet-0.1.0.0

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

Installation

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

Usage

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