Browse Source

modified: mmnode-blocks-info
modified: mmnode-netrate
modified: mmnode-peerblocks

The MMGen Project 4 years ago
parent
commit
d96011742b
3 changed files with 16 additions and 5 deletions
  1. 5 1
      mmnode-blocks-info
  2. 6 2
      mmnode-netrate
  3. 5 2
      mmnode-peerblocks

+ 5 - 1
mmnode-blocks-info

@@ -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()

+ 6 - 2
mmnode-netrate

@@ -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')

+ 5 - 2
mmnode-peerblocks

@@ -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'])