1
0
mirror of https://github.com/romanz/electrs.git synced 2024-11-19 01:43:29 +01:00
electrs/contrib/get_tx.py

17 lines
369 B
Python
Raw Normal View History

2021-03-26 09:05:58 +01:00
#!/usr/bin/env python3
import argparse
import client
import json
def main():
parser = argparse.ArgumentParser()
parser.add_argument("txid")
args = parser.parse_args()
conn = client.Client(("localhost", 50001))
tx = conn.call("blockchain.transaction.get", args.txid, True)["result"]
print(json.dumps(tx))
if __name__ == "__main__":
main()