network-bitcoin-1.0.2: An interface to bitcoind.

Safe HaskellNone



An interface to bitcoind's available network-related RPC calls. The implementation of these functions can be found at

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.



data Auth Source

Auth describes authentication credentials for making API requests to the Bitcoin daemon.




rpcUrl :: Text

URL, with port, where bitcoind listens

rpcUser :: Text

same as bitcoind's rpcuser config

rpcPassword :: Text

same as bitcoind's rpcpassword config


getConnectionCount :: Auth -> IO IntegerSource

Returns the number of connections to other nodes.

data PeerInfo Source

Information on a given connected node in the 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!




addressName :: Text

The ip:port of this peer, as a string.

services :: Text
lastSend :: Integer

Relative to when we first time we conected with this peer (and in milliseconds), the last time we sent this peer any data.

lastRecv :: Integer

Relative to the first time we connected with this peer (and in milliseconds), the last time we sent this peer any data.

connectionTime :: Integer

How long have we been connected to this peer (in milliseconds).

peerVersion :: Integer

The version of bitcoind the peer is running.

peerSubversion :: Integer

The sub-version of bitcoind the peer is running.

inbound :: Bool
releaseTime :: Integer
startingHeight :: Integer
banScore :: Integer

How many times has this peer behaved badly?

getPeerInfo :: Auth -> IO PeerInfoSource

Returns data about each connected network node.