Safe Haskell | None |
---|
An interface to bitcoind's available mining RPC calls. The implementation of these functions can be found at https://github.com/bitcoin/bitcoin/blob/master/src/rpcmining.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.
Note that it is highly discouraged to use bitcoind for actual bitcoin mining. It uses the CPU for mining, which is much, much less power efficient than GPU mining. If you're paying for power, you will not come out ahead.
Instead, consider using a GPU miner listed at https://en.bitcoin.it/wiki/Software#Mining_apps.
- data Auth = Auth {}
- getGenerate :: Auth -> IO Bool
- setGenerate :: Auth -> Bool -> Maybe Int -> IO ()
- getHashesPerSec :: Auth -> IO Integer
- data MiningInfo = MiningInfo {}
- getMiningInfo :: Auth -> IO MiningInfo
- data HashData = HashData {}
- getWork :: Auth -> IO HashData
- solveBlock :: Auth -> HexString -> IO Bool
- data Transaction = Transaction {}
- data CoinBaseAux = CoinBaseAux {}
- data BlockTemplate = BlockTemplate {
- blockVersion :: Integer
- previousBlockHash :: HexString
- transactionsToInclude :: Vector Transaction
- coinBaseAux :: CoinBaseAux
- coinBaseValue :: Integer
- btTarget :: HexString
- minTime :: Integer
- nonceRange :: HexString
- sigopLimit :: Integer
- sizeLimit :: Integer
- curTime :: Integer
- btBits :: HexString
- btHeight :: Integer
- getBlockTemplate :: Auth -> IO BlockTemplate
- submitBlock :: Auth -> HexString -> IO Bool
Documentation
Returns whether or not bitcoind is generating bitcoins.
:: Auth | bitcoind RPC authorization |
-> Bool | Turn it on, or turn it off? |
-> Maybe Int | Generation is limited to this number of processors. Set it to Nothing to keep the value at what it was before, Just -1 to use all available cores, and any other value to limit it. |
-> IO () |
Controls whether or not bitcoind is generating bitcoins.
getHashesPerSec :: Auth -> IO IntegerSource
Returns a recent hashes per second performance measurement while generating.
data MiningInfo Source
Information related to the current bitcoind mining operation.
If a field is undocumented here, it's because I don't know what it means. If you DO know what it means, I'd love it if you would submit a patch to help complete this documentation.
MiningInfo | |
|
getMiningInfo :: Auth -> IO MiningInfoSource
Returns an object containing mining-related information.
solveBlock :: Auth -> HexString -> IO BoolSource
Tries to solve the given block, and returns true if it was successful.
data CoinBaseAux Source
data BlockTemplate Source
A template for constructing a block to work on.
See https://en.bitcoin.it/wiki/BIP_0022 for the full specification.
BlockTemplate | |
|
getBlockTemplate :: Auth -> IO BlockTemplateSource
Returns data needed to construct a block to work on.