A JSON-RPC Haskell client for the Factom protocol. Each response has special ADT(algebraic data type) that automatically converted from JSON response. Using Remote Monad pattern multiple request can be batched and executed simulatenously, following more robust approach and reducing usage of expensive RPC calls.
Choosing a batching strategy. There are two strategies:
Weak
- a single command or a single procedure, orStrong
- a sequence of commands, optionally terminated by a procedure
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-accumulate
.
To run and test from repository
- Build with stack
$ stack build
- Load REPL with stack for evaluation
$ stack repl
- execute required methods
let s = weakSession (traceSendAPI "" $ clientSendAPI endpoint)
h <-
send s $ do
h <- reqGetData "acc://9c549cbba290efeb8029184caac3d36c5bfcacb361a29282/ACME"
return h
print h
See API documentation first, to get familliar with API methods https://docs.accumulatenetwork.io/ and https://documenter.getpostman.com/view/1835497/UzBnrSFB
See how it's used in real application here https://github.com/sigrlami/siare/tree/master/siare-accumulate - Siare is an Oracle dApps that brings various types of data on-chain. There you can see examples of getting infromation from chain, creating transactions and writing to data accounts.
The library developed by Kelecorix, Inc. If you're an active user or find it useful we strongly encourage you to support our efforts and ensure long maintenance by contributing a small donation to one of the following cryptocurrency addresses:
- ACME: acc://dodecahedron.acme/tipjar
- ETH: 0x885cf43dbe00739202d817d87133189dc5d2441d