Skip to content

Commit 3c94ef1

Browse files
authored
Merge pull request #777 from guydavis/integration
Fixes for Cactus CLI renamings.
2 parents cab4c70 + de83a25 commit 3c94ef1

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

api/commands/chia_cli.py

+12-3
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,10 @@ def load_blockchain_show(blockchain):
117117

118118
def load_connections_show(blockchain):
119119
chia_binary = globals.get_blockchain_binary(blockchain)
120-
proc = Popen("{0} show --connections".format(chia_binary), stdout=PIPE, stderr=PIPE, shell=True)
120+
if blockchain == 'cactus': # Cactus now supports only 'peer' command
121+
proc = Popen("{0} peer -c full_node".format(chia_binary), stdout=PIPE, stderr=PIPE, shell=True)
122+
else:
123+
proc = Popen("{0} show --connections".format(chia_binary), stdout=PIPE, stderr=PIPE, shell=True)
121124
try:
122125
outs, errs = proc.communicate(timeout=30)
123126
if errs:
@@ -205,7 +208,10 @@ def pause_wallet(blockchain):
205208
def remove_connection(node_id, ip, blockchain):
206209
chia_binary = globals.get_blockchain_binary(blockchain)
207210
try:
208-
proc = Popen("{0} show --remove-connection {1}".format(chia_binary, node_id), stdout=PIPE, stderr=PIPE, shell=True)
211+
if blockchain == 'cactus': # Cactus now supports only 'peer' command
212+
proc = Popen("{0} peer --remove-connection {1} full_node".format(chia_binary, node_id), stdout=PIPE, stderr=PIPE, shell=True)
213+
else:
214+
proc = Popen("{0} show --remove-connection {1}".format(chia_binary, node_id), stdout=PIPE, stderr=PIPE, shell=True)
209215
try:
210216
outs, errs = proc.communicate(timeout=30)
211217
if errs:
@@ -286,7 +292,10 @@ def add_connections(connections, blockchain):
286292
elif socket.gethostbyname(hostname) != hostname:
287293
app.logger.debug('{} is a valid hostname'.format(hostname))
288294
app.logger.info("Adding {0} connection to peer: {1}".format(blockchain, connection))
289-
proc = Popen("{0} show --add-connection {1}".format(chia_binary, connection), stdout=PIPE, stderr=PIPE, shell=True)
295+
if blockchain == 'cactus': # Cactus now supports only 'peer' command
296+
proc = Popen("{0} peer --add-connection {1} full_node".format(chia_binary, connection), stdout=PIPE, stderr=PIPE, shell=True)
297+
else:
298+
proc = Popen("{0} show --add-connection {1}".format(chia_binary, connection), stdout=PIPE, stderr=PIPE, shell=True)
290299
try:
291300
outs, errs = proc.communicate(timeout=60)
292301
if errs:

0 commit comments

Comments
 (0)