Safe Haskell | None |
---|---|
Language | Haskell98 |
An interface to bitcoind's available network-related RPC calls. The implementation of these functions can be found at https://github.com/bitcoin/bitcoin/blob/master/src/rpcnet.cpp.
If any APIs are missing, patches are always welcome. If you look at the source of this module, you'll see that the interface code is trivial.
- type Client = ByteString -> IO ByteString
- getClient :: String -> ByteString -> ByteString -> IO Client
- getConnectionCount :: Client -> IO Integer
- data PeerInfo = PeerInfo {}
- getPeerInfo :: Client -> IO [PeerInfo]
Documentation
type Client = ByteString -> IO ByteString Source
Client
describes authentication credentials and host info for
making API requests to the Bitcoin daemon.
getClient :: String -> ByteString -> ByteString -> IO Client Source
getClient
takes a url, rpc username, and rpc password
and returns a Client that can be used to make API calls. Each
Client encloses a Manager (from http-client) that re-uses
connections for requests, so long as the same Client is
is used for each call.
getConnectionCount :: Client -> IO Integer Source
Returns the number of connections to other nodes.
Information about a peer node of the Bitcoin network.
The documentation for this data structure is incomplete, as I honestly don't know what some of these fields are for. Patches are welcome!
PeerInfo | |
|
getPeerInfo :: Client -> IO [PeerInfo] Source
Returns data about all connected peer nodes.