Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -199,11 +199,10 @@ lazy val node = {
mappings in Universal ++= directory((resourceDirectory in Compile).value / "chains").map { case (f, name) =>
f -> s"conf/$name"
},
jdkPackagerJVMArgs := Seq(
"-Dconfig.file=." + sep + "conf" + sep + "app.conf",
"-Dlogback.configurationFile=." + sep + "conf" + sep + "logback.xml",
"-Xss10M"
)
bashScriptExtraDefines += """addJava "-Dconfig.file=${app_home}/../conf/app.conf"""",
bashScriptExtraDefines += """addJava "-Dlogback.configurationFile=${app_home}/../conf/logback.xml"""",
batScriptExtraDefines += """call :add_java "-Dconfig.file=%APP_HOME%\conf\app.conf"""",
batScriptExtraDefines += """call :add_java "-Dlogback.configurationFile=%APP_HOME%\conf\logback.xml""""
)

if (!nixBuild)
Expand Down
2 changes: 1 addition & 1 deletion src/main/scala/io/iohk/ethereum/App.scala
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ object App extends Logger {
case Some(`cli`) => CliLauncher.main(args.tail)
case Some(unknown) =>
log.error(
s"Unrecognised launcher option, " +
s"Unrecognised launcher option $unknown, " +
s"first parameter must be $launchKeytool, $downloadBootstrap, $launchMantis, " +
s"$faucet, $vmServer, $ecKeyGen, $sigValidator or $cli"
)
Expand Down
5 changes: 5 additions & 0 deletions src/universal/bin/eckeygen.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
@echo off

cd "%~dp0\.."

call bin\mantis.bat eckeygen %*
5 changes: 5 additions & 0 deletions src/universal/bin/faucet-server.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
@echo off

cd "%~dp0\.."

call bin\mantis.bat faucet %*
11 changes: 5 additions & 6 deletions src/universal/bin/mantis-launcher
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,10 @@
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
cd $DIR/..

chain="$1"
if [ -z "$chain" ]
then
echo "You need to choose chain"
else
CONFIG_FILE="./conf/$1.conf"
if [ -f "$CONFIG_FILE" ]; then
shift
./bin/mantis -Dconfig.file=./conf/"$chain".conf "$@"
CHAIN_PARAM="-Dconfig.file=$CONFIG_FILE"
fi

./bin/mantis ${CHAIN_PARAM:+"$CHAIN_PARAM"} "$@"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What does this fallback from CHAIN_PARAM to itself achieve?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I found this is the way in bash to not add anything if CHAIN_PARAM is not set. Otherwise it adds the empty string and makes the command fail

19 changes: 19 additions & 0 deletions src/universal/bin/mantis-launcher.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
@echo off

cd "%~dp0\.."

set "CONFIG_FILE=conf\%1.conf"
set "RESTVAR=%*"

if not exist %CONFIG_FILE% goto :skip
set "CHAIN_PARAM=-Dconfig.file=%CONFIG_FILE%"
set RESTVAR=
shift
:loop
if "%1"=="" goto skip
set RESTVAR=%RESTVAR% %1
shift
goto loop

:skip
call bin\mantis.bat %CHAIN_PARAM% %RESTVAR%
5 changes: 5 additions & 0 deletions src/universal/bin/mantis-vm.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
@echo off

cd "%~dp0\.."

call bin\mantis.bat vm-server %*
5 changes: 5 additions & 0 deletions src/universal/bin/signatureValidator.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
@echo off

cd "%~dp0\.."

call bin\mantis.bat signature-validator %*
2 changes: 1 addition & 1 deletion src/universal/conf/application.ini
Original file line number Diff line number Diff line change
@@ -1 +1 @@
-Dconfig.file=./conf/app.conf -Dlogback.configurationFile=./conf/logback.xml -J-Xmx4g -J-Xss10M
-J-Xmx4g -J-Xss10M