| Safe Haskell | None |
|---|---|
| Language | Haskell98 |
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
- type Client = ByteString -> IO ByteString
- getClient :: String -> ByteString -> ByteString -> IO Client
- getConnectionCount :: Client -> IO Integer
- data PeerInfo = PeerInfo {}
- getPeerInfo :: Client -> IO [PeerInfo]
- data AddNodeCommand
- addNode :: Client -> Text -> AddNodeCommand -> IO ()
- disconnectNode :: Client -> Maybe Text -> Maybe Int -> IO ()
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!
Constructors
| PeerInfo | |
Fields
| |
data AddNodeCommand Source #
Instances
| Eq AddNodeCommand Source # | |
Defined in Network.Bitcoin.Net Methods (==) :: AddNodeCommand -> AddNodeCommand -> Bool # (/=) :: AddNodeCommand -> AddNodeCommand -> Bool # | |
| Read AddNodeCommand Source # | |
Defined in Network.Bitcoin.Net Methods readsPrec :: Int -> ReadS AddNodeCommand # readList :: ReadS [AddNodeCommand] # | |
| Show AddNodeCommand Source # | |
Defined in Network.Bitcoin.Net Methods showsPrec :: Int -> AddNodeCommand -> ShowS # show :: AddNodeCommand -> String # showList :: [AddNodeCommand] -> ShowS # | |
| ToJSON AddNodeCommand Source # | |
Defined in Network.Bitcoin.Net Methods toJSON :: AddNodeCommand -> Value # toEncoding :: AddNodeCommand -> Encoding # toJSONList :: [AddNodeCommand] -> Value # toEncodingList :: [AddNodeCommand] -> Encoding # | |