Starting to interface with my btc node and I'm getting an RPC error 401 unoathorized error when running the below code. My RPC_Auth (rpcuser:rpcpassword) is correct. Is there something else I need to configure? Any help would be appreciated.
rpc_url = f"http://{rpc_auth}@{rpc_host}:{rpc_port}"
rpc_client = AuthServiceProxy(rpc_url, timeout=120)
try:
peer_info = rpc_client.getpeerinfo()
print(peer_info)
except JSONRPCException as e:
print(f"RPC Error: {e}")
rpcuser
andrpcpassword
in yourbitcoin.conf
, did you also restart Bitcoin Core so that those changes apply? – Ava Chow Sep 07 '23 at 20:53