A decentralized bitcoin exchange network
Go to file
Chris Beams b34d59c0a9
Introduce Config as replacement for BisqEnvironment
Prior to this commit, BisqExecutable has been responsible for parsing
command line and config file options and BisqEnvironment has been
responsible for assigning default values to those options and providing
access to option values to callers throughout the codebase.

This approach has worked, but at considerable costs in complexity,
verbosity, and lack of any type-safety in option values. BisqEnvironment
is based on the Spring Framework's Environment abstraction, which
provides a great deal of flexibility in handling command line options,
environment variables, and more, but also operates on the assumption
that such inputs have String-based values.

After having this infrastructure in place for years now, it has become
evident that using Spring's Environment abstraction was both overkill
for what we needed and limited us from getting the kind of concision and
type saftey that we want. The Environment abstraction is by default
actually too flexible. For example, Bisq does not want or need to have
environment variables potentially overriding configuration file values,
as this increases our attack surface and makes our threat model more
complex. This is why we explicitly removed support for handling
environment variables quite some time ago.

The BisqEnvironment class has also organically evolved toward becoming a
kind of "God object", responsible for more than just option handling. It
is also, for example, responsible for tracking the status of the user's
local Bitcoin node, if any. It is also responsible for writing values to
the bisq.properties config file when certain ban filters arrive via the
p2p network. In the commits that follow, these unrelated functions will
be factored out appropriately in order to separate concerns.

As a solution to these problems, this commit begins the process of
eliminating BisqEnvironment in favor of a new, bespoke Config class
custom-tailored to Bisq's needs. Config removes the responsibility for
option parsing from BisqExecutable, and in the end provides "one-stop
shopping" for all option parsing and access needs.

The changes included in this commit represent a proof of concept for the
Config class, where handling of a number of options has been moved from
BisqEnvironment and BisqExecutable over to Config. Because the migration
is only partial, both Config and BisqEnvironment are injected
side-by-side into calling code that needs access to options. As the
migration is completed, BisqEnvironment will be removed entirely, and
only the Config object will remain.

An additional benefit of the elimination of BisqEnvironment is that it
will allow us to remove our dependency on the Spring Framework (with the
exception of the standalone pricenode application, which is Spring-based
by design).

Note that while this change and those that follow it are principally a
refactoring effort, certain functional changes have been introduced. For
example, Bisq now supports a `--configFile` argument at the command line
that functions very similarly to Bitcoin Core's `-conf` option.
2020-01-20 16:37:54 +01:00
.github Close PRs that are inactive for more than 30 days 2019-12-09 12:08:22 +01:00
.idea Introduce Config as replacement for BisqEnvironment 2020-01-20 16:37:54 +01:00
assets/src List LBRY Credits (LBC) 2019-10-18 07:33:38 -06:00
cli/src/main/java/bisq/cli/app Reflect higher security deposit in placeOffer RPC comment 2020-01-20 12:58:13 +01:00
common/src Introduce Config as replacement for BisqEnvironment 2020-01-20 16:37:54 +01:00
core Introduce Config as replacement for BisqEnvironment 2020-01-20 16:37:54 +01:00
daemon/src/main/java Introduce Config as replacement for BisqEnvironment 2020-01-20 16:37:54 +01:00
desktop Introduce Config as replacement for BisqEnvironment 2020-01-20 16:37:54 +01:00
docs Merge pull request #3713 from beingindot/beingindot-daosetup-change 2019-12-06 16:24:26 +01:00
gradle Exclude unnecessary dependency on animal-sniffer-plugin 2020-01-20 15:46:17 +01:00
monitor Introduce Config as replacement for BisqEnvironment 2020-01-20 16:37:54 +01:00
p2p/src Introduce Config as replacement for BisqEnvironment 2020-01-20 16:37:54 +01:00
pricenode Replace bouncycastle Hex with guava Hex 2019-09-03 13:54:32 +02:00
relay Also revert to SNAPSHOT version for relay 2020-01-09 19:45:29 +01:00
scripts Add shell script for creating DAO genesis transaction 2019-06-24 13:15:37 -07:00
seednode Introduce Config as replacement for BisqEnvironment 2020-01-20 16:37:54 +01:00
statsnode/src/main Introduce Config as replacement for BisqEnvironment 2020-01-20 16:37:54 +01:00
.editorconfig Do not strip trailing whitespace in Git diffs 2020-01-10 19:48:26 +01:00
.gitattributes Add .gitattributes file 2018-11-15 22:34:05 -08:00
.gitignore Ignore Structure101 Workspace files 2020-01-10 19:48:26 +01:00
.travis.yml Reformat travis config 2019-08-27 10:44:14 +02:00
build.gradle Introduce Config as replacement for BisqEnvironment 2020-01-20 16:37:54 +01:00
CODEOWNERS Update node operators 2019-05-14 14:25:26 +02:00
CONTRIBUTING.md Add re-review text to Contributing Doc 2019-11-26 07:39:50 -08:00
gradle.properties Increase Gradle HTTP timeouts from 30 => 120 seconds 2018-03-22 10:39:52 +01:00
gradlew Bump gradle wrapper to version 5.6.4 (#3627) 2019-11-18 09:31:58 +01:00
gradlew.bat Bump gradle wrapper to version 5.6.4 (#3627) 2019-11-18 09:31:58 +01:00
LICENSE add basic wallet, update nav buttons, move unused img 2014-04-24 16:55:55 +02:00
Makefile Add 'make undeploy' target to kill all running nodes 2019-12-03 12:04:39 +01:00
pull_request_template.md Added a Pull Request template 2019-11-27 13:46:54 +01:00
README.md jdk10 is no longer needed to build and run the test suite 2019-08-14 18:11:57 +02:00
settings.gradle Rename submodule grpc => daemon 2020-01-20 12:13:30 +01:00

Bisq

Build Status

What is Bisq?

Bisq is a safe, private and decentralized way to exchange bitcoin for national currencies and other digital assets. Bisq uses peer-to-peer networking and multi-signature escrow to facilitate trading without a third party. Bisq is non-custodial and incorporates a human arbitration system to resolve disputes.

To learn more, see the doc and video at https://bisq.network/intro.

Get started using Bisq

Follow the step-by-step instructions at https://bisq.network/get-started.

Contribute to Bisq

See CONTRIBUTING.md and the developer docs.