Saturday, July 6, 2024

Instance working bitcoin.conf file – Bitcoin Stack Trade

I’m unable to connect with my server regardless of making an attempt for days. I’ve requested posted questions and my .conf file and my python code and regardless of this nobody has been in a position to give me a motive why it’s not connecting.

I’m able to hook up with the port utilizing telnet 127.0.0.1 [port_num]

And I’m decently positive I’ve opened the ports accurately. Nestats -a exhibits them open. I’ve opened them each for incoming and outgoing, each for my router, and for my firewall. And after I take away the foundations, I instantly get a distinct error stating the host refused connections. However when i’ve these guidelines engaged I as a substitute get the next error…

(.venv) D:PROJECTSpython38_env_bitcoinsrchellobitcoin101>python bitcoin104.py
<bitcoinrpc.authproxy.AuthServiceProxy object at 0x0000021E5BB11730>
Traceback (most up-to-date name final):
  File "bitcoin104.py", line 10, in <module>
    best_block_hash = rpc_connection.getbestblockhash()
  File "D:PROJECTSpython38_env_bitcoin.venvlibsite-packagesbitcoinrpcauthproxy.py", line 139, in __call__
    response = self._get_response()
  File "D:PROJECTSpython38_env_bitcoin.venvlibsite-packagesbitcoinrpcauthproxy.py", line 179, in _get_response
    http_response = self.__conn.getresponse()
  File "c:usershansoappdatalocalprogramspythonpython38libhttpclient.py", line 1344, in getresponse
    response.start()
  File "c:usershansoappdatalocalprogramspythonpython38libhttpclient.py", line 307, in start
    model, standing, motive = self._read_status()
  File "c:usershansoappdatalocalprogramspythonpython38libhttpclient.py", line 268, in _read_status
    line = str(self.fp.readline(_MAXLINE + 1), "iso-8859-1")
  File "c:usershansoappdatalocalprogramspythonpython38libsocket.py", line 669, in readinto
    return self._sock.recv_into(b)
socket.timeout: timed out

I’m making an attempt use use the person password utilizing rpcauth.. so in my .conf file I’ve one thing like…

rpcuser=myname
rpcauth=myname:fef852a5c3e764a3a4e7fcaa283b2f1f$eadb370e8d7705d8c960570c13b49372d1a3780aa3e1ea5013908271035d4ee9

I’m not positive if that is the right utilization.
I received the hash utilizing…
python ./rpcauth.py myname mypassword

I earlier tried a setup like….

rpcuser=myname
rpcpassword=mypassword

What’s fascinating it I additionally typically get a connection with out response error as nicely with out having modified something…

As an illustration…

PS D:PROJECTSpython38_env_bitcoinsrchellobitcoin101> python .bitcoin104.py
>>
<bitcoinrpc.authproxy.AuthServiceProxy object at 0x000002482E142730>
Traceback (most up-to-date name final):
  File ".bitcoin104.py", line 10, in <module>
    best_block_hash = rpc_connection.getbestblockhash()
  File "D:PROJECTSpython38_env_bitcoin.venvlibsite-packagesbitcoinrpcauthproxy.py", line 139, in __call__
    response = self._get_response()
  File "D:PROJECTSpython38_env_bitcoin.venvlibsite-packagesbitcoinrpcauthproxy.py", line 179, in _get_response
    http_response = self.__conn.getresponse()
  File "c:usershansoappdatalocalprogramspythonpython38libhttpclient.py", line 1344, in getresponse
    response.start()
  File "c:usershansoappdatalocalprogramspythonpython38libhttpclient.py", line 307, in start
    model, standing, motive = self._read_status()
  File "c:usershansoappdatalocalprogramspythonpython38libhttpclient.py", line 276, in _read_status
    elevate RemoteDisconnected("Distant finish closed connection with out"
http.consumer.RemoteDisconnected: Distant finish closed connection with out response
PS D:PROJECTSpython38_env_bitcoinsrchellobitcoin101> python .bitcoin104.py
>>
<bitcoinrpc.authproxy.AuthServiceProxy object at 0x000001F7602E2730>
Traceback (most up-to-date name final):
  File ".bitcoin104.py", line 10, in <module>
    best_block_hash = rpc_connection.getbestblockhash()
  File "D:PROJECTSpython38_env_bitcoin.venvlibsite-packagesbitcoinrpcauthproxy.py", line 139, in __call__
    response = self._get_response()
  File "D:PROJECTSpython38_env_bitcoin.venvlibsite-packagesbitcoinrpcauthproxy.py", line 179, in _get_response
    http_response = self.__conn.getresponse()
  File "c:usershansoappdatalocalprogramspythonpython38libhttpclient.py", line 1344, in getresponse
    response.start()
  File "c:usershansoappdatalocalprogramspythonpython38libhttpclient.py", line 307, in start
    model, standing, motive = self._read_status()
  File "c:usershansoappdatalocalprogramspythonpython38libhttpclient.py", line 268, in _read_status
    line = str(self.fp.readline(_MAXLINE + 1), "iso-8859-1")
  File "c:usershansoappdatalocalprogramspythonpython38libsocket.py", line 669, in readinto
    return self._sock.recv_into(b)
socket.timeout: timed out

i’ve searched on-line and there’s little or no it appears by way of examples of a correctly setup .conf file and corresponding python rpc authority name…

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 level I believe i’ve tried all the pieces I can attainable consider.

My intestine is saying it’s one thing I could be doing flawed with the person password maybe. However I’ve tried many various configurations, many various passwords. Restarting the node every time and loading within the modified .conf file, and operating the python script once more.
And all I get is the timed out, or no response it doesn’t matter what i do now..
Then if I mess with the port it I get the connection refused by host error as a substitute.

If I may perhaps see an instance on-line of a correctly setup .conf file with the precise rpsuser and rpcpassword textual content, and the identical within the python rpc socket setup. I do not know if perhaps I should not be placing “” round one thing, or ought to be and I’m not, and that has been the problem. Or maybe I must be utilizing the rpcauth differently…?

Any assist can be tremendously tremendously appreciated…
Thanks for studying this far regardless.

Related Articles

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Latest Articles