Solana-test-validator wallet connection issue [edit: solved]

Hi all,

When running a solana-test-validator, which appears to be running properly when using the CLI, my browser wallets do not appear to be connecting properly. For both sollet and phantom, when I try to connect to localnet, I only see a loading gif.

When I switch back to devnet or mainnet and back, I can see everything just fine, but any time I switch back to localnet I just get a loading gif if I try to run any transactions. With Phantom, I could initially see a balance (10 sol which I airdropped from the CLI), but as soon as I connect my wallet to the react app I built (using this tutorial: The Complete Guide to Full Stack Solana Development with React, Anchor, Rust, and Phantom - DEV Community), my phantom wallet just goes back to a loading gif (and none of my transaction attempts work). I also tried using sollet when following this tutorial: Programming on Solana - An Introduction | paulx also to no avail (in the sollet case I never even got to see an initial balance).

If it’s helpful at all, when I connect my wallet, my terminal window with the test validator goes nuts for a bit, and the app suggests that there is a wallet connected (the react app updates to display the button for making a counter creation transaction in this case), so it appears that the test validator is functioning, but no transactions will go through (I can switch to devnet then back to localnet, and I’ll see my balance again, but no transactions will appear, now will the window change to indicate I’ve created the counter by running the program).

I’ve been googling like crazy, but somehow I’ve seen nothing about this issue. I don’t think I have anything weird in any config, since I’ve set everything up following the solana docs. I’m on Ubuntu, using zsh and my browser is brave.

Any help would be greatly appreciated! Thanks

1 Like

As an additional note, upon closer inspection, even though the phantom wallet shows a green dot in the top right of my extension popup, hovering over it actually shows that “you are not connected to localhost:3000” so it would appear that even the “connect” to wallet I click when the popup arrives is not actually working. Again though, the same thing happens when I go to sollet.io … I am very surprised I haven’t found a post about this anywhere haha so hopefully it’s something simple

1 Like

As another update, I’ve updated my solana CLI tools (‘solana-install update’) but that did nothing. I also downloaded chromium browser to try and eliminate brave as a variable, and the results were interesting: while phantom continued to show the same behavior, sollet actually works now in chromium. I even deleted my existing sollet wallet in brave and created a new one to confirm… lo and behold, it still did not work in brave on my localnet (it does work for mainnet and devnet etc., but it did that before too)

1 Like

Hi @solanabrah and welcome to the forum! :wave:

Currently my test machine is behind a test firewall that blocks almost all the internet including the Solana networks, so this isn’t exactly the situation you’re in, but here’s what I’m able to get working, in case this helps.

I’m on Linux using Brave and:

  • with Phantom I have the same loading symbol, because I can’t get to any of the external network information. I don’t think this happens to me when I’m not behind the firewall, though.
  • with the Sollet browser extension I’m able to see my balance just fine, because it doesn’t connect to the internet for any extra info

With both Phantom and the Sollet extension, I can successfully connect to my Dapp which uses the Solana wallet adapter library to initiate the connection. Once I connect my wallet, Phantom will show the little green dot saying that I am connected. And, last I checked I was able to make transactions just fine.

My guess is that:

  • Phantom’s loading symbol has to do with some service that it expects to be deployed to the solana-test-validator, which it can’t find, so that is “normal” when connecting to the test validator
  • I don’t know why Sollet wasn’t working for you in Brave. I use the Sollet brave extension and it works fine for me
  • You probably have some issue with the wallet connection code so that it isn’t connecting to the wallet for some reason.

Are you using the Solana wallet adapter library?

1 Like

Hi @zicklag thanks for the help! I didn’t realize sollet had an extension, so I modified the program to use the sollet extension and everything worked fine! (well, mostly… the wallet displayed everything correctly, and I actually found an error in my deployment, which I then fixed). The Phantom wallet still doesn’t display anything on localnet without the same issues as before, but it will still execute transactions correctly now. So I’d actually just conflated two errors bc of the lack of visibility, but your response helped solve it!

Not that the answers are relevant anymore, but yes, I am using the solana wallet adapter lib, and I think you were totally correct that the error on phantom is because it tries to access more info from programs that aren’t available. Thanks!

All the best!

2 Likes

Hello, I’m looking for backend developer to connect wallet on solana