-
Notifications
You must be signed in to change notification settings - Fork 72
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Stéphane Depierrepont <[email protected]>
- Loading branch information
Showing
5 changed files
with
128 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,46 @@ | ||
package bitcoind | ||
|
||
// Represents a block | ||
type block struct { | ||
Hash string `json:"hash"` | ||
Confirmations uint64 `json:"confirmations"` | ||
Size uint64 `json:"size"` | ||
Height uint64 `json:"height"` | ||
Version uint64 `json:"version"` | ||
Merkleroot string `json:"merkleroot"` | ||
Tx []string `json:"tx"` | ||
Time int64 `json:"time"` | ||
Nonce uint64 `json:"nonce"` | ||
Bits string `json:"bits"` | ||
Difficulty float64 `json:"difficulty"` | ||
Chainwork string `json:"chainwork"` | ||
Previousblockhash string `json:"previousblockhash"` | ||
Nextblockhash string `json:"nextblockhash"` | ||
type Block struct { | ||
// The block hash | ||
Hash string `json:"hash"` | ||
|
||
// The number of confirmations | ||
Confirmations uint64 `json:"confirmations"` | ||
|
||
// The block size | ||
Size uint64 `json:"size"` | ||
|
||
// The block height or index | ||
Height uint64 `json:"height"` | ||
|
||
// The block version | ||
Version uint32 `json:"version"` | ||
|
||
// The merkle root | ||
Merkleroot string `json:"merkleroot"` | ||
|
||
// Slice on transaction ids | ||
Tx []string `json:"tx"` | ||
|
||
// The block time in seconds since epoch (Jan 1 1970 GMT) | ||
Time int64 `json:"time"` | ||
|
||
// The nonce | ||
Nonce uint64 `json:"nonce"` | ||
|
||
// The bits | ||
Bits string `json:"bits"` | ||
|
||
// The difficulty | ||
Difficulty float64 `json:"difficulty"` | ||
|
||
// Total amount of work in active chain, in hexadecimal | ||
Chainwork string `json:"chainwork,omitempty"` | ||
|
||
// The hash of the previous block | ||
Previousblockhash string `json:"previousblockhash"` | ||
|
||
// The hash of the next block | ||
Nextblockhash string `json:"nextblockhash"` | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,52 @@ | ||
package bitcoind | ||
|
||
type info struct { | ||
Version uint32 `json:"version"` | ||
Protocolversion uint32 `json:"protocolversion"` | ||
Walletversion uint32 `json:"walletversion"` | ||
Balance float64 `json:"balance"` | ||
Blocks uint32 `json:"blocks"` | ||
Timeoffset uint32 `json:"timeoffset"` | ||
Connections uint32 `json:"connections"` | ||
Proxy string `json:"proxy"` | ||
Difficulty float64 `json:"difficulty"` | ||
Testnet bool `json:"testnet"` | ||
Keypoololdest uint64 `json:"keypoololdest"` | ||
Paytxfee float64 `json:"paytxfee"` | ||
Relayfee float64 `json:"relayfee"` | ||
Errors string `json:"errors"` | ||
// An Info represent a response to getmininginfo | ||
type Info struct { | ||
// The server version | ||
Version uint32 `json:"version"` | ||
|
||
// The protocol version | ||
Protocolversion uint32 `json:"protocolversion"` | ||
|
||
// The wallet version | ||
Walletversion uint32 `json:"walletversion"` | ||
|
||
// The total bitcoin balance of the wallet | ||
Balance float64 `json:"balance"` | ||
|
||
// The current number of blocks processed in the server | ||
Blocks uint32 `json:"blocks"` | ||
|
||
// The time offset | ||
Timeoffset uint32 `json:"timeoffset"` | ||
|
||
// The number of connections | ||
Connections uint32 `json:"connections"` | ||
|
||
// Tthe proxy used by the server | ||
Proxy string `json:"proxy,omitempty"` | ||
|
||
// Tthe current difficulty | ||
Difficulty float64 `json:"difficulty"` | ||
|
||
// If the server is using testnet or not | ||
Testnet bool `json:"testnet"` | ||
|
||
// The timestamp (seconds since GMT epoch) of the oldest pre-generated key in the key pool | ||
Keypoololdest uint64 `json:"keypoololdest"` | ||
|
||
// How many new keys are pre-generated | ||
KeypoolSize uint32 `json:"keypoolsize,omitempty"` | ||
|
||
// The timestamp in seconds since epoch (midnight Jan 1 1970 GMT) that the wallet is unlocked for transfers, or 0 if the wallet is locked | ||
UnlockedUntil int64 `json:"unlocked_until,omitempty"` | ||
|
||
// the transaction fee set in btc/kb | ||
Paytxfee float64 `json:"paytxfee"` | ||
|
||
// Minimum relay fee for non-free transactions in btc/kb | ||
Relayfee float64 `json:"relayfee"` | ||
|
||
// Any error messages | ||
Errors string `json:"errors"` | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,37 @@ | ||
package bitcoind | ||
|
||
// A MiningInfo represents a mininginfo response | ||
type MiningInfo struct { | ||
// The current block | ||
Blocks uint64 `json:"block"` | ||
Blocks uint64 `json:"blocks"` | ||
|
||
// The last block size | ||
CurrentBlocksize uint64 `json:"currentblocksize"` | ||
CurrentBlockTx uint64 `json:"currentblocktx"` // The last block transaction | ||
Difficulty float64 `json:"difficulty"` | ||
Errors string `json:"errors"` | ||
GenProcLimit int32 `json:"genproclimit"` | ||
NetworkHashps uint64 `json:"networkhashps"` | ||
PooledtTx uint64 `json:"pooledtx"` | ||
Testnet bool `json:"testnet"` | ||
Generate bool `json:"generate"` | ||
HashesPersec uint64 `json:"hashespersec"` | ||
CurrentBlocksize uint64 `json:"currentblocksize"` | ||
|
||
// The last block transaction | ||
CurrentBlockTx uint64 `json:"currentblocktx"` | ||
|
||
// The current difficulty | ||
Difficulty float64 `json:"difficulty"` | ||
|
||
// Current errors | ||
Errors string `json:"errors"` | ||
|
||
// The processor limit for generation. -1 if no generation. (see getgenerate or setgenerate calls) | ||
GenProcLimit int32 `json:"genproclimit"` | ||
|
||
// The size of the mem pool | ||
PooledtTx uint64 `json:"pooledtx"` | ||
|
||
// If using testnet or not | ||
Testnet bool `json:"testnet"` | ||
|
||
// If the generation is on or off (see getgenerate or setgenerate calls) | ||
Generate bool `json:"generate"` | ||
|
||
// The network hashrate | ||
NetworkHashps uint64 `json:"networkhashps"` | ||
|
||
// Node hashrate | ||
HashesPersec uint64 `json:"hashespersec"` | ||
} |