Prior to this commit, help output for Bisq executables, e.g. Bisq
Desktop itself used JOptSimple's default HelpFormatter implementation,
which creates a quite cramped and hard-to-read output.
This commit introduces a custom HelpFormatter implementation modeled
after bitcoind's own help output. It maximizes readability while making
full use of an 80-character width.
This change suppresses help output when option parsing fails, e.g. due
to an unrecognized option being specified. This is in keeping with *nix
utility idioms; for example, notice what happens when running `git
--bogus` or `ls --bogus`: they output an error message, and in some
cases a usage message, but they do not print complete help text.
This approach is especially important in the case of an application like
Bisq, where there are many options and the help text is longer than a
typical screen, making it easy to miss the error message altogether, as
it is printed at the top of the screen.
This change also prints the error message to stderr vs stdout, which is
again in keeping with *nix utility idoms.
Usually Bisq is run from its 'shadow jar', i.e. the executable fat jar
that collapses all dependencies and resources into a single file. In that
scenario, only a single 'logback.xml' is included in the fat jar and all
is well.
However, when Bisq is run with a normal external classpath, e.g. from
within IDEA, when using `gradle :desktop:run` or when running one of the
Gradle-generated shell scripts under desktop/build/scripts, multiple
'logback.xml' files are present on the classpath, which causes Logback
to complain with messages like the following:
Found resource [logback.xml] at [file:.../desktop/build/resources/main/logback.xml]
Resource [logback.xml] occurs multiple times on the classpath.
Resource [logback.xml] occurs at [file:.../desktop/build/resources/main/logback.xml]
Resource [logback.xml] occurs at [jar:file:.../core/build/libs/core.jar!/logback.xml]
Note the last line above. The presence of 'logback.xml' in the bisq-core
jar is the 'duplicate'. This is Logback's way of warning the user that
it doesn't know which file should be considered canonical. The only way
to avoid this error message (and the many other lines that get output
along with it) is to remove the offending duplicate file.
This commit removes logback.xml from core to solve the problem described
above. The file is unnecessary in the context of running bisq-desktop,
bisq-seednode, etc, and the only context in which it would actually be
used is when running BisqHeadlessAppMain in core. With that said, the
configuration in the core logback.xml file is identical to the default
Logback configuration, so removing the file has no effect on the logging
output from BisqHeadlessAppMain, and furthermore, it appears that
BisqHeadlessAppMain is not actually in use anywhere right now (it was
added some months ago in anticipation of integrating the new HTTP API,
but this has yet to occur).
In a future change, we should probably return the core module to being a
pure library, without any main methods, and introduce a different
module, e.g. 'daemon' that contains the equivalent of
BisqHeadlessAppMain and whatever logback.xml configuration is
appropriate for it. Doing things this way will avoid the 'duplicate'
errors shown above, because desktop, seednode, etc will not depend on
core module, but will not depend on the daemon module.
This code is no longer necessary after the recent move to JDK10, and
removing it entirely avoids spending unnecessary cycles and eliminates
the confusing "Cryptography restrictions removal not needed" message in
console output.
We play a silent sound to prevent app nap and network disconnections.
Instead of a temp file which got deleted on exit and recreated each
startup we store it once in the data directory root.
Fixes https://github.com/bisq-network/bisq/issues/1931
From the changes in isCryptoCurrency which return true in case of BTC
there have been some bugs. We changed the check to distinguish between
altcoin and fiat to check for BTC as base currency now.
That area would require a bigger refactoring...
- We return true at isCryptoCurrency in those cases:
- The code is BTC
- The code is found in assetRegistry
- If not found we check if we have a fiat currency for that code,
if not we treat it as crypto (case of a removed asset)
- cross check the isCryptoCurrency method if the symbol matches any
fiat currency and of both not match consider it still a CC. In case of
a removed asset it was returning false before which caused an issue in
the trade currency pair showing both sides as BTC.
- Show N/A for name in case the asset is not available.
The code mostly operates with the ticker symbol which gets stored in
the offer, so even an asset is removed traders who have that asset in
their account list can trade without problems.
Tested create offer, take offer and executing a trade.
It is no longer necessary to publish Maven metadata about common, core
and other submodules as they are no longer managed as separate libraries
in separate repositories. The only way these modules should be getting
referenced is from within applications in this repository such as
desktop, statsnode, etc. Essentially, we're no longer publishing our
libraries for public consumption.