Open ghost opened 5 years ago
I'm facing the same issue but don't need cookie-based authentication for local experiments on regtest... But I also don't see any .cookie
file in ~/.bitcoin
(if that's what is meant by configuration directory).
Is there a way to force authentication based on static credentials?
Authentication in the example did not work for me:
# rpc_user and rpc_password are set in the bitcoin.conf file
rpc_connection = AuthServiceProxy("http://%s:%s@127.0.0.1:8332"%(rpc_user, rpc_password))
Instead I followed this source: https://github.com/bitcoin/bitcoin/blob/master/doc/JSON-RPC-interface.md#json-rpc-interface
The cookie-method worked for me. With the this mehtod, the example would look like this::
#The file .cookie in the Bitcoin Core configuration directory specifies your login credentials each time bitcoin core is started
rpc_connection = AuthServiceProxy("http://%s:%s@127.0.0.1:8332"%("__cookie__", "yourpassword")