Skip to content

Commit

Permalink
Merge #2448: Add OpenSSL to Windows install, runtime
Browse files Browse the repository at this point in the history
- This change added scripts to download and install OpenSSL to the Inno Setup
  installer, as well as required changes to the runtime environment to verify
if OpenSSL is installed.
- Changes to respective README files
  • Loading branch information
stringhandler committed Nov 24, 2020
2 parents 4c2e7af + 52635e2 commit 8d4280d
Show file tree
Hide file tree
Showing 14 changed files with 223 additions and 23 deletions.
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,16 @@ https://visualstudio.microsoft.com/thank-you-downloading-visual-studio/?sku=Buil
```
setx SQLITE3_LIB_DIR "%USERPROFILE%\.sqlite"
```
- OpenSSL:
- Download full version of the 64bit Precompiled Binaries for Windows for
[OpenSSL](https://slproweb.com/products/Win32OpenSSL.html)
- Install using all the default prompts
**Note**: It is important that the dlls are available in the path. To test:
```
where libcrypto-1_1-x64.dll
where libssl-1_1-x64.dll
```
- Tor
- Donwload [Tor Windows Expert Bundle](https://www.torproject.org/download/tor/)
Expand Down
30 changes: 26 additions & 4 deletions applications/tari_base_node/windows/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ before running `tari_base_node.exe`, `tari_console_wallet.exe` and
The `tari_base_node` executable has the following dependencies, which can be
installed automatically if selected:
- SQLite
- OpenSSL
- Tor Services
- Redistributable for Microsoft Visual Studio 2019
- XMRig
Expand All @@ -33,30 +34,37 @@ Notes:
| start_tari_base_node.lnk
| start_tari_console_wallet.lnk
| start_tari_merge_mining_proxy.lnk
| start_xmrig.lnk
| start_tor.lnk
| unins000.dat
| unins000.exe
|---config
| windows.toml
|---runtime
get-openssl-win.ps1
get-xmrig-win.ps1
install_openssl.bat
install_sqlite.bat
install_tor_services.bat
install_vs2019_redist.bat
install_xmrig.bat
run_the_base_node.bat
run_the_console_wallet.bat
run_the_merge_mining_proxy.bat
source_base_node_env.bat
source_console_wallet_env.bat
source_merge_mining_proxy_env.bat
source_xmrig_env.bat
start_tari_base_node.bat
start_tari_console_wallet.bat
start_tari_merge_mining_proxy.bat
start_tor.bat
start_xmrig.bat
tari_base_node.exe
tari_console_wallet.exe
tari_merge_mining_proxy.exe
```
- The following environment variables are created with a default installation:
- `TARI_TOR_SERVICES_DIR = %USERPROFILE%\.tor_services\Tor`
- `TARI_SQLITE_DIR = %USERPROFILE%\.sqlite`
- `TARI_XMRIG_DIR = %USERPROFILE%\.xmrig`

## Runtime

Expand All @@ -66,9 +74,12 @@ Notes:
- Execute the `.\start_tari_console_wallet` shortcut; this will also start the
Tor services that needs to be running before the base node can run (do not
close the Tor console).
- The Tor console will output `[notice] Bootstrapped 100% (done): Done`

**Note**: The Tor console will output `[notice] Bootstrapped 100% (done): Done`
when the Tor services have fully started.

- Execute the `.\start_tari_merge_mining_proxy` shortcut.
- Execute the `.\start_xmrig` shortcut.
- Runtime artefacts:
- The blockchain will be created in the `.\ridcully` folder.
- The wallet will be created in the `.\wallet` folfder.
Expand Down Expand Up @@ -114,6 +125,17 @@ Notes:
- Ensure folder containing `sqlite3.dll`, is in the user or system path
environment variable (hint: type `path` in a command console to verify).
- OpenSSL:
- Download full version of the 64bit Precompiled Binaries for Windows for
[OpenSSL](https://slproweb.com/products/Win32OpenSSL.html)
- Install using all the default prompts
**Note**: It is important that the dlls are available in the path. To test:
```
where libcrypto-1_1-x64.dll
where libssl-1_1-x64.dll
```
- Tor Services
- Donwload
[Tor Windows Expert Bundle](https://www.torproject.org/download/tor/).
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,16 @@ if ["%sqlite_runtime%"]==[""] (
pause
exit /b 10101
)
if ["%openssl_runtime_1%"]==[""] (
echo Problem with "sopenssl_runtime" environment variable: '%openssl_runtime_1%'
pause
exit /b 10101
)
if ["%openssl_runtime_2%"]==[""] (
echo Problem with "sopenssl_runtime" environment variable: '%openssl_runtime_2%'
pause
exit /b 10101
)

rem Verify SQLite's location and prepend the default location to the system path if it exist
if exist "%TARI_SQLITE_DIR%\%sqlite_runtime%" (
Expand Down Expand Up @@ -60,11 +70,43 @@ if exist "%TARI_SQLITE_DIR%\%sqlite_runtime%" (
)
)

rem Verify OpenSSL's location
set FOUND_OPENSSL=
if exist "%my_exe_path%\%openssl_runtime_1%" (
if exist "%my_exe_path%\%openssl_runtime_2%" (
echo.
echo Using OpenSSL dlls found in "%my_exe_path%"
echo.
set FOUND_OPENSSL=true
)
)
if not defined FOUND_OPENSSL (
set FOUND_1=
set FOUND_2=
for %%X in (%openssl_runtime_1%) do (set FOUND_1=%%~$PATH:X)
for %%X in (%openssl_runtime_2%) do (set FOUND_2=%%~$PATH:X)
if defined FOUND_1 (
if defined FOUND_2 (
set FOUND_OPENSSL=true
echo.
echo OpenSSL dlls found in system path:
where "%openssl_runtime_1%"
where "%openssl_runtime_2%"
)
)
)
if not defined FOUND_OPENSSL (
echo.
echo Note: OpenSSL dlls not found in "%my_exe_path%" or in the system path; this may be a problem
echo.
pause
)

rem Find the base node executable
if exist "%my_exe_path%\%my_exe%" (
set base_node=%my_exe_path%\%my_exe%
echo.
echo Using "%my_exe%" found in my_exe_path
echo Using "%my_exe%" found in %my_exe_path%
echo.
) else (
if exist "%base_path%\%my_exe%" (
Expand All @@ -83,7 +125,7 @@ if exist "%my_exe_path%\%my_exe%" (
echo.
) else (
echo.
echo Runtime "%my_exe%" not found in my_exe_path, base_path or the system path
echo Runtime "%my_exe%" not found in %my_exe_path%, base_path or the system path
echo.
pause
exit /b 10101
Expand All @@ -92,16 +134,16 @@ if exist "%my_exe_path%\%my_exe%" (
)

rem First time run
if not exist "%config_path%\node_id.json" (
if not exist "%config_path%\base_node_id.json" (
"%base_node%" --create-id --config "%config_path%\windows.toml" --log_config "%config_path%\log4rs_base_node.yml" --base-path "%base_path%"
echo.
echo.
echo Created "%config_path%\node_id.json".
echo Created "%config_path%\base_node_id.json".
echo.
) else (
echo.
echo.
echo Using old "%config_path%\node_id.json"
echo Using old "%config_path%\base_node_id.json"
echo.
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ echo ----------------------------
rem These are the base node executable and SQLite dynamic link library names
set my_exe=tari_base_node.exe
set sqlite_runtime=sqlite3.dll
set openssl_runtime_1=libcrypto-1_1-x64.dll
set openssl_runtime_2=libssl-1_1-x64.dll

rem This is the location of the configuration and identity files
set config_path=%~dp0..\config
Expand Down Expand Up @@ -39,7 +41,7 @@ if [%errorlevel%]==[10101] (
echo.
echo Run the base node
echo -----------------
call "%my_exe_path%\run_the_base_node.bat"
call "%my_exe_path%\source_base_node_env.bat"

goto END:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,16 @@ if ["%sqlite_runtime%"]==[""] (
pause
exit /b 10101
)
if ["%openssl_runtime_1%"]==[""] (
echo Problem with "sopenssl_runtime" environment variable: '%openssl_runtime_1%'
pause
exit /b 10101
)
if ["%openssl_runtime_2%"]==[""] (
echo Problem with "sopenssl_runtime" environment variable: '%openssl_runtime_2%'
pause
exit /b 10101
)

rem Verify SQLite's location and prepend the default location to the system path if it exist
if exist "%TARI_SQLITE_DIR%\%sqlite_runtime%" (
Expand Down Expand Up @@ -60,11 +70,43 @@ if exist "%TARI_SQLITE_DIR%\%sqlite_runtime%" (
)
)

rem Verify OpenSSL's location
set FOUND_OPENSSL=
if exist "%my_exe_path%\%openssl_runtime_1%" (
if exist "%my_exe_path%\%openssl_runtime_2%" (
echo.
echo Using OpenSSL dlls found in "%my_exe_path%"
echo.
set FOUND_OPENSSL=true
)
)
if not defined FOUND_OPENSSL (
set FOUND_1=
set FOUND_2=
for %%X in (%openssl_runtime_1%) do (set FOUND_1=%%~$PATH:X)
for %%X in (%openssl_runtime_2%) do (set FOUND_2=%%~$PATH:X)
if defined FOUND_1 (
if defined FOUND_2 (
set FOUND_OPENSSL=true
echo.
echo OpenSSL dlls found in system path:
where "%openssl_runtime_1%"
where "%openssl_runtime_2%"
)
)
)
if not defined FOUND_OPENSSL (
echo.
echo Note: OpenSSL dlls not found in "%my_exe_path%" or in the system path; this may be a problem
echo.
pause
)

rem Find the console wallet executable
if exist "%my_exe_path%\%my_exe%" (
set console_wallet=%my_exe_path%\%my_exe%
echo.
echo Using "%my_exe%" found in my_exe_path
echo Using "%my_exe%" found in %my_exe_path%
echo.
) else (
if exist "%base_path%\%my_exe%" (
Expand All @@ -83,7 +125,7 @@ if exist "%my_exe_path%\%my_exe%" (
echo.
) else (
echo.
echo Runtime "%my_exe%" not found in my_exe_path, base_path or the system path
echo Runtime "%my_exe%" not found in %my_exe_path%, base_path or the system path
echo.
pause
exit /b 10101
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ echo ----------------------------
rem These are the console wallet executable and SQLite dynamic link library names
set my_exe=tari_console_wallet.exe
set sqlite_runtime=sqlite3.dll
set openssl_runtime_1=libcrypto-1_1-x64.dll
set openssl_runtime_2=libssl-1_1-x64.dll

rem This is the location of the configuration and identity files
set config_path=%~dp0..\config
Expand Down Expand Up @@ -39,7 +41,7 @@ if [%errorlevel%]==[10101] (
echo.
echo Run the console wallet
echo ----------------------
call "%my_exe_path%\run_the_console_wallet.bat"
call "%my_exe_path%\source_console_wallet_env.bat"

goto END:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,43 @@ if ["%my_exe%"]==[""] (
exit /b 10101
)

rem Verify OpenSSL's location
set FOUND_OPENSSL=
if exist "%my_exe_path%\%openssl_runtime_1%" (
if exist "%my_exe_path%\%openssl_runtime_2%" (
echo.
echo Using OpenSSL dlls found in "%my_exe_path%"
echo.
set FOUND_OPENSSL=true
)
)
if not defined FOUND_OPENSSL (
set FOUND_1=
set FOUND_2=
for %%X in (%openssl_runtime_1%) do (set FOUND_1=%%~$PATH:X)
for %%X in (%openssl_runtime_2%) do (set FOUND_2=%%~$PATH:X)
if defined FOUND_1 (
if defined FOUND_2 (
set FOUND_OPENSSL=true
echo.
echo OpenSSL dlls found in system path:
where "%openssl_runtime_1%"
where "%openssl_runtime_2%"
)
)
)
if not defined FOUND_OPENSSL (
echo.
echo Note: OpenSSL dlls not found in "%my_exe_path%" or in the system path; this may be a problem
echo.
pause
)

rem Find the merge mining proxy executable
if exist "%my_exe_path%\%my_exe%" (
set merge_mining_proxy=%my_exe_path%\%my_exe%
echo.
echo Using "%my_exe%" found in my_exe_path
echo Using "%my_exe%" found in %my_exe_path%
echo.
) else (
if exist "%base_path%\%my_exe%" (
Expand All @@ -49,7 +81,7 @@ if exist "%my_exe_path%\%my_exe%" (
echo.
) else (
echo.
echo Runtime "%my_exe%" not found in my_exe_path, base_path or the system path
echo Runtime "%my_exe%" not found in %my_exe_path%, base_path or the system path
echo.
pause
exit /b 10101
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ echo Set up environment variables
echo ----------------------------
rem These is the merge mining proxy executable name
set my_exe=tari_merge_mining_proxy.exe
set openssl_runtime_1=libcrypto-1_1-x64.dll
set openssl_runtime_2=libssl-1_1-x64.dll

rem This is the location of the configuration and identity files
set config_path=%~dp0..\config
Expand All @@ -22,7 +24,7 @@ echo base_path = %base_path%
echo.
echo Run the merge mining proxy
echo --------------------------
call "%my_exe_path%\run_the_merge_mining_proxy.bat"
call "%my_exe_path%\source_merge_mining_proxy_env.bat"

goto END:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ echo my_exe_path = %my_exe_path%
echo.
echo Run XMRig
echo ---------
call "%my_exe_path%\run_xmrig.bat"
call "%my_exe_path%\source_xmrig_env.bat"

goto END:

Expand Down
10 changes: 10 additions & 0 deletions buildtools/get-openssl-win.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
echo ""
echo ""
echo ""
echo ""
echo ""
echo "OpenSSL download page: '$env:openssl_downloads'"
$url = $env:openssl_repo + ((Invoke-WebRequest "$env:openssl_downloads" -UseBasicParsing).Links.href | `
Select-String -Pattern 'Win64' | Select-String -Pattern 'Light-1_1' | Select-String -Pattern 'exe')
echo "OpenSSL install file: '$url'"
Invoke-WebRequest "$url" -outfile "$env:TEMP\$env:openssl_install_file"
Loading

0 comments on commit 8d4280d

Please sign in to comment.