modified: mmnode-blocks-info

modified:   mmnode-netrate
modified:   mmnode-peerblocks
This commit is contained in:
The MMGen Project 2020-06-01 20:29:58 +00:00
commit d96011742b
Signed by: mmgen
GPG key ID: 3F8B1861E32B7DA2
3 changed files with 16 additions and 5 deletions

View file

@ -311,9 +311,13 @@ if len(cmd_args) not in (0,1):
opts.usage()
async def main():
from mmgen.protocol import init_proto_from_opts
proto = init_proto_from_opts()
from mmgen.rpc import rpc_init
global c
c = await rpc_init()
c = await rpc_init(proto)
if opt.transaction:
m = BlocksInfoTxFind()

View file

@ -39,8 +39,12 @@ cmd_args = opts.init(opts_data)
ERASE_LINE,CUR_UP = '\033[K','\033[1A'
async def main():
from mmgen.protocol import init_proto_from_opts
proto = init_proto_from_opts()
from mmgen.rpc import rpc_init
c = await rpc_init()
c = await rpc_init(proto)
async def get_data():
d = await c.call('getnettotals')
@ -64,6 +68,6 @@ async def main():
rs,ss,ts = r,s,t
try:
run_session(main(),do_rpc_init=False)
run_session(main())
except KeyboardInterrupt:
sys.stderr.write('\n')

View file

@ -150,8 +150,11 @@ async def main():
msg_r(CUR_HOME+ERASE_ALL)
from mmgen.protocol import init_proto_from_opts
proto = init_proto_from_opts()
from mmgen.rpc import rpc_init
rpc = await rpc_init()
rpc = await rpc_init(proto)
while True:
await do_inflight(rpc)
@ -168,7 +171,7 @@ ERASE_ALL,ERASE_LINE,CUR_HOME,CUR_HIDE,CUR_SHOW = (
'\033[J','\033[K','\033[H','\033[?25l','\033[?25h')
try:
run_session(main(),do_rpc_init=False)
run_session(main())
except:
from subprocess import run
run(['stty','sane'])