2018-11-04 16:55:33 +01:00
|
|
|
buildscript {
|
|
|
|
repositories {
|
|
|
|
jcenter()
|
|
|
|
}
|
|
|
|
dependencies {
|
2019-08-15 19:59:52 +02:00
|
|
|
classpath 'com.google.protobuf:protobuf-gradle-plugin:0.8.10'
|
2018-11-04 16:55:33 +01:00
|
|
|
classpath 'com.google.gradle:osdetector-gradle-plugin:1.6.0'
|
2019-11-19 18:05:14 +01:00
|
|
|
classpath 'com.github.jengelman.gradle.plugins:shadow:5.2.0'
|
2018-11-04 17:37:32 +01:00
|
|
|
classpath files('gradle/witness/gradle-witness.jar')
|
2018-11-04 17:57:00 +01:00
|
|
|
classpath 'org.springframework.boot:spring-boot-gradle-plugin:1.5.10.RELEASE'
|
2018-11-04 16:55:33 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
Generate scripts for Bisq executables in root dir
This change configures the Gradle build to generate "start scripts" for
each Bisq executable (e.g. Bisq Desktop, Bisq Seednode, etc) in the root
project directory, such that after invoking `./gradle build`, the
following executable scripts become available:
~/Work/bisq-network/bisq
$ ls -1 | egrep '(bisq*|lib)'
bisq-desktop
bisq-desktop.bat
bisq-monitor
bisq-monitor.bat
bisq-relay
bisq-relay.bat
bisq-seednode
bisq-seednode.bat
bisq-statsnode
bisq-statsnode.bat
lib
This makes it possible for users (developers) to easily discover and use
these scripts in an idiomatic and platform-agnostic way as opposed to
the previous situation where we would advise users to run e.g.
java -jar desktop/build/libs/desktop-0.8.0-SNAPSHOT-all.jar
This approach works, but is cumbersome and focuses unnecessarily on the
Java-based nature of the project. Now, with the changes in this commit,
the user would simply run:
./bisq-desktop
The 'lib' directory shown above contains all the jar files necessary to
construct classpaths for these various scripts. The 'cleanInstallDist'
task deletes the 'bisq-*' files and the 'lib' directory, and the default
'clean' task has been configured to depend on the 'cleanInstallDist'
task to ensure this cleanup happens automatically when most users would
expect it.
In the future, these same scripts can be used when installing Bisq
executables properly on users' systems via package managers like Brew
and Apt. The goal is to have the user experience around running
`bisq-desktop` (and more importantly, the forthcoming `bisqd`) be
similar in every way to installing and using `bitcoind`, `lnd` and other
idiomatic *nix-style utilities, be they Bitcoin-related or not.
See the changes in docs/build.md and docs/dev-setup.md for a further
sense of the how this change impacts the developer experience.
2018-11-23 14:33:44 +01:00
|
|
|
configure(rootProject) {
|
|
|
|
// remove the 'bisq-*' scripts and 'lib' dir generated by the 'installDist' task
|
|
|
|
task clean {
|
|
|
|
doLast {
|
|
|
|
delete fileTree(dir: rootProject.projectDir, include: 'bisq-*'), 'lib'
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2018-11-04 18:43:20 +01:00
|
|
|
|
2018-11-04 16:27:52 +01:00
|
|
|
configure(subprojects) {
|
2018-11-04 13:40:00 +01:00
|
|
|
apply plugin: 'java'
|
2018-11-04 18:16:07 +01:00
|
|
|
apply plugin: 'com.google.osdetector'
|
|
|
|
|
2018-11-04 13:40:00 +01:00
|
|
|
sourceCompatibility = 1.10
|
2018-11-04 18:41:56 +01:00
|
|
|
|
2019-08-21 08:35:58 +02:00
|
|
|
ext { // in alphabetical order
|
2018-11-04 18:41:56 +01:00
|
|
|
bcVersion = '1.56'
|
2019-08-03 21:00:55 +02:00
|
|
|
bitcoinjVersion = 'a88d36d'
|
2019-09-02 15:59:55 +02:00
|
|
|
btcdCli4jVersion = '975ff5d4'
|
2020-03-22 20:01:54 +01:00
|
|
|
codecVersion = '1.13'
|
2019-08-03 21:00:55 +02:00
|
|
|
easybindVersion = '1.0.3'
|
2018-11-04 18:41:56 +01:00
|
|
|
easyVersion = '4.0.1'
|
2019-08-03 21:00:55 +02:00
|
|
|
findbugsVersion = '3.0.2'
|
|
|
|
firebaseVersion = '6.2.0'
|
2019-08-16 16:18:41 +02:00
|
|
|
fontawesomefxVersion = '8.0.0'
|
|
|
|
fontawesomefxCommonsVersion = '9.1.2'
|
|
|
|
fontawesomefxMaterialdesignfontVersion = '2.0.26-9.1.2'
|
Introduce gRPC API proof of concept
This commit introduces a new `grpc` module including the following key
types:
- BisqGrpcServer: The API implementation itself, along with generated
gRPC Response/Reploy types defined in grpc/src/main/proto/grpc.proto.
- BisqGrpcServerMain: A 'headless' / daemon-like entry point for
running a Bisq node without the JavaFX desktop UI.
- BisqGrpcClient: A simple, repl-style client for the API that allows
the user to exercise the various endpoints as seen in the example
below.
In the `desktop` module, the BisqAppMain class has been modified to
start a BisqGrpcServer instance if the `--desktopWithGrpcApi` option has
been set to `true`.
In the `core` module, a new `CoreApi` class has been introduced
providing a kind of comprehensive facade for all Bisq functionality to
be exposed via the RPC API.
How to explore the proof of concept:
1. Run the main() method in BisqAppMain providing
`--desktopWithGrpcApi=true` as a program argument or alternatively, run
the main() method in BisqGrpcServerMain, where no special option is
required. In either case, you'll notice the following entry in the log
output:
INFO bisq.grpc.BisqGrpcServer: Server started, listening on 8888
2. Now run the main() method in BisqGrpcClient. Once it has started up
you are connected to the gRPC server started in step 1 above. To
exercise the API, type `getVersion` via stdin and hit return. You
should see the following response:
INFO bisq.grpc.BisqGrpcClient - 1.2.4
Likewise, you can type `getBalance` and you'll see the following
response:
INFO bisq.grpc.BisqGrpcClient - 0.00 BTC
and so forth for each of the implemented endpoints. For a list of
implemented endpoints, see BisqGrpcServer.start().
Note once again that the code here is merely a proof of concept and
should not be considered complete or production-ready in any way. In a
subsequent commit, the `--desktopWithGrpcApi` option will be disabled in
order to avoid any potential production use.
The content of this commit is the result of squashing a number of
commits originally authored by chimp1984 in the `chimp1984` fork's `grpc`
branch.
Co-authored-by: Chris Beams <chris@beams.io>
2019-09-18 18:39:37 +02:00
|
|
|
grpcVersion = '1.25.0'
|
2019-08-03 21:00:55 +02:00
|
|
|
guavaVersion = '20.0'
|
2019-08-13 16:44:00 +02:00
|
|
|
guiceVersion = '4.2.2'
|
2019-08-03 21:00:55 +02:00
|
|
|
hamcrestVersion = '1.3'
|
2020-03-22 20:01:54 +01:00
|
|
|
httpclientVersion = '4.5.12'
|
|
|
|
httpcoreVersion = '4.4.13'
|
|
|
|
ioVersion = '2.6'
|
2019-08-03 21:00:55 +02:00
|
|
|
jacksonVersion = '2.8.10'
|
2019-11-19 08:28:38 +01:00
|
|
|
javafxVersion = '11.0.2'
|
2019-08-03 21:00:55 +02:00
|
|
|
jcsvVersion = '1.4.0'
|
|
|
|
jetbrainsAnnotationsVersion = '13.0'
|
|
|
|
jfoenixVersion = '9.0.6'
|
2018-11-04 18:41:56 +01:00
|
|
|
joptVersion = '5.0.3'
|
2019-08-03 21:00:55 +02:00
|
|
|
jsonsimpleVersion = '1.1.1'
|
|
|
|
junitVersion = '4.12'
|
|
|
|
jupiterVersion = '5.3.2'
|
2019-08-21 08:35:58 +02:00
|
|
|
kotlinVersion = '1.3.41'
|
2019-08-03 21:00:55 +02:00
|
|
|
knowmXchangeVersion = '4.3.3'
|
2020-03-22 20:01:54 +01:00
|
|
|
langVersion = '3.8'
|
|
|
|
logbackVersion = '1.1.11'
|
|
|
|
loggingVersion = '1.2'
|
2018-11-04 18:41:56 +01:00
|
|
|
lombokVersion = '1.18.2'
|
2019-08-13 17:47:53 +02:00
|
|
|
mockitoVersion = '3.0.0'
|
2019-11-07 10:37:12 +01:00
|
|
|
netlayerVersion = '0.6.5.2'
|
2019-11-22 12:54:34 +01:00
|
|
|
protobufVersion = '3.10.0'
|
|
|
|
protocVersion = protobufVersion
|
2019-08-03 21:00:55 +02:00
|
|
|
pushyVersion = '0.13.2'
|
|
|
|
qrgenVersion = '1.3'
|
|
|
|
sarxosVersion = '0.3.12'
|
2020-03-22 20:01:54 +01:00
|
|
|
slf4jVersion = '1.7.25'
|
2018-11-04 18:41:56 +01:00
|
|
|
sparkVersion = '2.5.2'
|
2019-08-03 21:00:55 +02:00
|
|
|
springBootVersion = '1.5.10.RELEASE'
|
2018-11-04 18:41:56 +01:00
|
|
|
|
2018-11-04 18:16:07 +01:00
|
|
|
os = osdetector.os == 'osx' ? 'mac' : osdetector.os == 'windows' ? 'win' : osdetector.os
|
|
|
|
}
|
2018-11-04 14:06:23 +01:00
|
|
|
|
|
|
|
repositories {
|
2018-11-07 17:58:26 +01:00
|
|
|
mavenCentral()
|
2018-11-04 14:06:23 +01:00
|
|
|
maven { url 'https://jitpack.io' }
|
|
|
|
}
|
2018-11-04 14:14:56 +01:00
|
|
|
|
2018-11-04 18:41:56 +01:00
|
|
|
dependencies {
|
2019-08-03 21:00:55 +02:00
|
|
|
testCompile "junit:junit:$junitVersion"
|
2018-11-04 18:41:56 +01:00
|
|
|
}
|
|
|
|
|
2018-11-04 14:14:56 +01:00
|
|
|
tasks.withType(JavaCompile) {
|
|
|
|
options.encoding = 'UTF-8'
|
|
|
|
}
|
2018-11-04 13:40:00 +01:00
|
|
|
}
|
2018-11-04 16:27:52 +01:00
|
|
|
|
2018-11-04 18:43:20 +01:00
|
|
|
|
2019-11-20 21:04:34 +01:00
|
|
|
configure([project(':cli'),
|
2019-11-22 19:39:46 +01:00
|
|
|
project(':daemon'),
|
2019-11-20 21:04:34 +01:00
|
|
|
project(':desktop'),
|
2018-11-04 16:27:52 +01:00
|
|
|
project(':monitor'),
|
|
|
|
project(':relay'),
|
|
|
|
project(':seednode'),
|
2019-04-16 09:47:34 +02:00
|
|
|
project(':statsnode'),
|
|
|
|
project(':pricenode')]) {
|
Generate scripts for Bisq executables in root dir
This change configures the Gradle build to generate "start scripts" for
each Bisq executable (e.g. Bisq Desktop, Bisq Seednode, etc) in the root
project directory, such that after invoking `./gradle build`, the
following executable scripts become available:
~/Work/bisq-network/bisq
$ ls -1 | egrep '(bisq*|lib)'
bisq-desktop
bisq-desktop.bat
bisq-monitor
bisq-monitor.bat
bisq-relay
bisq-relay.bat
bisq-seednode
bisq-seednode.bat
bisq-statsnode
bisq-statsnode.bat
lib
This makes it possible for users (developers) to easily discover and use
these scripts in an idiomatic and platform-agnostic way as opposed to
the previous situation where we would advise users to run e.g.
java -jar desktop/build/libs/desktop-0.8.0-SNAPSHOT-all.jar
This approach works, but is cumbersome and focuses unnecessarily on the
Java-based nature of the project. Now, with the changes in this commit,
the user would simply run:
./bisq-desktop
The 'lib' directory shown above contains all the jar files necessary to
construct classpaths for these various scripts. The 'cleanInstallDist'
task deletes the 'bisq-*' files and the 'lib' directory, and the default
'clean' task has been configured to depend on the 'cleanInstallDist'
task to ensure this cleanup happens automatically when most users would
expect it.
In the future, these same scripts can be used when installing Bisq
executables properly on users' systems via package managers like Brew
and Apt. The goal is to have the user experience around running
`bisq-desktop` (and more importantly, the forthcoming `bisqd`) be
similar in every way to installing and using `bitcoind`, `lnd` and other
idiomatic *nix-style utilities, be they Bitcoin-related or not.
See the changes in docs/build.md and docs/dev-setup.md for a further
sense of the how this change impacts the developer experience.
2018-11-23 14:33:44 +01:00
|
|
|
|
2018-11-04 16:27:52 +01:00
|
|
|
apply plugin: 'application'
|
|
|
|
|
|
|
|
build.dependsOn installDist
|
|
|
|
installDist.destinationDir = file('build/app')
|
|
|
|
distZip.enabled = false
|
Generate scripts for Bisq executables in root dir
This change configures the Gradle build to generate "start scripts" for
each Bisq executable (e.g. Bisq Desktop, Bisq Seednode, etc) in the root
project directory, such that after invoking `./gradle build`, the
following executable scripts become available:
~/Work/bisq-network/bisq
$ ls -1 | egrep '(bisq*|lib)'
bisq-desktop
bisq-desktop.bat
bisq-monitor
bisq-monitor.bat
bisq-relay
bisq-relay.bat
bisq-seednode
bisq-seednode.bat
bisq-statsnode
bisq-statsnode.bat
lib
This makes it possible for users (developers) to easily discover and use
these scripts in an idiomatic and platform-agnostic way as opposed to
the previous situation where we would advise users to run e.g.
java -jar desktop/build/libs/desktop-0.8.0-SNAPSHOT-all.jar
This approach works, but is cumbersome and focuses unnecessarily on the
Java-based nature of the project. Now, with the changes in this commit,
the user would simply run:
./bisq-desktop
The 'lib' directory shown above contains all the jar files necessary to
construct classpaths for these various scripts. The 'cleanInstallDist'
task deletes the 'bisq-*' files and the 'lib' directory, and the default
'clean' task has been configured to depend on the 'cleanInstallDist'
task to ensure this cleanup happens automatically when most users would
expect it.
In the future, these same scripts can be used when installing Bisq
executables properly on users' systems via package managers like Brew
and Apt. The goal is to have the user experience around running
`bisq-desktop` (and more importantly, the forthcoming `bisqd`) be
similar in every way to installing and using `bitcoind`, `lnd` and other
idiomatic *nix-style utilities, be they Bitcoin-related or not.
See the changes in docs/build.md and docs/dev-setup.md for a further
sense of the how this change impacts the developer experience.
2018-11-23 14:33:44 +01:00
|
|
|
|
|
|
|
// the 'installDist' and 'startScripts' blocks below configure bisq executables to put
|
|
|
|
// generated shell scripts in the root project directory, such that users can easily
|
|
|
|
// discover and invoke e.g. ./bisq-desktop, ./bisq-seednode, etc.
|
|
|
|
// See https://stackoverflow.com/q/46327736 for details.
|
|
|
|
|
|
|
|
installDist {
|
|
|
|
doLast {
|
|
|
|
// copy generated shell scripts, e.g. `bisq-desktop` directly to the project
|
|
|
|
// root directory for discoverability and ease of use
|
2018-11-26 15:24:06 +01:00
|
|
|
|
Generate scripts for Bisq executables in root dir
This change configures the Gradle build to generate "start scripts" for
each Bisq executable (e.g. Bisq Desktop, Bisq Seednode, etc) in the root
project directory, such that after invoking `./gradle build`, the
following executable scripts become available:
~/Work/bisq-network/bisq
$ ls -1 | egrep '(bisq*|lib)'
bisq-desktop
bisq-desktop.bat
bisq-monitor
bisq-monitor.bat
bisq-relay
bisq-relay.bat
bisq-seednode
bisq-seednode.bat
bisq-statsnode
bisq-statsnode.bat
lib
This makes it possible for users (developers) to easily discover and use
these scripts in an idiomatic and platform-agnostic way as opposed to
the previous situation where we would advise users to run e.g.
java -jar desktop/build/libs/desktop-0.8.0-SNAPSHOT-all.jar
This approach works, but is cumbersome and focuses unnecessarily on the
Java-based nature of the project. Now, with the changes in this commit,
the user would simply run:
./bisq-desktop
The 'lib' directory shown above contains all the jar files necessary to
construct classpaths for these various scripts. The 'cleanInstallDist'
task deletes the 'bisq-*' files and the 'lib' directory, and the default
'clean' task has been configured to depend on the 'cleanInstallDist'
task to ensure this cleanup happens automatically when most users would
expect it.
In the future, these same scripts can be used when installing Bisq
executables properly on users' systems via package managers like Brew
and Apt. The goal is to have the user experience around running
`bisq-desktop` (and more importantly, the forthcoming `bisqd`) be
similar in every way to installing and using `bitcoind`, `lnd` and other
idiomatic *nix-style utilities, be they Bitcoin-related or not.
See the changes in docs/build.md and docs/dev-setup.md for a further
sense of the how this change impacts the developer experience.
2018-11-23 14:33:44 +01:00
|
|
|
copy {
|
|
|
|
from "$destinationDir/bin"
|
|
|
|
into rootProject.projectDir
|
|
|
|
}
|
|
|
|
// copy libs required for generated shell script classpaths to 'lib' dir under
|
|
|
|
// the project root directory
|
|
|
|
copy {
|
|
|
|
from "$destinationDir/lib"
|
|
|
|
into "${rootProject.projectDir}/lib"
|
|
|
|
}
|
2018-11-24 10:07:39 +01:00
|
|
|
|
2018-11-27 02:52:35 +01:00
|
|
|
// edit generated shell scripts such that they expect to be executed in the
|
|
|
|
// project root dir as opposed to a 'bin' subdirectory
|
2018-11-27 10:31:44 +01:00
|
|
|
def windowsScriptFile = file("${rootProject.projectDir}/bisq-${applicationName}.bat")
|
2018-11-27 02:52:35 +01:00
|
|
|
windowsScriptFile.text = windowsScriptFile.text.replace(
|
|
|
|
'set APP_HOME=%DIRNAME%..', 'set APP_HOME=%DIRNAME%')
|
|
|
|
|
|
|
|
def unixScriptFile = file("${rootProject.projectDir}/bisq-$applicationName")
|
|
|
|
unixScriptFile.text = unixScriptFile.text.replace(
|
|
|
|
'cd "`dirname \\"$PRG\\"`/.." >/dev/null', 'cd "`dirname \\"$PRG\\"`" >/dev/null')
|
|
|
|
|
2020-03-11 14:54:04 +01:00
|
|
|
if (applicationName == 'desktop') {
|
|
|
|
def script = file("${rootProject.projectDir}/bisq-$applicationName")
|
|
|
|
script.text = script.text.replace(
|
|
|
|
'DEFAULT_JVM_OPTS=""', 'DEFAULT_JVM_OPTS="-XX:MaxRAM=4g"')
|
|
|
|
}
|
2020-03-11 14:20:59 +01:00
|
|
|
|
2018-11-24 10:07:39 +01:00
|
|
|
if (osdetector.os != 'windows')
|
|
|
|
delete fileTree(dir: rootProject.projectDir, include: 'bisq-*.bat')
|
2018-11-25 09:35:04 +01:00
|
|
|
else
|
|
|
|
delete fileTree(dir: rootProject.projectDir, include: 'bisq-*', exclude: '*.bat')
|
Generate scripts for Bisq executables in root dir
This change configures the Gradle build to generate "start scripts" for
each Bisq executable (e.g. Bisq Desktop, Bisq Seednode, etc) in the root
project directory, such that after invoking `./gradle build`, the
following executable scripts become available:
~/Work/bisq-network/bisq
$ ls -1 | egrep '(bisq*|lib)'
bisq-desktop
bisq-desktop.bat
bisq-monitor
bisq-monitor.bat
bisq-relay
bisq-relay.bat
bisq-seednode
bisq-seednode.bat
bisq-statsnode
bisq-statsnode.bat
lib
This makes it possible for users (developers) to easily discover and use
these scripts in an idiomatic and platform-agnostic way as opposed to
the previous situation where we would advise users to run e.g.
java -jar desktop/build/libs/desktop-0.8.0-SNAPSHOT-all.jar
This approach works, but is cumbersome and focuses unnecessarily on the
Java-based nature of the project. Now, with the changes in this commit,
the user would simply run:
./bisq-desktop
The 'lib' directory shown above contains all the jar files necessary to
construct classpaths for these various scripts. The 'cleanInstallDist'
task deletes the 'bisq-*' files and the 'lib' directory, and the default
'clean' task has been configured to depend on the 'cleanInstallDist'
task to ensure this cleanup happens automatically when most users would
expect it.
In the future, these same scripts can be used when installing Bisq
executables properly on users' systems via package managers like Brew
and Apt. The goal is to have the user experience around running
`bisq-desktop` (and more importantly, the forthcoming `bisqd`) be
similar in every way to installing and using `bitcoind`, `lnd` and other
idiomatic *nix-style utilities, be they Bitcoin-related or not.
See the changes in docs/build.md and docs/dev-setup.md for a further
sense of the how this change impacts the developer experience.
2018-11-23 14:33:44 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
startScripts {
|
|
|
|
// rename scripts from, e.g. `desktop` to `bisq-desktop`
|
|
|
|
applicationName = "bisq-$applicationName"
|
|
|
|
}
|
2018-11-04 16:27:52 +01:00
|
|
|
}
|
2018-11-04 16:44:10 +01:00
|
|
|
|
2018-11-04 18:43:20 +01:00
|
|
|
|
2018-11-04 16:44:10 +01:00
|
|
|
configure(project(':assets')) {
|
|
|
|
dependencies {
|
2019-01-03 19:57:26 +01:00
|
|
|
compile("com.github.bisq-network.bitcoinj:bitcoinj-core:$bitcoinjVersion") {
|
2019-01-03 21:23:20 +01:00
|
|
|
exclude(module: 'jsr305')
|
|
|
|
exclude(module: 'slf4j-api')
|
|
|
|
exclude(module: 'guava')
|
2019-01-03 19:57:26 +01:00
|
|
|
exclude(module: 'protobuf-java')
|
2018-11-04 16:44:10 +01:00
|
|
|
}
|
2019-08-03 21:00:55 +02:00
|
|
|
compile "com.google.guava:guava:$guavaVersion"
|
2019-01-03 21:23:20 +01:00
|
|
|
compile "org.slf4j:slf4j-api:$slf4jVersion"
|
2018-11-04 18:41:56 +01:00
|
|
|
compile "org.apache.commons:commons-lang3:$langVersion"
|
2018-11-04 16:44:10 +01:00
|
|
|
}
|
|
|
|
}
|
2018-11-04 16:55:33 +01:00
|
|
|
|
2018-11-04 18:43:20 +01:00
|
|
|
|
2018-11-04 16:55:33 +01:00
|
|
|
configure(project(':common')) {
|
|
|
|
apply plugin: 'com.google.protobuf'
|
|
|
|
|
|
|
|
sourceSets.main.java.srcDir "$buildDir/generated/source/proto/main/java"
|
|
|
|
|
|
|
|
protobuf {
|
|
|
|
protoc {
|
2019-11-22 12:54:34 +01:00
|
|
|
artifact = "com.google.protobuf:protoc:$protocVersion"
|
2018-11-04 16:55:33 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
dependencies {
|
2019-08-21 08:35:58 +02:00
|
|
|
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlinVersion"
|
2019-11-19 08:28:38 +01:00
|
|
|
compile "org.openjfx:javafx-base:$javafxVersion:$os"
|
|
|
|
compile "org.openjfx:javafx-graphics:$javafxVersion:$os"
|
2018-11-04 16:55:33 +01:00
|
|
|
compile "com.google.protobuf:protobuf-java:$protobufVersion"
|
2019-11-22 12:54:34 +01:00
|
|
|
compile 'com.google.code.gson:gson:2.8.5'
|
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.
2019-12-06 23:54:58 +01:00
|
|
|
compile "net.sf.jopt-simple:jopt-simple:$joptVersion"
|
2018-12-29 13:20:10 +01:00
|
|
|
compile "org.slf4j:slf4j-api:$slf4jVersion"
|
|
|
|
compile "ch.qos.logback:logback-core:$logbackVersion"
|
|
|
|
compile "ch.qos.logback:logback-classic:$logbackVersion"
|
2019-08-03 21:00:55 +02:00
|
|
|
compile "com.google.code.findbugs:jsr305:$findbugsVersion"
|
|
|
|
compile "com.google.guava:guava:$guavaVersion"
|
|
|
|
compile("com.google.inject:guice:$guiceVersion") {
|
2019-08-16 16:18:41 +02:00
|
|
|
exclude(module: 'guava')
|
2018-11-04 16:55:33 +01:00
|
|
|
}
|
2019-01-03 19:57:26 +01:00
|
|
|
compile("com.github.bisq-network.bitcoinj:bitcoinj-core:$bitcoinjVersion") {
|
2018-11-04 16:55:33 +01:00
|
|
|
exclude(module: 'jsr305')
|
|
|
|
exclude(module: 'slf4j-api')
|
|
|
|
exclude(module: 'guava')
|
|
|
|
exclude(module: 'protobuf-java')
|
|
|
|
}
|
2019-08-03 21:00:55 +02:00
|
|
|
compile "org.jetbrains:annotations:$jetbrainsAnnotationsVersion"
|
2018-11-04 18:41:56 +01:00
|
|
|
compile "org.bouncycastle:bcpg-jdk15on:$bcVersion"
|
2019-08-03 21:00:55 +02:00
|
|
|
compile "commons-io:commons-io:$ioVersion"
|
2018-11-04 18:41:56 +01:00
|
|
|
compile "org.apache.commons:commons-lang3:$langVersion"
|
|
|
|
compileOnly "org.projectlombok:lombok:$lombokVersion"
|
|
|
|
annotationProcessor "org.projectlombok:lombok:$lombokVersion"
|
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.
2019-12-06 23:54:58 +01:00
|
|
|
testCompile "org.hamcrest:hamcrest-all:$hamcrestVersion"
|
2018-11-04 16:55:33 +01:00
|
|
|
}
|
|
|
|
}
|
2018-11-04 17:18:46 +01:00
|
|
|
|
2018-11-04 18:43:20 +01:00
|
|
|
|
2018-11-04 17:46:03 +01:00
|
|
|
configure(project(':p2p')) {
|
|
|
|
dependencies {
|
|
|
|
compile project(':common')
|
2019-08-03 21:00:55 +02:00
|
|
|
compile("com.github.JesusMcCloud.netlayer:tor.native:$netlayerVersion") {
|
2018-11-16 17:49:04 +01:00
|
|
|
exclude(module: 'slf4j-api')
|
|
|
|
}
|
2019-08-03 21:00:55 +02:00
|
|
|
compile("com.github.JesusMcCloud.netlayer:tor.external:$netlayerVersion") {
|
2018-11-04 17:46:03 +01:00
|
|
|
exclude(module: 'slf4j-api')
|
|
|
|
}
|
2020-03-22 20:01:54 +01:00
|
|
|
implementation("org.apache.httpcomponents:httpclient:$httpclientVersion") {
|
|
|
|
exclude(module: 'commons-codec')
|
|
|
|
}
|
2019-08-03 21:00:55 +02:00
|
|
|
compile "org.fxmisc.easybind:easybind:$easybindVersion"
|
2018-11-04 18:41:56 +01:00
|
|
|
compileOnly "org.projectlombok:lombok:$lombokVersion"
|
|
|
|
annotationProcessor "org.projectlombok:lombok:$lombokVersion"
|
|
|
|
testCompileOnly "org.projectlombok:lombok:$lombokVersion"
|
|
|
|
testAnnotationProcessor "org.projectlombok:lombok:$lombokVersion"
|
2019-08-13 19:47:40 +02:00
|
|
|
testCompile("org.mockito:mockito-core:$mockitoVersion")
|
2018-11-04 17:46:03 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-11-04 18:43:20 +01:00
|
|
|
|
2018-11-04 17:18:46 +01:00
|
|
|
configure(project(':core')) {
|
2019-11-21 07:48:25 +01:00
|
|
|
apply plugin: 'com.google.protobuf'
|
|
|
|
|
2018-11-04 17:18:46 +01:00
|
|
|
dependencies {
|
|
|
|
compile project(':assets')
|
|
|
|
compile project(':p2p')
|
2020-03-22 20:01:54 +01:00
|
|
|
implementation "commons-codec:commons-codec:$codecVersion"
|
|
|
|
implementation "org.apache.httpcomponents:httpcore:$httpcoreVersion"
|
|
|
|
implementation("org.apache.httpcomponents:httpclient:$httpclientVersion") {
|
|
|
|
exclude(module: 'commons-codec')
|
|
|
|
}
|
2019-08-03 21:00:55 +02:00
|
|
|
compile("network.bisq.btcd-cli4j:btcd-cli4j-core:$btcdCli4jVersion") {
|
2018-11-04 17:18:46 +01:00
|
|
|
exclude(module: 'slf4j-api')
|
|
|
|
exclude(module: 'httpclient')
|
|
|
|
exclude(module: 'commons-lang3')
|
|
|
|
exclude(module: 'jackson-core')
|
|
|
|
exclude(module: 'jackson-annotations')
|
|
|
|
exclude(module: 'jackson-databind')
|
|
|
|
}
|
2019-08-03 21:00:55 +02:00
|
|
|
compile("network.bisq.btcd-cli4j:btcd-cli4j-daemon:$btcdCli4jVersion") {
|
2018-11-04 17:18:46 +01:00
|
|
|
exclude(module: 'slf4j-api')
|
|
|
|
exclude(module: 'httpclient')
|
|
|
|
exclude(module: 'commons-lang3')
|
|
|
|
exclude(module: 'jackson-core')
|
|
|
|
exclude(module: 'jackson-annotations')
|
|
|
|
exclude(module: 'jackson-databind')
|
|
|
|
}
|
2019-08-03 21:00:55 +02:00
|
|
|
compile "com.fasterxml.jackson.core:jackson-core:$jacksonVersion"
|
|
|
|
compile "com.fasterxml.jackson.core:jackson-annotations:$jacksonVersion"
|
|
|
|
compile("com.fasterxml.jackson.core:jackson-databind:$jacksonVersion") {
|
2018-11-04 17:18:46 +01:00
|
|
|
exclude(module: 'jackson-annotations')
|
|
|
|
}
|
2019-11-22 12:54:34 +01:00
|
|
|
implementation "com.google.protobuf:protobuf-java:$protobufVersion"
|
|
|
|
implementation("io.grpc:grpc-protobuf:$grpcVersion") {
|
2019-11-21 07:48:25 +01:00
|
|
|
exclude(module: 'guava')
|
2020-01-20 15:33:56 +01:00
|
|
|
exclude(module: 'animal-sniffer-annotations')
|
2019-11-21 07:48:25 +01:00
|
|
|
}
|
2019-11-22 12:54:34 +01:00
|
|
|
implementation("io.grpc:grpc-stub:$grpcVersion") {
|
2019-11-21 07:48:25 +01:00
|
|
|
exclude(module: 'guava')
|
2020-01-20 15:33:56 +01:00
|
|
|
exclude(module: 'animal-sniffer-annotations')
|
2019-11-21 07:48:25 +01:00
|
|
|
}
|
2019-11-22 12:54:34 +01:00
|
|
|
compileOnly "javax.annotation:javax.annotation-api:1.2"
|
|
|
|
runtimeOnly ("io.grpc:grpc-netty-shaded:$grpcVersion") {
|
2019-11-21 07:48:25 +01:00
|
|
|
exclude(module: 'guava')
|
2020-01-20 15:33:56 +01:00
|
|
|
exclude(module: 'animal-sniffer-annotations')
|
2019-11-21 07:48:25 +01:00
|
|
|
}
|
2018-11-04 18:41:56 +01:00
|
|
|
compileOnly "org.projectlombok:lombok:$lombokVersion"
|
|
|
|
annotationProcessor "org.projectlombok:lombok:$lombokVersion"
|
2018-11-04 17:18:46 +01:00
|
|
|
|
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.
2019-12-06 23:54:58 +01:00
|
|
|
testCompile "org.hamcrest:hamcrest-all:$hamcrestVersion"
|
2019-08-16 16:18:41 +02:00
|
|
|
testCompile "org.mockito:mockito-core:$mockitoVersion"
|
2018-11-04 18:41:56 +01:00
|
|
|
testCompile "com.natpryce:make-it-easy:$easyVersion"
|
|
|
|
testCompileOnly "org.projectlombok:lombok:$lombokVersion"
|
|
|
|
testAnnotationProcessor "org.projectlombok:lombok:$lombokVersion"
|
2018-11-04 17:18:46 +01:00
|
|
|
}
|
|
|
|
|
2019-11-22 12:54:34 +01:00
|
|
|
protobuf {
|
|
|
|
protoc {
|
|
|
|
artifact = "com.google.protobuf:protoc:${protocVersion}"
|
|
|
|
}
|
|
|
|
plugins {
|
|
|
|
grpc {
|
|
|
|
artifact = "io.grpc:protoc-gen-grpc-java:${grpcVersion}"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
generateProtoTasks {
|
|
|
|
all()*.plugins { grpc {} }
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
sourceSets.main.java.srcDirs += [
|
|
|
|
'build/generated/source/proto/main/grpc',
|
|
|
|
'build/generated/source/proto/main/java'
|
|
|
|
]
|
|
|
|
|
2018-11-04 17:18:46 +01:00
|
|
|
test {
|
|
|
|
systemProperty 'jdk.attach.allowAttachSelf', true
|
|
|
|
}
|
|
|
|
}
|
2018-11-04 17:37:32 +01:00
|
|
|
|
2019-11-20 21:04:34 +01:00
|
|
|
configure(project(':cli')) {
|
|
|
|
mainClassName = 'bisq.cli.app.BisqCliMain'
|
|
|
|
|
|
|
|
dependencies {
|
|
|
|
compile project(':core')
|
2019-11-22 12:54:34 +01:00
|
|
|
implementation("io.grpc:grpc-core:$grpcVersion") {
|
|
|
|
exclude(module: 'guava')
|
2020-01-20 15:33:56 +01:00
|
|
|
exclude(module: 'animal-sniffer-annotations')
|
2019-11-22 12:54:34 +01:00
|
|
|
}
|
|
|
|
implementation("io.grpc:grpc-stub:$grpcVersion") {
|
|
|
|
exclude(module: 'guava')
|
2020-01-20 15:33:56 +01:00
|
|
|
exclude(module: 'animal-sniffer-annotations')
|
2019-11-22 12:54:34 +01:00
|
|
|
}
|
2019-11-21 07:48:25 +01:00
|
|
|
compileOnly "org.projectlombok:lombok:$lombokVersion"
|
|
|
|
annotationProcessor "org.projectlombok:lombok:$lombokVersion"
|
2019-11-20 21:04:34 +01:00
|
|
|
}
|
|
|
|
}
|
2018-11-04 18:43:20 +01:00
|
|
|
|
2018-11-04 17:37:32 +01:00
|
|
|
configure(project(':desktop')) {
|
|
|
|
apply plugin: 'com.github.johnrengelman.shadow'
|
|
|
|
apply plugin: 'witness'
|
|
|
|
apply from: '../gradle/witness/gradle-witness.gradle'
|
|
|
|
|
2020-03-17 14:44:25 +01:00
|
|
|
version = '1.2.9-SNAPSHOT'
|
2018-11-04 17:37:32 +01:00
|
|
|
|
|
|
|
mainClassName = 'bisq.desktop.app.BisqAppMain'
|
|
|
|
|
|
|
|
tasks.withType(AbstractArchiveTask) {
|
|
|
|
preserveFileTimestamps = false
|
|
|
|
reproducibleFileOrder = true
|
|
|
|
}
|
|
|
|
|
|
|
|
sourceSets.main.resources.srcDirs += ['src/main/java'] // to copy fxml and css files
|
|
|
|
|
|
|
|
dependencies {
|
|
|
|
compile project(':core')
|
2019-08-03 21:00:55 +02:00
|
|
|
compile "net.glxn:qrgen:$qrgenVersion"
|
2019-08-16 16:18:41 +02:00
|
|
|
compile "de.jensd:fontawesomefx:$fontawesomefxVersion"
|
|
|
|
compile "de.jensd:fontawesomefx-commons:$fontawesomefxCommonsVersion"
|
|
|
|
compile "de.jensd:fontawesomefx-materialdesignfont:$fontawesomefxMaterialdesignfontVersion"
|
2019-08-03 21:00:55 +02:00
|
|
|
compile "com.googlecode.jcsv:jcsv:$jcsvVersion"
|
|
|
|
compile "com.github.sarxos:webcam-capture:$sarxosVersion"
|
2019-11-19 08:28:38 +01:00
|
|
|
compile "org.openjfx:javafx-controls:$javafxVersion:$os"
|
|
|
|
compile "org.openjfx:javafx-fxml:$javafxVersion:$os"
|
|
|
|
compile "org.openjfx:javafx-swing:$javafxVersion:$os"
|
2019-08-03 21:00:55 +02:00
|
|
|
compile "com.jfoenix:jfoenix:$jfoenixVersion"
|
2018-11-04 17:37:32 +01:00
|
|
|
|
2018-11-04 18:41:56 +01:00
|
|
|
compileOnly "org.projectlombok:lombok:$lombokVersion"
|
|
|
|
annotationProcessor "org.projectlombok:lombok:$lombokVersion"
|
2018-11-04 17:37:32 +01:00
|
|
|
|
2019-08-16 16:18:41 +02:00
|
|
|
testCompile "org.mockito:mockito-core:$mockitoVersion"
|
2018-11-04 18:41:56 +01:00
|
|
|
testCompile "com.natpryce:make-it-easy:$easyVersion"
|
|
|
|
testCompileOnly "org.projectlombok:lombok:$lombokVersion"
|
|
|
|
testAnnotationProcessor "org.projectlombok:lombok:$lombokVersion"
|
2018-11-04 17:37:32 +01:00
|
|
|
}
|
2019-01-11 16:59:18 +01:00
|
|
|
|
|
|
|
test {
|
|
|
|
systemProperty 'jdk.attach.allowAttachSelf', true
|
|
|
|
}
|
2018-11-04 17:37:32 +01:00
|
|
|
}
|
2018-11-04 17:41:37 +01:00
|
|
|
|
2018-11-04 18:43:20 +01:00
|
|
|
|
2018-11-04 17:41:37 +01:00
|
|
|
configure(project(':monitor')) {
|
2018-12-11 12:20:31 +01:00
|
|
|
mainClassName = 'bisq.monitor.Monitor'
|
|
|
|
|
|
|
|
test {
|
|
|
|
useJUnitPlatform()
|
|
|
|
testLogging {
|
|
|
|
events "passed", "skipped", "failed"
|
|
|
|
}
|
|
|
|
}
|
2018-11-04 17:41:37 +01:00
|
|
|
|
|
|
|
dependencies {
|
2019-01-09 11:52:16 +01:00
|
|
|
compile project(':core')
|
2018-12-29 13:20:10 +01:00
|
|
|
compile "org.slf4j:slf4j-api:$slf4jVersion"
|
|
|
|
compile "ch.qos.logback:logback-core:$logbackVersion"
|
|
|
|
compile "ch.qos.logback:logback-classic:$logbackVersion"
|
2019-08-03 21:00:55 +02:00
|
|
|
compile "com.google.guava:guava:$guavaVersion"
|
2018-12-29 14:16:10 +01:00
|
|
|
|
2018-11-04 18:41:56 +01:00
|
|
|
compileOnly "org.projectlombok:lombok:$lombokVersion"
|
|
|
|
annotationProcessor "org.projectlombok:lombok:$lombokVersion"
|
2018-12-11 12:20:31 +01:00
|
|
|
|
2019-08-03 21:00:55 +02:00
|
|
|
testCompile "org.junit.jupiter:junit-jupiter-api:$jupiterVersion"
|
|
|
|
testCompile "org.junit.jupiter:junit-jupiter-params:$jupiterVersion"
|
2018-12-11 12:20:31 +01:00
|
|
|
testCompileOnly "org.projectlombok:lombok:$lombokVersion"
|
|
|
|
testAnnotationProcessor "org.projectlombok:lombok:$lombokVersion"
|
2019-08-03 21:00:55 +02:00
|
|
|
testRuntime("org.junit.jupiter:junit-jupiter-engine:$jupiterVersion")
|
2018-11-04 17:41:37 +01:00
|
|
|
}
|
|
|
|
}
|
2018-11-04 17:57:00 +01:00
|
|
|
|
2018-11-04 18:43:20 +01:00
|
|
|
|
2018-11-04 17:57:00 +01:00
|
|
|
configure(project(':pricenode')) {
|
|
|
|
apply plugin: "org.springframework.boot"
|
|
|
|
|
2018-11-07 08:43:03 +01:00
|
|
|
version = file("src/main/resources/version.txt").text.trim()
|
2018-11-04 17:57:00 +01:00
|
|
|
|
|
|
|
jar.manifest.attributes(
|
|
|
|
"Implementation-Title": project.name,
|
|
|
|
"Implementation-Version": version)
|
|
|
|
|
|
|
|
dependencies {
|
|
|
|
compile project(":core")
|
2020-03-22 20:01:54 +01:00
|
|
|
implementation "commons-codec:commons-codec:$codecVersion"
|
|
|
|
implementation "org.apache.httpcomponents:httpcore:$httpcoreVersion"
|
|
|
|
implementation("org.apache.httpcomponents:httpclient:$httpclientVersion") {
|
|
|
|
exclude(module: 'commons-codec')
|
|
|
|
}
|
2019-08-03 21:00:55 +02:00
|
|
|
compile("org.knowm.xchange:xchange-bitcoinaverage:$knowmXchangeVersion")
|
|
|
|
compile("org.knowm.xchange:xchange-coinmarketcap:$knowmXchangeVersion")
|
|
|
|
compile("org.knowm.xchange:xchange-poloniex:$knowmXchangeVersion")
|
|
|
|
compile("org.springframework.boot:spring-boot-starter-web:$springBootVersion")
|
2018-11-04 17:57:00 +01:00
|
|
|
compile("org.springframework.boot:spring-boot-starter-actuator")
|
|
|
|
}
|
|
|
|
|
|
|
|
task stage {
|
|
|
|
dependsOn assemble
|
|
|
|
}
|
|
|
|
}
|
2018-11-04 17:58:37 +01:00
|
|
|
|
2018-11-04 18:43:20 +01:00
|
|
|
|
2018-11-04 17:58:37 +01:00
|
|
|
configure(project(':relay')) {
|
|
|
|
mainClassName = 'bisq.relay.RelayMain'
|
|
|
|
|
|
|
|
dependencies {
|
|
|
|
compile project(':common')
|
2018-11-04 18:41:56 +01:00
|
|
|
compile "com.sparkjava:spark-core:$sparkVersion"
|
2020-03-22 20:01:54 +01:00
|
|
|
compile "com.turo:pushy:$pushyVersion"
|
|
|
|
implementation("com.google.firebase:firebase-admin:$firebaseVersion") {
|
|
|
|
exclude(module: 'commons-logging')
|
|
|
|
exclude(module: 'httpclient')
|
|
|
|
exclude(module: 'httpcore')
|
|
|
|
}
|
2018-11-04 18:41:56 +01:00
|
|
|
compile "commons-codec:commons-codec:$codecVersion"
|
2018-11-04 17:58:37 +01:00
|
|
|
}
|
|
|
|
}
|
2018-11-04 18:00:10 +01:00
|
|
|
|
2018-11-04 18:43:20 +01:00
|
|
|
|
2018-11-04 18:00:10 +01:00
|
|
|
configure(project(':seednode')) {
|
|
|
|
apply plugin: 'com.github.johnrengelman.shadow'
|
|
|
|
|
|
|
|
mainClassName = 'bisq.seednode.SeedNodeMain'
|
|
|
|
|
|
|
|
dependencies {
|
|
|
|
compile project(':core')
|
2018-11-04 18:41:56 +01:00
|
|
|
compileOnly "org.projectlombok:lombok:$lombokVersion"
|
|
|
|
annotationProcessor "org.projectlombok:lombok:$lombokVersion"
|
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.
2019-12-06 23:54:58 +01:00
|
|
|
testCompile "org.mockito:mockito-core:$mockitoVersion"
|
2018-11-04 18:00:10 +01:00
|
|
|
}
|
|
|
|
}
|
2018-11-04 18:00:56 +01:00
|
|
|
|
2018-11-04 18:43:20 +01:00
|
|
|
|
2018-11-04 18:00:56 +01:00
|
|
|
configure(project(':statsnode')) {
|
|
|
|
mainClassName = 'bisq.statistics.StatisticsMain'
|
|
|
|
|
|
|
|
dependencies {
|
|
|
|
compile project(':core')
|
2018-11-04 18:41:56 +01:00
|
|
|
compileOnly "org.projectlombok:lombok:$lombokVersion"
|
|
|
|
annotationProcessor "org.projectlombok:lombok:$lombokVersion"
|
2018-11-04 18:00:56 +01:00
|
|
|
}
|
|
|
|
}
|
Introduce gRPC API proof of concept
This commit introduces a new `grpc` module including the following key
types:
- BisqGrpcServer: The API implementation itself, along with generated
gRPC Response/Reploy types defined in grpc/src/main/proto/grpc.proto.
- BisqGrpcServerMain: A 'headless' / daemon-like entry point for
running a Bisq node without the JavaFX desktop UI.
- BisqGrpcClient: A simple, repl-style client for the API that allows
the user to exercise the various endpoints as seen in the example
below.
In the `desktop` module, the BisqAppMain class has been modified to
start a BisqGrpcServer instance if the `--desktopWithGrpcApi` option has
been set to `true`.
In the `core` module, a new `CoreApi` class has been introduced
providing a kind of comprehensive facade for all Bisq functionality to
be exposed via the RPC API.
How to explore the proof of concept:
1. Run the main() method in BisqAppMain providing
`--desktopWithGrpcApi=true` as a program argument or alternatively, run
the main() method in BisqGrpcServerMain, where no special option is
required. In either case, you'll notice the following entry in the log
output:
INFO bisq.grpc.BisqGrpcServer: Server started, listening on 8888
2. Now run the main() method in BisqGrpcClient. Once it has started up
you are connected to the gRPC server started in step 1 above. To
exercise the API, type `getVersion` via stdin and hit return. You
should see the following response:
INFO bisq.grpc.BisqGrpcClient - 1.2.4
Likewise, you can type `getBalance` and you'll see the following
response:
INFO bisq.grpc.BisqGrpcClient - 0.00 BTC
and so forth for each of the implemented endpoints. For a list of
implemented endpoints, see BisqGrpcServer.start().
Note once again that the code here is merely a proof of concept and
should not be considered complete or production-ready in any way. In a
subsequent commit, the `--desktopWithGrpcApi` option will be disabled in
order to avoid any potential production use.
The content of this commit is the result of squashing a number of
commits originally authored by chimp1984 in the `chimp1984` fork's `grpc`
branch.
Co-authored-by: Chris Beams <chris@beams.io>
2019-09-18 18:39:37 +02:00
|
|
|
|
2019-11-22 19:39:46 +01:00
|
|
|
configure(project(':daemon')) {
|
|
|
|
mainClassName = 'bisq.daemon.app.BisqDaemonMain'
|
Introduce gRPC API proof of concept
This commit introduces a new `grpc` module including the following key
types:
- BisqGrpcServer: The API implementation itself, along with generated
gRPC Response/Reploy types defined in grpc/src/main/proto/grpc.proto.
- BisqGrpcServerMain: A 'headless' / daemon-like entry point for
running a Bisq node without the JavaFX desktop UI.
- BisqGrpcClient: A simple, repl-style client for the API that allows
the user to exercise the various endpoints as seen in the example
below.
In the `desktop` module, the BisqAppMain class has been modified to
start a BisqGrpcServer instance if the `--desktopWithGrpcApi` option has
been set to `true`.
In the `core` module, a new `CoreApi` class has been introduced
providing a kind of comprehensive facade for all Bisq functionality to
be exposed via the RPC API.
How to explore the proof of concept:
1. Run the main() method in BisqAppMain providing
`--desktopWithGrpcApi=true` as a program argument or alternatively, run
the main() method in BisqGrpcServerMain, where no special option is
required. In either case, you'll notice the following entry in the log
output:
INFO bisq.grpc.BisqGrpcServer: Server started, listening on 8888
2. Now run the main() method in BisqGrpcClient. Once it has started up
you are connected to the gRPC server started in step 1 above. To
exercise the API, type `getVersion` via stdin and hit return. You
should see the following response:
INFO bisq.grpc.BisqGrpcClient - 1.2.4
Likewise, you can type `getBalance` and you'll see the following
response:
INFO bisq.grpc.BisqGrpcClient - 0.00 BTC
and so forth for each of the implemented endpoints. For a list of
implemented endpoints, see BisqGrpcServer.start().
Note once again that the code here is merely a proof of concept and
should not be considered complete or production-ready in any way. In a
subsequent commit, the `--desktopWithGrpcApi` option will be disabled in
order to avoid any potential production use.
The content of this commit is the result of squashing a number of
commits originally authored by chimp1984 in the `chimp1984` fork's `grpc`
branch.
Co-authored-by: Chris Beams <chris@beams.io>
2019-09-18 18:39:37 +02:00
|
|
|
|
|
|
|
dependencies {
|
|
|
|
compile project(':core')
|
|
|
|
compileOnly "org.projectlombok:lombok:$lombokVersion"
|
|
|
|
compileOnly "javax.annotation:javax.annotation-api:1.2"
|
|
|
|
annotationProcessor "org.projectlombok:lombok:$lombokVersion"
|
|
|
|
}
|
|
|
|
}
|