chris-belcher / electrum-personal-server

Maximally lightweight electrum server for a single user
MIT License
602 stars 110 forks source link

Testnet Error: Unable to Find .Cookie File #164

Closed McMurdo2009 closed 4 years ago

McMurdo2009 commented 5 years ago

I am able to run electrum personal server successfully on mainnet. I created an Electrum testnet wallet, and added its xpub to the electrum personal serve config.ini file. However when I launch bitcoind --testnet, and then electrum-personal-server [...config.ini] I get the error:

Unable to find .cookie file, try setting datadir config

I've done a little searching and still can't find out what the .cookie file is and where it's kept. (BTW I run Linux).

I see here that it says Electrum Personal Server works with testnet, but no further instructions.

Any advice? Thank you.

chris-belcher commented 4 years ago

In order for EPS to find the .cookie file you need to set the datadir parameter in the config file.

McMurdo2009 commented 4 years ago

Chris:

Progress: I set datadir = /home/user/.bitcoin/testnet3/

Then launched bitcoind --tesnet

Then launched electrum-personal-server [path to config] and got a new exciting error:

File "/home/user/.local/lib/python3.7/site-packages/electrumpersonalserver/server/jsonrpc.py", line 46, in queryHTTP self.conn.request("POST", self.url, body, headers) File "/usr/lib/python3.7/http/client.py", line 1229, in request self._send_request(method, url, body, headers, encode_chunked) File "/usr/lib/python3.7/http/client.py", line 1275, in _send_request self.endheaders(body, encode_chunked=encode_chunked) File "/usr/lib/python3.7/http/client.py", line 1224, in endheaders self._send_output(message_body, encode_chunked=encode_chunked) File "/usr/lib/python3.7/http/client.py", line 1016, in _send_output self.send(msg) File "/usr/lib/python3.7/http/client.py", line 956, in send self.connect() File "/usr/lib/python3.7/http/client.py", line 928, in connect (self.host,self.port), self.timeout, self.source_address) File "/usr/lib/python3.7/socket.py", line 727, in create_connection raise err File "/usr/lib/python3.7/socket.py", line 716, in create_connection sock.connect(sa) ConnectionRefusedError: [Errno 111] Connection refused

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/home/user/.local/bin/electrum-personal-server", line 10, in sys.exit(main()) File "/home/user/.local/lib/python3.7/site-packages/electrumpersonalserver/server/common.py", line 726, in main bestblockhash[0] = rpc.call("getbestblockhash", []) File "/home/user/.local/lib/python3.7/site-packages/electrumpersonalserver/server/jsonrpc.py", line 84, in call response = self.queryHTTP(request) File "/home/user/.local/lib/python3.7/site-packages/electrumpersonalserver/server/jsonrpc.py", line 65, in queryHTTP self.conn.connect() File "/usr/lib/python3.7/http/client.py", line 928, in connect (self.host,self.port), self.timeout, self.source_address) File "/usr/lib/python3.7/socket.py", line 727, in create_connection raise err File "/usr/lib/python3.7/socket.py", line 716, in create_connection sock.connect(sa) ConnectionRefusedError: [Errno 111] Connection refused

Reminder: everything works when I run it all on mainnet. (although I haven't tested it with any transactions).

chris-belcher commented 4 years ago

Try changing rpc port to 18332 instead of 8332

McMurdo2009 commented 4 years ago

Ok, I changed the RPC port in EPS config.ini, and it now launches when I have bitcoind -testnet running, and displays:

Listening for Electrum Wallet on ('127.0.0.1', 50002)

But then when I launch Electrum --testnet, it comes up and never connects.

McMurdo2009 commented 4 years ago

Upgraded to EPS 2.0 and it's working. Thanks!