solana icon indicating copy to clipboard operation
solana copied to clipboard

Does not work in Windows: CLI app: solana-test-validator

Open sharpe5 opened this issue 1 year ago • 1 comments

Problem

I installed Solana on Windows 10 x64 version 10.0.19045 Build 19045.

Ran this:

solana-test-validator

It immediately exited, with no error message or any sort. I tried solana-test-validator --version with the same result. This worked nicely: solana --version.

I then tried it under WSL with Ubuntu 22.04 LTS and it worked perfectly.

Proposed Solution

Fix solana-test-validator to work under Windows, or at the very least, display an error message on running that it does not support Windows. Might want to update the docs as well.

sharpe5 avatar Jan 16 '24 11:01 sharpe5

Will work on this !

Nagaprasadvr avatar Jan 27 '24 14:01 Nagaprasadvr

Update: an error message pops up with an "Ok" button: "The code execution cannot proceed because libssl-3-x64.dll was not found. Reinstalling the program may fix this problem."

sharpe5 avatar Feb 07 '24 12:02 sharpe5

Update: searched for libssl-3-x64.dll and found a copy that was installed as part of Git for Windows:

I can now run it:

path=%path%;C:\Program Files\Git\mingw64\bin
solana-test-validator

However, it hangs forever at this point:

S:\>solana-test-validator
logrotate is not supported on this platform
Ledger location: test-ledger
Log: test-ledger\validator.log
⠒ Initializing...               

It works nicely under WSL and I can connect to it from Windows.

sharpe5 avatar Feb 07 '24 12:02 sharpe5

Manage to run solana-test-validator

image

need to see logs and test it properly

link to logs - https://gist.github.com/Nagaprasadvr/cebdf423562ac0fbfdaa48cedfd2e714

Nagaprasadvr avatar Mar 02 '24 02:03 Nagaprasadvr

i did the setup

here is the ping status

image

Logs : image

Nagaprasadvr avatar Mar 02 '24 09:03 Nagaprasadvr

Heres a solana transfer image

Nagaprasadvr avatar Mar 02 '24 09:03 Nagaprasadvr

I guess we have to provide some steps on how to install prerequisites to run solana-test-validator on windows ! it works just fine after installing all prerequisite binaries and setting all the system environment variables !

Nagaprasadvr avatar Mar 02 '24 09:03 Nagaprasadvr

Pre-requisite dlls and binaries

Binaries -

  1. Protoc - https://github.com/protocolbuffers/protobuf/releases/download/v25.3/protoc-25.3-win64.zip
  2. OpenSSL-Winx64 - https://slproweb.com/download/Win64OpenSSL-3_2_1.exe

Dlls -

  1. libssl - https://www.dllme.com/dll/files/libssl-3-x64
  2. libcrypto - https://www.dllme.com/dll/files/libcrypto-3-x64
  3. libclang - https://www.dllme.com/dll/files/libclang
  4. clang - https://www.dllme.com/dll/files/clang

After downloading

  1. Binaries , I executed them and placed them in C:\Program FIles\ dir
  2. Dlls - i placed them in C:\Windows\System32\ dir

System Environment variables

OPENSSL_INCLUDE_DIR=C:\Program Files\OpenSSL-Win64\include OPENSSL_LIB=C:\Program Files\OpenSSL-Win64\lib OPENSSL_LIB_DIR=C:\Program Files\OpenSSL-Win64\lib\VC\x64\MT PROTOC=C:\Program Files\protoc\bin\protoc LIBCLANG_PATH=C:\Windows\System32\libclang.dll PATH=C:\Program Files\OpenSSL-Win64\bin

Nagaprasadvr avatar Mar 02 '24 10:03 Nagaprasadvr

@sharpe5 let me know if this works for you

Nagaprasadvr avatar Mar 02 '24 16:03 Nagaprasadvr

Nice work! Now that you have proven it is possible, it opens the way to fix the Windows installer.

Please note that I got it working under Windows by using WSL. I ran it, found the IP address of WSL under windows, then connected using native Windows binaries and everything worked well on testnet such as adding to balance, check epoch, etc.

On Sat, 2 Mar 2024, 10:23 Nagaprasad V R, @.***> wrote:

Pre-requisite dlls and binaries

Binaries -

  1. Protoc - https://github.com/protocolbuffers/protobuf/releases/download/v25.3/protoc-25.3-win64.zip
  2. OpenSSL-Winx64 - https://slproweb.com/download/Win64OpenSSL-3_2_1.exe

Dlls -

  1. libssl - https://www.dllme.com/dll/files/libssl-3-x64
  2. libcrypto - https://www.dllme.com/dll/files/libcrypto-3-x64
  3. libclang - https://www.dllme.com/dll/files/libclang/
  4. clang - https://www.dllme.com/dll/files/clang

After downloading

  1. Binaries , I executed them and placed them in C:\Program FIles\ dir
  2. Dlls - i placed them in C:\Windows\System32\ dir

System Environment variables

— Reply to this email directly, view it on GitHub https://github.com/solana-labs/solana/issues/34793#issuecomment-1974756451, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAJ3FJDZ2ATB5MID233NF3DYWGSBDAVCNFSM6AAAAABB4UE2YGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSNZUG42TMNBVGE . You are receiving this because you authored the thread.Message ID: @.***>

sharpe5 avatar Mar 02 '24 18:03 sharpe5

libclang - https://www.dllme.com/dll/files/libclang/ This does not exist.

AnonVee1 avatar Mar 02 '24 22:03 AnonVee1

libclang - https://www.dllme.com/dll/files/libclang This does not exist.

My bad , updated the link

Nagaprasadvr avatar Mar 03 '24 00:03 Nagaprasadvr

Nice work! Now that you have proven it is possible, it opens the way to fix the Windows installer. Please note that I got it working under Windows by using WSL. I ran it, found the IP address of WSL under windows, then connected using native Windows binaries and everything worked well on testnet such as adding to balance, check epoch, etc. On Sat, 2 Mar 2024, 10:23 Nagaprasad V R, @.> wrote: Pre-requisite dlls and binaries Binaries - 1. Protoc - https://github.com/protocolbuffers/protobuf/releases/download/v25.3/protoc-25.3-win64.zip 2. OpenSSL-Winx64 - https://slproweb.com/download/Win64OpenSSL-3_2_1.exe Dlls - 1. libssl - https://www.dllme.com/dll/files/libssl-3-x64 2. libcrypto - https://www.dllme.com/dll/files/libcrypto-3-x64 3. libclang - https://www.dllme.com/dll/files/libclang/ 4. clang - https://www.dllme.com/dll/files/clang After downloading 1. Binaries , I executed them and placed them in C:\Program FIles\ dir 2. Dlls - i placed them in C:\Windows\System32\ dir System Environment variables — Reply to this email directly, view it on GitHub <#34793 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAJ3FJDZ2ATB5MID233NF3DYWGSBDAVCNFSM6AAAAABB4UE2YGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSNZUG42TMNBVGE . You are receiving this because you authored the thread.Message ID: @.>

Have u tried testing without wsl , just the cmd ? Setting up all prerequisites and then launching solana testnet validator and executing some txs

Nagaprasadvr avatar Mar 03 '24 00:03 Nagaprasadvr

libclang - https://www.dllme.com/dll/files/libclang/ This does not exist.

My bad , updated the link

I don't think you have updated it

AnonVee1 avatar Mar 03 '24 11:03 AnonVee1

Pre-requisite dlls and binaries

Binaries -

  1. Protoc - https://github.com/protocolbuffers/protobuf/releases/download/v25.3/protoc-25.3-win64.zip
  2. OpenSSL-Winx64 - https://slproweb.com/download/Win64OpenSSL-3_2_1.exe

Dlls -

  1. libssl - https://www.dllme.com/dll/files/libssl-3-x64
  2. libcrypto - https://www.dllme.com/dll/files/libcrypto-3-x64
  3. libclang - https://www.dllme.com/dll/files/libclang
  4. clang - https://www.dllme.com/dll/files/clang

After downloading

  1. Binaries , I executed them and placed them in C:\Program FIles\ dir
  2. Dlls - i placed them in C:\Windows\System32\ dir

System Environment variables

OPENSSL_INCLUDE_DIR=C:\Program Files\OpenSSL-Win64\include OPENSSL_LIB=C:\Program Files\OpenSSL-Win64\lib OPENSSL_LIB_DIR=C:\Program Files\OpenSSL-Win64\lib\VC\x64\MT PROTOC=C:\Program Files\protoc\bin\protoc LIBCLANG_PATH=C:\Windows\System32\libclang.dll PATH=C:\Program Files\OpenSSL-Win64\bin

I have updated here .

Nagaprasadvr avatar Mar 03 '24 12:03 Nagaprasadvr