worth it's weight in bitcoin.

rn working on figuring out how to use python-bitcoinlib to access bitcoin core's JSON-RPC for regtest network

Reply to this note

Please Login to reply.

Discussion

figured it out. learned much more than I anticipated, alot about bitcoin.conf

but then the python code to specify the network you want is simple:

import bitcoin

from bitcoin.rpc import RawProxy

bitcoin.SelectParams("regtest")

# Create a connection to local Bitcoin Core node (regtest)

p = RawProxy()

info = p.getblockchaininfo()

print(info["blocks"])

here is a simple config file

$ cat ~/.bitcoin/bitcoin.conf

regtest=1

txindex=1

[regtest]

wallet=/home/j/.bitcoin/regtest/wallets/j-regtest

I use Vim. here is a remap I use a lot

vnoremap p :w !python3