|
1 | 1 | #!/usr/bin/env python3 |
2 | 2 | """ |
3 | | -Bitcoin Utils CLI (bu) - Command line interface for python-bitcoin-utils |
| 3 | +Bitcoin Utils CLI - Command line interface for python-bitcoin-utils |
4 | 4 |
|
5 | 5 | This CLI tool provides educational utilities to interact with Bitcoin through |
6 | 6 | the python-bitcoin-utils library. It's designed to help understand the |
7 | 7 | inner workings of Bitcoin through practical examples and utilities. |
8 | | -
|
9 | | -Installation Instructions: |
10 | | ------------------------- |
11 | | -
|
12 | | -1. Make the file executable: |
13 | | - $ chmod +x bitcoin_utils_cli.py |
14 | | -
|
15 | | -2. Create a symlink named 'bu' in your PATH: |
16 | | - $ sudo ln -s /path/to/bitcoin_utils_cli.py /usr/local/bin/bu |
17 | | -
|
18 | | - Or using pip (if included in a package): |
19 | | - $ pip install python-bitcoin-utils[cli] |
20 | | -
|
21 | | -Usage: |
22 | | ------- |
23 | | - $ bu --help |
24 | | - $ bu generate |
25 | | - $ bu validate 1BgGZ9tcN4rm9KBzDn7KprQz87SZ26SAMH --pubkey 0450863AD64A87AE8A2FE83C1AF1A8403CB53F53E486D8511DAD8A04887E5B23522CD470243453A299FA9E77237716103ABC11A1DF38855ED6F2EE187E9C582BA6 |
26 | | - $ bu decode <transaction_hex> |
27 | | - $ bu script <script_hex> |
28 | | - $ bu block <block_file_path> |
29 | 8 | """ |
30 | 9 |
|
31 | 10 | import argparse |
32 | 11 | import sys |
33 | 12 | import json |
34 | 13 | import binascii |
35 | | -import os |
36 | 14 | from bitcoinutils.setup import setup |
37 | 15 | from bitcoinutils.keys import PrivateKey, PublicKey |
38 | 16 | from bitcoinutils.transactions import Transaction |
@@ -284,7 +262,7 @@ def parse_block(args): |
284 | 262 |
|
285 | 263 | def main(): |
286 | 264 | """Main entry point for the CLI""" |
287 | | - parser = argparse.ArgumentParser(description='Bitcoin Utils CLI (bu) - Educational tools for understanding Bitcoin') |
| 265 | + parser = argparse.ArgumentParser(description='Bitcoin Utils CLI - Educational tools for understanding Bitcoin') |
288 | 266 |
|
289 | 267 | # Network options |
290 | 268 | parser.add_argument('--network', choices=['mainnet', 'testnet', 'regtest'], |
|
0 commit comments