• About
  • FAQ
  • Earn Bitcoin while Surfing the net
  • Buy & Sell Crypto on Paxful
Newsletter
Approx Foundation
  • Home
    • Home – Layout 1
  • Bitcoin
  • Ethereum
  • Regulation
  • Market
  • Blockchain
  • Business
  • Guide
  • Contact Us
No Result
View All Result
  • Home
    • Home – Layout 1
  • Bitcoin
  • Ethereum
  • Regulation
  • Market
  • Blockchain
  • Business
  • Guide
  • Contact Us
No Result
View All Result
Approx Foundation
No Result
View All Result
Home Bitcoin

Example working bitcoin.conf file – Bitcoin Stack Exchange

Moussa by Moussa
February 5, 2024
in Bitcoin
0
peer discovery – how to obtain the IP addresses of nodes for mining pools?
189
SHARES
1.5k
VIEWS
Share on FacebookShare on Twitter


I am unable to connect to my server despite trying for days. I have asked posted questions and my .conf file and my python code and despite this no one has been able to give me a reason why it is not connecting.

I am able to connect to the port using telnet 127.0.0.1 [port_num]

And I am decently sure I have opened the ports correctly. Nestats -a shows them open. I have opened them both for incoming and outgoing, both for my router, and for my firewall. And when I remove the rules, I immediately get a different error stating the host refused connections. But when i have those rules engaged I instead get the following error…

(.venv) D:\PROJECTS\python38_env_bitcoin\src\hellobitcoin101>python bitcoin104.py
<bitcoinrpc.authproxy.AuthServiceProxy object at 0x0000021E5BB11730>
Traceback (most recent call last):
  File "bitcoin104.py", line 10, in <module>
    best_block_hash = rpc_connection.getbestblockhash()
  File "D:\PROJECTS\python38_env_bitcoin\.venv\lib\site-packages\bitcoinrpc\authproxy.py", line 139, in __call__
    response = self._get_response()
  File "D:\PROJECTS\python38_env_bitcoin\.venv\lib\site-packages\bitcoinrpc\authproxy.py", line 179, in _get_response
    http_response = self.__conn.getresponse()
  File "c:\users\hanso\appdata\local\programs\python\python38\lib\http\client.py", line 1344, in getresponse
    response.begin()
  File "c:\users\hanso\appdata\local\programs\python\python38\lib\http\client.py", line 307, in begin
    version, status, reason = self._read_status()
  File "c:\users\hanso\appdata\local\programs\python\python38\lib\http\client.py", line 268, in _read_status
    line = str(self.fp.readline(_MAXLINE + 1), "iso-8859-1")
  File "c:\users\hanso\appdata\local\programs\python\python38\lib\socket.py", line 669, in readinto
    return self._sock.recv_into(b)
socket.timeout: timed out

I am trying use use the user password using rpcauth.. so in my .conf file I have something like…

rpcuser=myname
rpcauth=myname:fef852a5c3e764a3a4e7fcaa283b2f1f$eadb370e8d7705d8c960570c13b49372d1a3780aa3e1ea5013908271035d4ee9

I am not sure if this is the proper usage.
I got the hash using…
python ./rpcauth.py myname mypassword

I previous tried a setup like….

rpcuser=myname
rpcpassword=mypassword

What is interesting it I also sometimes get a connection without response error as well without having changed anything…

For instance…

PS D:\PROJECTS\python38_env_bitcoin\src\hellobitcoin101> python .\bitcoin104.py
>>
<bitcoinrpc.authproxy.AuthServiceProxy object at 0x000002482E142730>
Traceback (most recent call last):
  File ".\bitcoin104.py", line 10, in <module>
    best_block_hash = rpc_connection.getbestblockhash()
  File "D:\PROJECTS\python38_env_bitcoin\.venv\lib\site-packages\bitcoinrpc\authproxy.py", line 139, in __call__
    response = self._get_response()
  File "D:\PROJECTS\python38_env_bitcoin\.venv\lib\site-packages\bitcoinrpc\authproxy.py", line 179, in _get_response
    http_response = self.__conn.getresponse()
  File "c:\users\hanso\appdata\local\programs\python\python38\lib\http\client.py", line 1344, in getresponse
    response.begin()
  File "c:\users\hanso\appdata\local\programs\python\python38\lib\http\client.py", line 307, in begin
    version, status, reason = self._read_status()
  File "c:\users\hanso\appdata\local\programs\python\python38\lib\http\client.py", line 276, in _read_status
    raise RemoteDisconnected("Remote end closed connection without"
http.client.RemoteDisconnected: Remote end closed connection without response
PS D:\PROJECTS\python38_env_bitcoin\src\hellobitcoin101> python .\bitcoin104.py
>>
<bitcoinrpc.authproxy.AuthServiceProxy object at 0x000001F7602E2730>
Traceback (most recent call last):
  File ".\bitcoin104.py", line 10, in <module>
    best_block_hash = rpc_connection.getbestblockhash()
  File "D:\PROJECTS\python38_env_bitcoin\.venv\lib\site-packages\bitcoinrpc\authproxy.py", line 139, in __call__
    response = self._get_response()
  File "D:\PROJECTS\python38_env_bitcoin\.venv\lib\site-packages\bitcoinrpc\authproxy.py", line 179, in _get_response
    http_response = self.__conn.getresponse()
  File "c:\users\hanso\appdata\local\programs\python\python38\lib\http\client.py", line 1344, in getresponse
    response.begin()
  File "c:\users\hanso\appdata\local\programs\python\python38\lib\http\client.py", line 307, in begin
    version, status, reason = self._read_status()
  File "c:\users\hanso\appdata\local\programs\python\python38\lib\http\client.py", line 268, in _read_status
    line = str(self.fp.readline(_MAXLINE + 1), "iso-8859-1")
  File "c:\users\hanso\appdata\local\programs\python\python38\lib\socket.py", line 669, in readinto
    return self._sock.recv_into(b)
socket.timeout: timed out

i have searched online and there is very little it seems in terms of examples of a properly setup .conf file and corresponding python rpc authority call…

Like so…

rpc_connection = AuthServiceProxy("http://%s:%[email protected]:8334"%("myname","mypassword"))
best_block_hash = rpc_connection.getbestblockhash()
best_block_hash

It fails on the second line above, ie best_block_hash = rpc_connection.getbestblockhash()

At this point I think i have tried everything I can possible think of.

My gut is saying it is something I might be doing wrong with the user password perhaps. But I have tried many different configurations, many different passwords. Restarting the node each time and loading in the changed .conf file, and running the python script again.
And all I get is the timed out, or no response no matter what i do now..
Then if I mess with the port it I get the connection refused by host error instead.

If I could maybe see an example online of a properly setup .conf file with the exact rpsuser and rpcpassword text, and the same in the python rpc socket setup. I have no idea if maybe I shouldn’t be putting “” around something, or should be and I am not, and that has been the issue. Or perhaps I need to be using the rpcauth in a different way…?

Any help would be greatly greatly appreciated…
Thanks for reading this far regardless.



Source link

Related articles

Experts Say Zk Proofs Give DePINs an Edge as AI Trust Demands Rise

Experts Say Zk Proofs Give DePINs an Edge as AI Trust Demands Rise

May 14, 2026
MicroStrategy Bitcoin Holdings Hit $66Bn: What Next for Saylor?

MicroStrategy Bitcoin Holdings Hit $66Bn: What Next for Saylor?

May 14, 2026
Share76Tweet47

Related Posts

Experts Say Zk Proofs Give DePINs an Edge as AI Trust Demands Rise

Experts Say Zk Proofs Give DePINs an Edge as AI Trust Demands Rise

by Moussa
May 14, 2026
0

Key TakeawaysGoldman Sachs cites a $7.6 trillion spend by 2031, depending on whether chips last more than 3 years.StealthEX and...

MicroStrategy Bitcoin Holdings Hit $66Bn: What Next for Saylor?

MicroStrategy Bitcoin Holdings Hit $66Bn: What Next for Saylor?

by Moussa
May 14, 2026
0

MicroStrategy Bitcoin reserve now holds approximately 818,334 Bitcoin, worth roughly $66.2Bn at current prices, making it the largest corporate holder...

US Senate Amendments Target Crypto Tax Payments And Banking Access – Details

US Senate Amendments Target Crypto Tax Payments And Banking Access – Details

by Moussa
May 14, 2026
0

Trusted Editorial content, reviewed by leading industry experts and seasoned editors. Ad Disclosure The crypto market faces one of its...

Dogecoin Has Only 3 Steps Left Until A Surge Above $1, But A Major Factor Is Missing

Dogecoin Has Only 3 Steps Left Until A Surge Above $1, But A Major Factor Is Missing

by Moussa
May 14, 2026
0

A crypto analyst has set multiple bullish price targets for Dogecoin (DOGE), predicting a strong, sustainable rally to the highly...

Senate Confirms Bitcoin Friendly Kevin Warsh As Fed Chair Ahead Of Clarity Act Vote

Senate Confirms Bitcoin Friendly Kevin Warsh As Fed Chair Ahead Of Clarity Act Vote

by Moussa
May 14, 2026
0

The Senate on Wednesday confirmed Kevin Warsh as the next chair of the Federal Reserve in the most divisive confirmation...

Load More

youssufi.com

sephina.com

[vc_row full_width="stretch_row" parallax="content-moving" vc_row_background="" background_repeat="no-repeat" background_position="center center" footer_scheme="dark" css=".vc_custom_1517813231908{padding-top: 60px !important;padding-bottom: 30px !important;background-color: #191818 !important;background-position: center;background-repeat: no-repeat !important;background-size: cover !important;}" footer_widget_title_color="#fcbf46" footer_button_bg="#fcb11e"][vc_column width="1/4"]

We bring you the latest in Crypto News

[/vc_column][vc_column width="1/4"][vc_wp_categories]
[/vc_column][vc_column width="1/4"][vc_wp_tagcloud taxonomy="post_tag"][/vc_column][vc_column width="1/4"]

Newsletter

[vc_raw_html]JTNDcCUzRSUzQ2RpdiUyMGNsYXNzJTNEJTIydG5w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yY2hlY2tib3glMjIlMjBuYW1lJTNEJTIybnklMjIlMjByZXF1aXJlZCUyMGNsYXNzJTNEJTIydG5wLXByaXZhY3klMjIlM0UlQzIlQTBCeSUyMGNvbnRpbnVpbmclMkMlMjB5b3UlMjBhY2NlcHQlMjB0aGUlMjBwcml2YWN5JTIwcG9saWN5JTNDJTJGbGFiZWwlM0UlM0MlMkZkaXYlM0UlM0NkaXYlMjBjbGFzcyUzRCUyMnRucC1maWVsZCUyMHRucC1maWVsZC1idXR0b24lMjIlM0UlM0NpbnB1dCUyMGNsYXNzJTNEJTIydG5wLXN1Ym1pdCUyMiUyMHR5cGUlM0QlMjJzdWJtaXQlMjIlMjB2YWx1ZSUzRCUyMlN1YnNjcmliZSUyMiUyMCUzRSUwQSUzQyUyRmRpdiUzRSUwQSUzQyUyRmZvcm0lM0UlMEElM0MlMkZkaXYlM0UlM0NiciUyRiUzRSUzQyUyRnAlM0U=[/vc_raw_html][/vc_column][/vc_row]
No Result
View All Result
  • Contact Us
  • Homepages
  • Business
  • Guide

© 2024 APPROX FOUNDATION - The Crypto Currency News