This does the work that was intended to be done in commit
175e11d81c, but was done by first removing
the dependencyVerification block entirely, and then replacing it with
the output of the `calculateChecksums` task.
The entire process went like this:
1. Remove existing dependencyVerification block from build.gradle
2. Run `./gradlew -q calculateChecksums | grep -v network.bisq:bisq- >> build.gradle`
3. Run `git diff` to see that only the checksums we expect to have
changed have in fact changed (libdohj and bitcoinj in this case).
4. Commit the changes (in this commit)
I'll update the instructions for the dependencyVerification block in a
subsequent commit to make this clearer in the future.
The calculated checksum from the calculateChecksums task did not
reflect updates of libdohj and bitcoinj.
libdohj is a dependency in common but seems the calculateChecksums task
in desktop did not resolve that correctly. It did not change the
checksum after the libdohj version has changed and led to build errors.
Adding the libdohj dependency in Desktop as well solves the issue.
@bceams: If there is a better solution to solve that feel free to
revert and apply....
Setting this value to `false` was a minor optimization to improve build
speed, as we don't need both tar and zip dists to be built (and zip
actually takes a few seconds).
PR #1500 set it to `true`, because it ended up causing build failures
down the road. This commit removes the statement altogether, as `true`
is the default value anyway.
Recent changes to dependencyVerification got committed with 8-space
indentation, causing a diff for the whole block. This reverts it to
4-space, which is what is generated by `gradle -q calculateChecksums`.
It doesn't actually work to build fat executable jars because we always
have bouncycastle jars that need to exist outside of the fat jar. This
change drops building fat jars altogether in favor of using Gradle's
built-in `application` plugin to write simple scripts that invoke java
with the correct classpath against a directory of all dependencies
(including bouncycastle) without the need to have a fat jar in the mix.
Essentially, you should now run:
./gradlew build
./build/app/bin/bisq-desktop [options]
Instead of `java -jar build/libs/bisq-desktop.jar`.
See updated doc/build.md for details.
For reasons detailed in bisq-network/bisq-p2p@b1528bf3.
This change also regenerates the `dependencyVerification` block, which
is necessary in any case after the upgrade of tor binaries, but note
especially that for unknown reasons, commenting out certain dependencies
items is now no longer necessary as it was in commit
53a9009b06.
Problem: The dependency commented out in this commit, when left
uncommented cause any Gradle composite build that includes this
(`bisq-desktop`) build to fail with, for example, the following error:
No dependency for integrity assertion found:
com.github.bisq-network.libdohj:libdohj-core
Solution: Comment them out until someone can dig into the gradle-witness
plugin, figure out why these specific entries cause these failures, and
fix it. Note that the commented entries work as expected when this
Gradle build is used outside the context of a composite build.
This commit is *not* a complete re-working of the scripts under package,
but is rather just enough of a re-working of the
package/osx/create_app.sh script to verify that the new Gradle build
creates a suitable fat executable jar for use in this script.
These changes have been tested with the following commands:
cd package/osx
./create_app.sh
open ../../deploy/Bisq-0.6.7.dmg
Then double-clicking the Bisq icon from the mounted DMG. Bisq starts up
as expected, without errors.
Further work will be required to update the package/osx/finalize.sh
script as well as the package/linux/ and package/windows/ scripts prior
to the next (0.7.0) release. For now, however, enough work has been done
to verify that the Gradle build creates the fat jar these scripts need.
This performs the same function that the maven-enforcer-plugin did in
the pom removed by the previous commit, and also includes a more
comprehensive / up-to-date set of dependencies.
Note that the gradle-witness jar checked in here is one built from the
pull request in signalapp/gradle-witness#26.
Note that this has not been thoroughly tested and, in particular, my router does not support UPnP so I've only been able to test with --node.useManualPortForwarding=true The project does compile and run successfully though. With manual port forwarding I'm able to connect to the p2p network and view open offers successfully.
Significant changes in the way that controllers and models interact with
backend services. Most important is the introduction of RxJava's
Observable. See individual commit comments for details.
Conflicts were minor, mainly dealing with the fact that MainPM had been
modified in master, but removed completely on the 'cbeams' branch. All
changes have been preserved by carrying them over to MainModel.
* cbeams:
Improve service initialization coordination using rx.Observable
Redesign controller/model types and apply to gui.main.Main*
Conflicts:
build.gradle
src/main/java/io/bitsquare/btc/WalletService.java
src/main/java/io/bitsquare/gui/main/MainPM.java
src/main/java/io/bitsquare/msg/tomp2p/TomP2PNode.java
This change introduces the use of RxJava's Observable [1] to redesign
how we work with non-deterministic and/or event-based information, such
as: connecting to peer-to-peer infrastructure, synchronizing the bitcoin
blockchain, and so on.
Prior to this commit, these activities were initiated in methods like
WalletService#initialize and TomP2PMessageService#init. These methods
accepted 'listener' interfaces, and these listeners' callback methods
would be invoked whenever work progressed, completed, or failed.
This approach required significant coordination logic, which, prior to
this commit, was found primarily in MainModel#initBackend. A primary
goal of the logic found here was to determine when the backend was
"ready". This state was represented in MainModel's `backendReady` field,
which would be set to true once the following three conditions were
satisfied:
1. the message service had finished initialization
2. the wallet service had finished initialization, and
3. the blockchain synchronization had reached 100%
Monitoring these three states was complex, and required hard-to-follow
conditional logic spread across a number of locations in the code. In
any case, however, once these three conditions were satisfied and
backendReady's value was set to true, a listener on the backendReady
field (in MainViewCB#doInitialize) would then populate combo boxes and
pending trade counts in the main view and cause the splash screen to
fade out, rendering the application ready for user interaction.
The introduction of rx.Observable is designed to achieve the same
show-the-splash-screen-until-everything-is-ready functionality described
above, without the complex monitoring, conditional logic and nested
callbacks. This is achieved by modeling each process as an Observable
stream of events. Observables in RxJava can emit any number of events,
and can complete either normally or with an error.
These observables may be 'subscribed' to by any number of subscribers,
and events emitted can be acted upon by instructing the subscriber what
to do `onNext`, `onCompleted`, and `onError`. So for example
WalletService now exposes an Observable<Double> called bootstrapState.
This Observable is subscribed to in MainModel#initBackend in such a way
that every time it emits a new double value (i.e. a new percentage), the
various bootstrap state text labels and progress indicators are updated
accordingly.
Where it gets really interesting, however, is when Observables are
combined. The primary complexity described above is coordinating the
fading out of the splash screen with the completed initialization of all
backend services. As can now be seen in MainModel#initBackend, the
wallet service and message service Observables are simply "merged" into
a single observable and returned. From the MainViewCB side, this "single
backend observable" is subscribed to and, when it completes (i.e. when
all the underlying Observables complete), then combo boxes and pending
trade counts are populated and the splash screen is faded out.
Understanding RxJava, Observables, and the principles of "Functional
Reactive Programming" takes time. It is a paradigm shift in dealing with
concurrency and non-determinism, but one that ultimately rewards those
who take the time. In the end, I believe it's use will result in a
significantly more concise and robust internal architecture for
Bitsquare, and using RxJava's lightweight, well-adopted and
infrastructure-agnostic API leaves us open to using Akka or other more
sophisticated infrastructure later without tying ourselves to those
specific APIs (because virtually anything can be modeled as an
Observable). Achieve these benifits means that core committers will need
to understand how RxJava works, how to think about it, and how to design
using it. I have spent the better part of the last week getting to know
it, and I am certainly still learning. I can recommend many resources to
aid in this process, but having gone through it myself, I recommend that
everyone read at least [1] and [2] first.
[1]: https://github.com/ReactiveX/RxJava/wiki/Observable
[2]: [The introduction to Reactive Programming you've been
missing](https://gist.github.com/staltz/868e7e9bc2a7b8c1f754)
The build now exposes two explicit ShadowJar tasks: one for the main
JavaFX client (`appJar`) and one for the headless bootstrap node
(`bootstrapNodeJar`).
Run as follows:
./gradlew appJar
-- or --
./gradlew bootstrapNodeJar
The resulting executable jar for each will be found in the `build/libs`
directory.
Thanks to @johnrengleman for his help at johnrengelman/shadow#108
Resolves#265Resolves#252