-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTool_address_utxo_ids.py
executable file
·53 lines (43 loc) · 2.05 KB
/
Tool_address_utxo_ids.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#!/usr/bin/env python3
"""Quick app to extract txout data of an address
by Sziller"""
import logging
from SalletNodePackage import BitcoinNodeObject as BNOb
from DataVisualizer.data2str import rdf
import sys
# Setting up logger logger - START -
lg = logging.getLogger()
# Setting up logger logger - ENDED -
# NOTSET=0, DEBUG=10, INFO=20, WARN=30, ERROR=40, CRITICAL=50
def tool_address_utxo_ids():
"""=== App name: tool_address_utxo_ids =================================================================================
Quick script to receive a Transactions dictionary representation.
This app contacts your own node.
Use: from the termial
============================================================================================== by Sziller ==="""
node = BNOb.Node(alias="sziller_node", is_rpc=True)
tx_hash = str(input("Enter tx ID: "))
tx_data = node.nodeop_getrawtransaction(tx_hash=tx_hash, verbose=True)
data_as_displayed = rdf(data=tx_data)
lg.info("Transaction: \n" + data_as_displayed)
print(data_as_displayed)
if __name__ == "__main__":
logging.basicConfig(filename="./log/tool_address_utxo_ids.log",
level=logging.NOTSET,
filemode="w",
format="%(asctime)s [%(levelname)8s]: %(message)s",
datefmt='%y%m%d %H:%M:%S')
lg.warning("START: {:>85} <<<".format('Tool_address_utxo_ids.py'))
try:
# When starting from icon:
testdata = sys.argv[0]
print("--- Initiated by ICONCLICK ---")
# ------------------------------------------------------
except IndexError:
# When starting from IDLE:
testdata = False
print("--- Initiated over IDLE ---")
# ------------------------------------------------------
# tool_node_tx_request()
tool_address_utxo_ids()
lg.warning("ENDED: {:>85} <<<".format('Tool_TX_request.py'))