diff --git a/cli/block_report.py b/cli/block_report.py old mode 100644 new mode 100755 diff --git a/cli/common_parse_utils.py b/cli/common_parse_utils.py old mode 100644 new mode 100755 diff --git a/cli/parse_chain.py b/cli/parse_chain.py old mode 100644 new mode 100755 diff --git a/cli/query.py b/cli/query.py old mode 100644 new mode 100755 index e753c72..9d900dd --- a/cli/query.py +++ b/cli/query.py @@ -1,13 +1,13 @@ -#!/usr/bin/python +#!/usr/bin/python2.7 import sys, urllib, json, datetime, time, hashlib, sha3 from common_parse_utils import read_json, get_sync_info, get_max_height -CMD_FAST_PUT = "fastput" -CMD_PUT = "put" + CMD_RUN = "run" +CMD_PUT_TX = "put" CMD_GET_QUERY = "get" CMD_LS_QUERY = "ls" -ALL_COMMANDS = {CMD_GET_QUERY, CMD_PUT, CMD_RUN, CMD_FAST_PUT, CMD_LS_QUERY} +ALL_COMMANDS = {CMD_RUN, CMD_PUT_TX, CMD_GET_QUERY, CMD_LS_QUERY} def verify_merkle_proof(result, proof, app_hash): parts = proof.split(", ") @@ -51,10 +51,8 @@ def print_checked_abci_query(tmaddress, height, command, query, tentative_info): print_response("height", height) print_response("app_hash", app_hash or "NOT_READY") print_response("proof", (proof or "NO_PROOF").upper()) - print_response("result", result or "EMPTY", True) - if success: - print "OK" - else: + print result or "???" + if not success: print_response("bad", message, True) def latest_provable_height(tmaddress): @@ -68,7 +66,6 @@ def wait_for_height(tmaddress, height, seconds_to_wait = 5): time.sleep(wait_step) - num_args = len(sys.argv) if num_args < 4 or not sys.argv[2] in ALL_COMMANDS: print "usage: python query.py host:port [flags] arg" @@ -79,7 +76,7 @@ tmaddress = sys.argv[1] command = sys.argv[2] flags = "".join(sys.argv[3:(num_args - 1)]) arg = sys.argv[num_args - 1] -if command in {CMD_FAST_PUT, CMD_PUT, CMD_RUN}: +if command in {CMD_PUT_TX, CMD_RUN}: if command == CMD_RUN: query_key = "optarg" tx = query_key + "=" + arg @@ -96,13 +93,12 @@ if command in {CMD_FAST_PUT, CMD_PUT, CMD_RUN}: print_response("bad", log or "NO_MESSAGE", True) else: info = response["result"].get("deliver_tx", {}).get("info") - if command in {CMD_PUT, CMD_RUN} and info is not None: + if command in {CMD_RUN} and info is not None: wait_for_height(tmaddress, height + 1) print_checked_abci_query(tmaddress, height, "get", query_key, info) else: print_response("height", height) print_response("info", info or "EMPTY") - print "OK" elif command in {CMD_GET_QUERY, CMD_LS_QUERY}: height = latest_provable_height(tmaddress) - print_checked_abci_query(tmaddress, height, command, arg, None) \ No newline at end of file + print_checked_abci_query(tmaddress, height, command, arg, None) diff --git a/images/hierarchical_tree.png b/images/hierarchical_tree.png deleted file mode 100644 index c55b758..0000000 Binary files a/images/hierarchical_tree.png and /dev/null differ