比特幣(Bitcoin) RPC Mining API中getnetworkhashps的用法及代碼示例。
用法:
getnetworkhashps ( nblocks height )
返回基於最後n個塊的估計的每秒網絡哈希值。
傳入[blocks]以覆蓋#個塊,-1指定自上次難度更改以來的值。
傳入[height]以估計找到特定塊時的網絡速度。
參數1 - nblocks
類型:數字,可選,默認值= 120
自上次難度改變以來的方塊數,即方塊的-1。
參數2 - height
類型:數字,可選,默認= -1
估算給定高度時的時間。
返回結果
名稱 |
類型 |
描述 |
---|---|---|
x |
numeric |
估計的每秒哈希數 |
示例
bitcoin-cli getnetworkhashps
curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getnetworkhashps", "params": [] }' -H 'content-type: text/plain;' http://127.0.0.1:8332/
相關用法
- Bitcoin getblocktemplate用法及代碼示例
- Bitcoin getmininginfo用法及代碼示例
- Bitcoin prioritisetransaction用法及代碼示例
- Bitcoin submitblock用法及代碼示例
- Bitcoin submitheader用法及代碼示例
注:本文由純淨天空篩選整理自bitcoin.org大神的英文原創作品 Bitcoin getnetworkhashps。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。