jgarzik / jgarzik/python-bitcoinrpc

authentication in example outdated?

Open
#94 3 comments 1 reaction 0 assignees View on GitHub
Dominant language
Python
Stars
663
Forks
300
PR merge metrics
No merged PRs in 30d

Description

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

> Secure authentication: By default, Bitcoin Core generates unique login credentials each time it restarts and puts them into a file readable only by the user that started Bitcoin Core, allowing any of that user's RPC clients with read access to the file to login automatically. The file is .cookie in the Bitcoin Core configuration directory, and using these credentials is the preferred RPC authentication method. If you need to generate static login credentials for your programs, you can use the script in the share/rpcauth directory in the Bitcoin Core source tree. As a final fallback, you can directly use manually-chosen rpcuser and rpcpassword configuration parameters---but you must ensure that you choose a strong and unique passphrase (and still don't use insecure networks, as mentioned above).

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")`

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.