Commit Graph

618 Commits

Author SHA1 Message Date
Chris Beams
162fc3da0e
Favor use of Properties vs. for configuration
This reverts a number of changes made in commit 3033a19. Primary changes
include:

 - Restoring the immutability of the Node class

 - The argparse4j Namespace object is no longer passed down through
   Guice modules

 - Instead, arguments are eagerly read from the Namespace object by the
   #main method and these values are used to populate the Properties
   object that is already supplied to each Guice module

Other changes include:

 - The addition of a BootstrapNodes#DEFAULT_BOOTSTRAP_NODE field as
   a convenient alias to BootstrapNodes#DIGITAL_OCEAN_1 (or whatever the
   future default bootstrap node may be)

 - A Node#getPortAsString method has been added for convenience when
   dealing with String-based properties

 - A variant of the Node#at static factory method has been added which
   accepts the port value as a String vs. an int--again this is for
   convenience when dealing with String-based properties

 - Tests have been added to NodeTests to reflect the above
2014-11-09 23:14:46 +01:00
Chris Beams
017ebb3f38
Polish whitespace
Run "Reformat code" and "Optimize Imports" from within IDEA, cleaning up
trailing whitespace and other issues.
2014-11-09 23:10:58 +01:00
Chris Beams
dfbe6973e7
Split Gradle arguments on comma vs. spaces
Prior to this commit, Gradle was configured to take a -Pargs property
and split the value on whitespace, passing the result to the Gradle
application plugin's 'args' property, for example:

    gradle run -Pargs="--id=foo --ip=1.1.1.1 --port=10001"

While this approach works fine when passing a single argument (i.e. when
no space delimiters are required), when multiple arguments are passed,
such as in the example above, it would result in the following error
from Gradle's own command line parser:

    Unknown command-line option '--ip'

This commit simply splits the value of -Pargs on commas rather than
spaces, meaning that now multiple -Pargs values should be supplied as
follows:

    gradle run -Pargs="--id=foo,--ip=1.1.1.1,--port=10001"

Resolves #264
2014-11-09 23:09:15 +01:00
Manfred Karrer
c12b94b7c2 Use peerNoVerification 2014-11-09 14:14:42 +01:00
Manfred Karrer
5d5fd49a45 Update to latest TomP2P master 2014-11-09 13:48:24 +01:00
Manfred Karrer
4938f0ba4a Change ip flag to s to avoid conflict with other flags 2014-11-08 16:42:36 +01:00
Manfred Karrer
4440bf1007 Add basic SeedNode class, rename previous one to SeedNodeUsingAkka 2014-11-08 16:39:21 +01:00
Manfred Karrer
d9372383bf Fix test 2014-11-08 16:38:09 +01:00
Manfred Karrer
3033a19b46 Change default port, Add ip to args, pass namespace to messageModule 2014-11-08 16:28:49 +01:00
Manfred Karrer
d72d7299df Add missing RepeatRule, Simplify SeedNodeForTesting 2014-11-07 18:33:59 +01:00
Manfred Karrer
8cfdf1907e Use server seed node and testnet 2014-11-07 18:28:43 +01:00
Manfred Karrer
232a208a03 Revert to 0.12 as 0.12.1 has changes in the Coin class 2014-11-07 17:28:59 +01:00
Manfred Karrer
222cda53d1 Add IPv4 filter 2014-11-07 16:07:13 +01:00
Manfred Karrer
182218612e Update to bitcoinJ 12.1 2014-11-07 16:04:56 +01:00
Manfred Karrer
9e69822a40 Improve Splash screen info, Refactor WalletFacade (user executor, gui defines Platform.runlater as executor) 2014-11-07 16:03:14 +01:00
Manfred Karrer
7dd61b35f6 Use Localhost 2014-11-07 13:47:55 +01:00
Manfred Karrer
089be0ca16 Use compatible version with latest TomP2P lib 2014-11-07 00:58:24 +01:00
Manfred Karrer
7049ab3a78 Fix broken preferences path 2014-11-07 00:17:21 +01:00
Chris Beams
5d56dc62c9
Merge branch 'wip-cbeams'
Additional changes during the process of isolating TomP2P. High-level
changes include:

 - Beginning to break up the monolithic MessageFacade into modular
   repository classes, starting with the OfferRepository interface and
   its TomP2P implementation

 - Major refactoring of the CreateOfferCoordinator class, eliminating
   the never-completely-implemented resume logic. This class still needs
   quite a bit of work, but it's now considerably simpler than it was

 - Refactoring the Node and BootstrapNode types for greater clarity and
   ease of use

 - Most classes that use the net.tomp2p API have been moved into tomp2p
   subpackages, e.g. io.bitsquare.offer.tomp2p. Classes within have been
   made package private wherever possible.

 - The Guice module structure has evolved. For example, note the
   relationship between offer.OfferModule and offer.tomp2p.TomP2POfferModule,
   and note how the latter is consumed by app.AppModule. This arrangement
   provides for clear contracts as to what is required to assemble a
   functioning Bitsquare application, while allowing implementation-specific
   modules to be swapped in and out with ease and still allowing
   implementation-specific classes to remain package-private.

See extended commit comments for further details.

* wip-cbeams:
  Rename io.bitsquare.{Abstract=>}BitsquareModule
  Move io.bitsquare.{network=>util}.tomp2p.BaseFutureUtil
  Introduce app.gui.MainModule
  Optimize imports
  Introduce io.bitsquare.msg.tomp2p package
  Introduce io.bitsquare.offer.tomp2p package
  Extract isSuccess(BaseFuture) method into util class
  Remove offer creation recovery from CreateOfferCoordinator
  Remove unused MessageFacade from CreateOfferCoordinator
  Inline BroadCastOfferFeeTx#run into CreateOfferCoordinator
  Inline CreateOfferFeeTx#run into CreateOfferCoordinator
  Replace VerifyOffer class with Offer#validate method
  Inline CreateOfferCoordinator#onFailed
  Rename methods used to implement *Handler lambdas
  Rename *Handler methods
  Move generic *Handler types to new util.task package
  Replace AddOfferListener Result/Fault handlers
  Introduce OfferRepository interface and TomP2P impl
2014-11-06 17:05:01 +01:00
Chris Beams
ca070941dc
Rename io.bitsquare.{Abstract=>}BitsquareModule 2014-11-06 16:58:29 +01:00
Chris Beams
1546285b8b
Move io.bitsquare.{network=>util}.tomp2p.BaseFutureUtil 2014-11-06 16:58:28 +01:00
Chris Beams
486cd9824e
Introduce app.gui.MainModule 2014-11-06 16:58:23 +01:00
Chris Beams
21098afd45
Optimize imports 2014-11-06 16:58:22 +01:00
Chris Beams
96fa93f608
Introduce io.bitsquare.msg.tomp2p package 2014-11-06 16:58:20 +01:00
Chris Beams
467f76fd76
Introduce io.bitsquare.offer.tomp2p package 2014-11-06 16:57:42 +01:00
Chris Beams
57f2b43845
Extract isSuccess(BaseFuture) method into util class 2014-11-06 16:57:41 +01:00
Manfred Karrer
1dde1f361f Use compatible version with latest TomP2P lib 2014-11-06 16:43:09 +01:00
Manfred Karrer
e4743ca469 Merge remote-tracking branch 'origin/master' 2014-11-06 16:41:28 +01:00
Manfred Karrer
7faff2d244 Use latest TomP2P verison 2014-11-06 16:41:22 +01:00
Chris Beams
000302d29e
Merge branch 'master'
Conflicts:
	src/main/java/io/bitsquare/gui/main/trade/offerbook/OfferBook.java
	src/main/java/io/bitsquare/msg/TomP2PMessageFacade.java
2014-11-06 14:32:31 +01:00
Chris Beams
e201bf88ce
Rename i.b.network.{BootstrapNode=>BootstrapNodes} 2014-11-06 14:00:36 +01:00
Chris Beams
36b3b82e52
Refactor Node from interface to value type
The modeling of BootstrapNode as an enum implementing the Node interface
became awkward, requiring an ugly, package-private 'NodeImpl' class and
other problems.

This change eliminates NodeImpl, refactors Node from being an interface
to being a value type [1,2], and refactors BootstrapNode from being an
enum to being an interface (the #all method there takes the place of
what was the enum's inherited #values method). This is slightly more
verbose in the end than being modeled as an enum, but in the end, we
were never using BootstrapNode as an enum (e.g., never used in switch
statements or == equality comparisons, etc).

[1]: http://blog.joda.org/2014/03/valjos-value-java-objects.html
[2]: http://docs.oracle.com/javase/8/docs/api/java/lang/doc-files/ValueBased.html
2014-11-06 13:52:59 +01:00
Chris Beams
640a736ec3
Repeat TomP2PTests tests using @Repeat vs. loops 2014-11-06 13:17:54 +01:00
Chris Beams
1a92b05bf4
Introduce @Repeat and RepeatRule for repeatable @Test methods
With thanks to original author Frank Appel (@fappel)

See:
 - https://gist.github.com/fappel/8bcb2aea4b39ff9cfb6e
 - http://www.codeaffine.com/2013/04/10/running-junit-tests-repeatedly-without-loops/
2014-11-06 13:17:28 +01:00
Chris Beams
8b6f0ac64e
Refactor TomP2PTests
- Introduce use of Node abstraction for concision
 - Use to BootstrapNode#LOCALHOST and #DIGITAL_OCEAN1 vs. repeating info
 - Make all configuration variables static and final constants
2014-11-06 13:17:28 +01:00
Chris Beams
655100e69f
Introduce Node#at static factory and NodeTests 2014-11-06 11:25:52 +01:00
Chris Beams
1f136de1a1
Apply consistent style to argument help text 2014-11-06 11:25:51 +01:00
Chris Beams
da163bcc97
Introduce io.bitsquare.network.Node#DEFAULT_PORT 2014-11-06 11:25:51 +01:00
Chris Beams
ce5155ebdc
Rename BootstrapNode#{LOCAL_HOST => LOCALHOST} 2014-11-06 11:24:31 +01:00
Chris Beams
1ea30fb4ae
Clarify concept of 'default network' in BitcoinModule 2014-11-06 11:24:31 +01:00
Manfred Karrer
c7524edef3 Add bootstrap info to splash screen, user final wehn possible, cleanup 2014-11-06 09:21:53 +01:00
Chris Beams
aeaef72834
Remove offer creation recovery from CreateOfferCoordinator
Recovery was never fully implemented, and removing it dramatically
simplifies things. We can return to this with a proper analysis of
finite state machine libraries when the time comes.
2014-11-06 08:43:38 +01:00
Chris Beams
72423dce8a
Remove unused MessageFacade from CreateOfferCoordinator 2014-11-06 08:43:38 +01:00
Chris Beams
40d7da8d10
Inline BroadCastOfferFeeTx#run into CreateOfferCoordinator 2014-11-06 08:43:38 +01:00
Chris Beams
2adac9475e
Inline CreateOfferFeeTx#run into CreateOfferCoordinator 2014-11-06 08:43:37 +01:00
Chris Beams
7fffa81f02
Replace VerifyOffer class with Offer#validate method 2014-11-06 08:43:37 +01:00
Chris Beams
b3670c5201
Inline CreateOfferCoordinator#onFailed 2014-11-06 08:43:36 +01:00
Chris Beams
45a4bf7c09
Rename methods used to implement *Handler lambdas 2014-11-06 08:43:36 +01:00
Chris Beams
44dc76e07e
Rename *Handler methods 2014-11-06 08:43:36 +01:00
Chris Beams
f72bdf5f71
Move generic *Handler types to new util.task package 2014-11-06 08:43:35 +01:00