@echo off
setlocal

REM Update this path for your Windows environment.
set "JAVA_HOME=C:\Program Files\Java\jdk-17"
set "AGENT_HOME=D:\projects\bsm-lab\dfx\dfxagent\src\docs\agent-bsm-lab-postgres"
set "JAVA_OPTS= -Dfile.encoding=UTF-8 -Xms2048m -Xmx8192m -XshowSettings:properties"
set "TLS_OPTS= -Djavax.net.debug=ssl,handshake,trustmanager -Djavax.net.ssl.trustStore="%AGENT_HOME%\cert\truststore-merged.jks" -Djavax.net.ssl.trustStorePassword=changeit -Djavax.net.ssl.keyStore="%AGENT_HOME%\cert\dfxagent-bsm-lab-postgres.p12" -Djavax.net.ssl.keyStorePassword=qortpals1! -Djavax.net.ssl.keyStoreType=PKCS12"

for /f %%i in ('powershell -NoProfile -Command "Get-Date -Format yyyyMMdd"') do set "TODAY=%%i"

chcp 65001
start "" cmd /c ""%JAVA_HOME%\bin\java.exe" %JAVA_OPTS% %TLS_OPTS% -jar "%AGENT_HOME%\..\..\..\build\libs\dfxagent-1.0.9.jar" --setting.file="%AGENT_HOME%\conf\dfxagent-bsm-lab-postgres.json" 1>>"dfxagent-bsm-lab-postgres-console-debug-%TODAY%.log" 2>&1"

endlocal
