network-bitcoin-1.1.0: An interface to bitcoind.

Safe HaskellNone

Network.Bitcoin.Net

Description

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.

Synopsis

Documentation

data Auth Source

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

Constructors

Auth 

Fields

rpcUrl :: Text

URL, with port, where bitcoind listens

rpcUser :: Text

same as bitcoind's rpcuser config

rpcPassword :: Text

same as bitcoind's rpcpassword config

Instances

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!

Constructors

PeerInfo 

Fields

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.