diff --git a/17_4_Accessing_Bitcoind_with_Python.md b/17_4_Accessing_Bitcoind_with_Python.md index 3113321..d05f901 100644 --- a/17_4_Accessing_Bitcoind_with_Python.md +++ b/17_4_Accessing_Bitcoind_with_Python.md @@ -11,12 +11,14 @@ You can check this by running: `$ python3 --version` -If it returns a version number (e.g., `3.7.3` or `3.8.3`) then you have python3 installed. Continue on to the next header. +If it returns a version number (e.g., `3.7.3` or `3.8.3`) then you have python3 installed. Continue on to ["Setting Up BitcoinRPC"](17_4_Accessing_Bitcoind_with_Python.md#setting-up-bitcoinrpc). However, if you somehow do not have Python installed, you'll need build it from source as follows: ### Building Python from Source +Skip to ["Setting Up BitcoinRPC"](17_4_Accessing_Bitcoind_with_Python.md#setting-up-bitcoinrpc) if you already have Python 3 running. Otherwise: + #### 1. Install Dependencies ```sh $ sudo apt-get install build-essential checkinstall @@ -46,8 +48,6 @@ $ rm Python-3.8.3.tgz ### Setting Up BitcoinRPC -sudo apt-get install python3-pip - Whether you used an existing Python or built it from source, you're now ready to install the `python-bitcoinrpc` library: ``` @@ -57,10 +57,11 @@ If you don't have `pip` installed, you'll need to run the following: ``` $ sudo apt install python3-pip ``` +(Then repeat the `pip3 install python-bitcoinrpc` instructions.) ### Creating a BitcoinRPC Project -You'll generally need to include appropriate declarations from `bitcoinrpc` in your Bitcoin projects in Python: +You'll generally need to include appropriate declarations from `bitcoinrpc` in your Bitcoin projects in Python. The following will give you access to the RPC based commands: ```py from bitcoinrpc.authproxy import AuthServiceProxy, JSONRPCException ``` @@ -95,7 +96,7 @@ The arguments in the URL are `:@:

10: it_txs = 10 @@ -149,7 +156,7 @@ print("---------------------------------------------------------------\n") ### Running Your Code -You can retrieve [the src doe](src/17_4_getinfo.py) and run it with `python3`: +You can retrieve [the src code](src/17_4_getinfo.py) and run it with `python3`: ``` $ python3 blockinfo.py ---------------------------------------------------------------