本文整理汇总了Python中jsonrpclib.Server.getinfo方法的典型用法代码示例。如果您正苦于以下问题:Python Server.getinfo方法的具体用法?Python Server.getinfo怎么用?Python Server.getinfo使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类jsonrpclib.Server
的用法示例。
在下文中一共展示了Server.getinfo方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: Rpc
# 需要导入模块: from jsonrpclib import Server [as 别名]
# 或者: from jsonrpclib.Server import getinfo [as 别名]
class Rpc(object):
def __init__(self, config):
self.rpc = Server(config)
def get_blocks(self):
return self.rpc.getinfo()['blocks']
def get_names_as_dict(self):
return self.rpc.name_filter('^d/[a-z0-9_-]+$', 0)
def get_names(self):
return [Name(x) for x in self.get_names_as_dict()]
示例2: raw_input
# 需要导入模块: from jsonrpclib import Server [as 别名]
# 或者: from jsonrpclib.Server import getinfo [as 别名]
pphrase = raw_input("Enter passphrase: ")
s.walletpassphrase(pphrase, t)
exit()
if options.peers:
# The ip addresses contain occasional dupes
peers = s.getpeerinfo()
peer_ips = set()
for p in peers:
addr = p["addr"].split(":")[0]
peer_ips.add(addr)
for ip in peer_ips:
print(ip)
exit()
info = s.getinfo()
if options.verbose:
keys = info.keys()
elif coin == "Vcash":
# No testnet in info
keys = ["balance"]
else:
# Primecoin does not provide difficulty in getinfo, only separately
keys = ["balance", "testnet"]
if coin == "cryptonite":
info["balance"] = ep_dec(info["balance"])
if options.diff:
diff = options.diff