本文整理汇总了Python中jsonrpclib.Server.eth_hashrate方法的典型用法代码示例。如果您正苦于以下问题:Python Server.eth_hashrate方法的具体用法?Python Server.eth_hashrate怎么用?Python Server.eth_hashrate使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类jsonrpclib.Server
的用法示例。
在下文中一共展示了Server.eth_hashrate方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: Server
# 需要导入模块: from jsonrpclib import Server [as 别名]
# 或者: from jsonrpclib.Server import eth_hashrate [as 别名]
parser.add_argument("--sendto", "-s", nargs = 2, help = "Send toaddress amount in ETH. The account must be unlocked.")
parser.add_argument("-u", "--url", dest="url", default="http://localhost:8545", help="Connect to a different URL, instead of your local Ethereum daemon")
parser.add_argument("-v", "--verbose", action = "store_true")
parser.add_argument("-W", "--watts", dest="watts", type=float, help="Power usage of miners for profitability calculation")
parser.add_argument("-w", "--kwhprice", dest="kwhprice", type=float, help="kWh price for profitability calculation")
options = parser.parse_args()
daemon = Server(options.url)
info = {"hashrate": float(int(daemon.eth_hashrate(), 16)),
"balances": map(get_balance, daemon.eth_accounts()),
"blocks": int(daemon.eth_blockNumber(), 16),
"difficulty": float(int(daemon.eth_getBlockByNumber("latest", False)["difficulty"], 16)),
"peers": int(daemon.net_peerCount(), 16),
}
info["total balance"] = sum(info["balances"])
if options.classic:
cur = "ETC"
else:
cur = "ETH"
if options.account_id > -1:
aid = options.account_id