Failed to connect Sparrow wallet to bitcoin knots

Hi…
I switch from bitcoin core to knots, and has followed the instruction steps, but failed to connect my sparrow wallet to my bitcoin knots.
I also have tried to re-switch back over to bitcoin core , and suddenly can not connect the sparrow wallet either.
I wonder what have I missed.
Need any help or assistance.
Thanks in advance.

1 Like

What operating system do you have Knots installed on? (Windows, Mac, Linux, StartOS, Umbrel, etc)

I use Windows 10 in my laptop

1 Like

Ok, I think the first thing to check is if the RPC server is enabled:

  • From Knots, open Settings > Options
  • Check “Enable RPC server”, and click OK
  • Shut down Knots, and wait for it to fully shut down
  • Start Knots back up

If that doesn’t fix the problem, then next please post the contents of your config file (if there are any passwords in there, do not include them of course). You can get to it in Knots via Settings > Options > Open Configuration File > Continue

Hi,Mr.Paul…
Thanks for your feedback so far.
RPC server has already been enabled, but still can not.
The config file as follow :

server=1
torcontrol=127.0.0.1:9051
proxy=127.0.0.1:9050
listen=1
listenonion=1

Pls advice.
Thanks,Sir.

1 Like

That part looks correct. Next, can you screenshot the popup window in Sparrow from File > Settings > Server?


Hi,Sir…
Photo attached.
Kindly find the attachment.
Thanks.

1 Like

Ok, a couple of things to check here on this screen:

  1. Make sure the folder C:\Users\USER\AppData\Roaming\Bitcoin exists, and is where your blockchain data is being saved to. Note that you may need to tell Windows to show hidden files (I believe AppData is hidden by default). Note that this is the wrong path on my Windows 11 test system (for me it is under “Local” instead of “Roaming”), so double-check that (might be different for Windows 10).

  2. Check inside the folder C:\Users\USER\AppData\Roaming\Bitcoin and look for a file named “.cookie” (while Knots is running). You might need to tell Windows both to show file extensions and to show hidden files (Windows hides these by default, and this particular file is both pure extension and hidden)

  3. Try deleting both “localhost” and “9050” from the Proxy URL line and then “Test Connection”

  4. Try changing the Bitcoin Core RPC URL from “127.0.0.1” to “localhost” and then “Test Connection”

  5. Try changing the Bitcoin Core RPC URL from “127.0.0.1” to “0.0.0.0” and then “Test Connection”

Hi, Mr.Paul
Thanks for your response so far.
Below my findings based on your guidance :

  1. C:\Users\USER\AppData\Roaming\Bitcoin, do exist. Since you explain that this is the wrong path, I have copy paste all the bitcoin folder to folder “Local”, and change the data folder server in sparrow to the folder “Local”, and test connection still failed.

  2. There is cookie file in the folders, both in “Roaming” and “Local” (the copy paste)

  3. I have tried, still failed

  4. I have tried, still failed

  5. I have tried, still failed

Still wondering what is going wrong.
Very appreciate for all your effort & response, Sir.
Thanks

1 Like

Bitcoin knots folder

Thanks.

1 Like

The test connection still failed

1 Like

Cookie file folder

Hmm, a couple of things here that I wasn’t expecting. I don’t recall the executables being in the same location as the datadir, but maybe that’s normal (I’ll check my installation when I get home from work this evening to see if it is the same for me). The other thing that is weird is that you found a .cookie file in both Roaming and Local. The .cookie file should only exist while Knots is running I think, but Local and Roaming are two different folders in Windows 11. Maybe they are symlinked in Windows 10 or something, not sure. I assume you are only launching either Knots or Core for a given test run (i.e. you are not launching both at the same time) correct?

Can you run this test:

  1. Go to the datadir that has “Roaming” in the path.
  2. Create a small “hello.txt” file there
  3. Go to the datadir that has “Local” in the path
  4. Do you see the “hello.txt” file that you created?

I’ll probably need to create my own Windows 10 VM to test on (if I can find an installer ISO) so that I can see how differently it behaves compared to Windows 11. The next area to explore will be firewall settings, which have a good chance of working a little differently for Windows 10 probably.

Hi, Mr.Paul…
Thanks again for your feedback.
I think the cookie file appear in both folder, because I copy-paste all the bitcoin folder from “Roaming” to “Local”, and running the bitcoin-qt (knots) from the “Local” folder. Thus, cookie file also appear in the “Local” folder after that.

Now, as your guidance, I have run the test No.1-4 (small hello.txt), I dont see the “hello txt” file in the “Local”.

Thanks a lot for your continuous help.

Ah, ok, so you are being extra proactive beyond my specific inputs :grin:

My guess is you have gotten your setup onto some contorted non-standard state now that might be difficult to continue diagnosing. In any case, I’ll see if I can come up with some steps to untangle things after I have a chance to set up a Windows 10 environment to test on.

If you are in a hurry to get Sparrow hooked up in the mean time while I am getting my test environment set up (I can imagine not having the privacy of your own node is concerning) then you can try the following (worst case scenario, we can always blow everything away and start fresh later):

  1. Rename C:\Users\USER\AppData\Roaming\Bitcoin as C:\Users\USER\AppData\Roaming\Bitcoin_OLD (we will refer to this as your “old datadir”)
  2. Rename C:\Users\USER\AppData\Local\Bitcoin as C:\Users\USER\AppData\Local\Bitcoin_BACKUP (we will refer to this as your “backup datadir”)
  3. Fully uninstall both Core and Knots
  4. Reboot your computer
  5. Check your applications and make sure Core and Knots are indeed uninstalled
  6. Delete any previously-downloaded installers and checksum files for Core or Knots from your Downloads folder
  7. Download the Win64 Unsigned Setup executable for Knots from the Knots repository on Github (here is the link: win64-setup-unsigned.exe). Note that “unsigned” in this context means not signed by Microsoft (i.e. Windows is going to complain at you when you try to run it and will make you jump through a few hoops first). It doesn’t mean that you cannot verify that it is an authentic Knots download.
  8. (Optional) Verify the download in Sparrow using the SHA256SUMS and SHA256SUMS.asc files from the Knots repository on Github.
  9. Run the installer (Windows will make you jump through some hoops)
  10. Launch Bitcoin Knots. Once it is running and has started the initial blockchain download, close it and wait for it to completely shut down.
  11. Identify the location of the fresh new datadir. It should be either at C:\Users\USER\AppData\Roaming\Bitcoin or C:\Users\USER\AppData\Local\Bitcoin. Do not move it. Just take note of where it is located. We will refer to this as your “new datadir”.
  12. Double-check that Knots is NOT running.
  13. Open your backup datadir from Step 2 in one window (C:\Users\USER\AppData\Local\Bitcoin_BACKUP)
  14. Open your new datadir from Step 11 in a second window
  15. Delete the “blocks” and “chainstate” folders (and “indexes” and “wallets” folders if either exist) from the new datadir you identified in Step 11. Make sure you are NOT deleting them from your backup datadir!
  16. Drag the “blocks” and “chainstate” folders (and “indexes” and “wallets” folders if either exist) from the backup datadir you renamed in Step 2 into the new datadir you identified in Step 11.
  17. Restart Knots. It should be fully synced. If not, stop here and let me know. If it does start and shows as fully synced, then you can delete the old datadir from Step 1 and the backup datadir from Step 2. Just be careful NOT to delete the new datadir from Step 11!

If you get that far, then Enable RPC Server in the Knots settings, fully shut it down, and then start it back up. Sparrow should be able to connect at this point (just make sure the “Data Folder” field has the correct path from Step 11, and all the other fields have their original default values in them)

Hi,Mr.Paul
Thanks for your guidance so far.
I have followed all your above steps carefully, but unfortunately still failed to connect.

Anyway, I have found something that I think a bit weird & curious in my windows firewall. Pls find the photo screenshot attachment, and pls see if you have any idea or maybe something wrong happen.

Thanks for your kind attention & assistance so far.
Hopefully can get way out.

In the windows firewall, the uncheck bitcoin core GUI keeps popping out everytime I close & open & try to connect my sparrow to my bitcoin knots.

I have changed the setting of bitcoin core GUI to checklist the Public, press Ok, and then retry to connect my sparrow, and failed.
And everytime I open again the firewall, I found the uncheck bitcoin core GUI (as in the photo attachment).

I wonder if this related to the problems.
Pls advice.
Thanks,Sir.

I don’t think the problem is there, but let’s confirm. Try the following two commands in Powershell, and report the results:

  • Check the port is open:
    netstat -ano | findstr :8332 (should show “LISTENING”).
  • Test RPC directly:
    bitcoin-cli -getinfo

Hi,Mr.Paul
Kindly find the attachment.

Thx