This change eliminates the BisqExecutable.description method and
replaces it with proper use of the `describedAs` and `defaultsTo`
methods in the JOptSimple API. This removes the concern of formatting
option argument descriptions and default values from the BisqExecutable
class, and delegates it to the new BisqHelpFormatter (see previous
commit), which is designed for the purpose.
For example, prior to this commit, the help text for the --banList
option read as follows:
--banList=<value>
Nodes to exclude from network connections. (default: )
Now it reads as follows:
--banList=<host:port[,...]>
Nodes to exclude from network connections.
Likewise, previous to this commit, the --logLevel option read as
follows:
--logLevel=<value>
Log level [OFF, ALL, ERROR, WARN, INFO, DEBUG, TRACE]
(default: INFO)
And now it reads like this:
--logLevel=<OFF|ALL|ERROR|WARN|INFO|DEBUG|TRACE> (default: INFO)
Log level
There are a number of further improvements that can and should be made
to the description text of the various options, the types specified for
their arguments, etc, but these will be handled in subsequent commits.
This commit is strictly about refactoring existing parser configuration
to take advantage of the new BisqHelpFormatter.
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.
- Remove activationDate
- Refactor ProcessOfferAvailabilityResponse and handle offers from
old versions in case the available arbitrators has changed.
- Remove MakerVerifyMediatorSelection and TakerSelectArbitrator
The mediator handling should be removed as it is not used and not
intended anymore to be used with the current trade protocol, but we
leave that as it is a bit tricky to ensure backward compatibility.
Also the setting of the arbitrator in trade should be further refactored
but as it is also easy to break backward compatibility here we leave
that for now. As we work on the new trade protocol that domain will
become deprecated anyway in the next months...
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.
1. Every bond is defined by its lockup transaction. To make it easy to
track which bonds are confiscated it's easier to track them by only one
txid instead of using a map with a mix of lockup txoutputs and unlock
txoutputs.
To check if a txoutput has been confiscated it has to be checked against
the originiating lockup txid.
2. Minor fixes of naming lockedup -> lockup and comments.
The last selected payment account gets persisted so that at the next
take offer attempt that same account is selected in the combo box in
case there are multiple accounts for that currency.
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