Commit Graph

753 Commits

Author SHA1 Message Date
Chris Beams
117b4ce5dc
Remove dead code from UtilsDHT2.java 2014-11-10 15:04:42 +01:00
Chris Beams
519cfb8957
Remove commented code from SeedNode 2014-11-10 15:04:41 +01:00
Chris Beams
879ff57789
Remove obsolete SeedNodeForTesting class 2014-11-10 15:04:41 +01:00
Chris Beams
a56ac8e454
Rename networkInterface => interface
i.e., pass `--interface` vs. `--networkInterface` at the command line.
2014-11-10 15:04:41 +01:00
Chris Beams
396fd089ca
Eliminate the option to use TomP2P disk storage (for now)
In practice we always use TomP2P's in-memory storage. Eliminate the
useDiskStorage option for now, in order to simplify the ongoing
refactoring efforts.
2014-11-10 15:04:40 +01:00
Chris Beams
737d1855d1
Expose --port command-line option 2014-11-10 15:04:26 +01:00
Chris Beams
3398a97311
Rename Node#{id => name}
Refer to the "name" of a node rather than its "id". This is reflected in
the command line options as well. Instead of `--id`, now pass `--name`.
Instead of `--bootstrap.node.id`, now pass `--bootstrap.node.id`.
2014-11-10 14:34:30 +01:00
Manfred Karrer
7ccfd98fb9 Allow shutting down the app with window close/quit 2014-11-10 13:51:10 +01:00
Manfred Karrer
865fe73bfb Remove random ports and static ID 2014-11-10 13:17:06 +01:00
Chris Beams
2ae5949448
Allow command-line configuration of local node id and port
This change does away with the notion of "clientPort" and replaces it,
simply, with "port". There are only two ports we care about in
Bitsquare:

 1. The port that the local node (i.e. a Bitsquare UI running on
    your laptop) listens on. This value is now specified with `--port`

 2. The port of the bootstrap node that the local node will connect to on
    its first run. This value is specified with `--bootstrap.node.port`

So, for example, the following is a valid commandline invocation:

    java -jar bitsquare.jar --port 1234 --bootstrap.node.port=9876

Both of these values default to Node.DEFAULT_PORT (currently 7366)

This commit also introduces the --id flag for configuring the ID of the
local node.
2014-11-10 13:05:14 +01:00
Chris Beams
cb0e214a28
Polish whitespace 2014-11-10 13:04:55 +01:00
Chris Beams
9ddf075366
Qualify id, ip and port options with 'bootstrap.node.*'
This change clarifies the relationship between the Bitsquare node that
is being run (the local node) and the Bitsquare node that the local node
is being bootstrapped against (the bootstrap node).

Prior to this change, customizing bootstrap node looked like this:

    java -jar bitsquare.jar --ip=203.0.113.3

Now it looks like this:

    java -jar bitsquare.jar --bootstrap.node.ip=203.0.113.3

This change also removes entirely the short option strings (-d, -s, -p,
-i) for simplicity and clarity while these values are undergoing change.

By qualifying bootstrap node options explicitly in this fashion, we make
way for customizing the the same values against the local node. These
changes will come with subsequent commits.
2014-11-10 13:04:55 +01:00
Chris Beams
bad88f1612
Extract clientPort constant 2014-11-10 13:04:52 +01:00
Chris Beams
85f5f02378
Introduce NETWORK_INTERFACE_UNSPECIFIED contstant
Use an explicit value of "<unspecified>" vs. empty string ("") for
clarity when the user has not specified a network interface to use.
2014-11-10 13:04:04 +01:00
Chris Beams
ed76f73897
Move {MessageModule=>TomP2PMessageModule}#NETWORK_INTERFACE_KEY
This change moves the NETWORK_INTERFACE_KEY into
BootstrappedPeerFactory, where it is actually used, but because
BootstrappedPeerFactory is package-private and has no other reason to be
public, NETWORK_INTERFACE_KEY is re-exposed publicly through
TomP2PMessageModule, where it can be used by types in the
io.bitsquare.app* packages.
2014-11-10 13:03:40 +01:00
Chris Beams
9e00c3d85e
Use extracted NETWORK_INTERFACE_KEY consistently 2014-11-10 08:49:50 +01:00
Chris Beams
7e3c53ac24
Polish TomP2PMessageModule#doConfigure 2014-11-10 08:49:46 +01:00
Chris Beams
8723e9ef0d
Move {MessageModule=>TomP2PMessageModule}#BOOTSTRAP_NODE_*_KEY 2014-11-10 08:26:56 +01:00
Chris Beams
9bdb4b4249
Move {MessageModule=>BootstrappedPeerFactory}#BOOTSTRAP_NODE_KEY 2014-11-10 08:20:15 +01:00
Chris Beams
426ee28b93
Extract TomP2PNode#USE_DISK_STORAGE_KEY constant 2014-11-10 08:09:28 +01:00
Chris Beams
9f2e9de94f
Extract MessageModule.BOOTSTRAP_NODE_KEY constant 2014-11-10 08:09:18 +01:00
Manfred Karrer
05a86f251f Add interface argument 2014-11-10 02:08:54 +01:00
Manfred Karrer
775a391be3 Add ChannelClientConfiguration 2014-11-10 01:51:25 +01:00
Manfred Karrer
954fb7727c Add bootstrap 2014-11-10 01:48:20 +01:00
Manfred Karrer
501a3ccbc2 Merge remote-tracking branch 'origin/master' 2014-11-10 01:35:17 +01:00
Manfred Karrer
2ec1fe1c59 Sync with Thomas changes, add bootstrap call 2014-11-10 01:35:08 +01:00
Manfred Karrer
c1a645500f Remove caching as it has some side effects for failing tests 2014-11-10 01:10:45 +01:00
Chris Beams
ccc369307c
Use explicit "appName" vs. "name" property
i.e. when running the app, pass

    java -jar bitsquare.jar --appName Alice

vs.

    java -jar bitsquare.jar --name Alice
2014-11-10 01:08:34 +01:00
Chris Beams
e8986aa7a2
Rename NAME_FLAG => APP_NAME_KEY and move to AppModule 2014-11-10 00:50:59 +01:00
Chris Beams
935785e611
Organize imports 2014-11-10 00:44:48 +01:00
Chris Beams
a4cf7a0aeb
Polish whitespace 2014-11-10 00:44:47 +01:00
Chris Beams
18c399b30c
Move bootstrap node config property keys to MessageModule 2014-11-10 00:44:45 +01:00
Chris Beams
20db54e87b
Remove Akka-based seed node infrastructure (for now)
In favor of using the simplified app.cli.SeedNode class while we
continue to debug basic UPnP functionality.
2014-11-10 00:44:17 +01:00
Chris Beams
d062e1dbbf
Remove debug print statement 2014-11-09 23:45:21 +01:00
Chris Beams
b5f95e00a3
Supply appName via properties as well
Like all other command-line options and/or configuration file
properties, appName is now parsed for early in #main and its value
(default or custom) is then used to populate the Properties object made
available to all Guice modules. See the previous commit for additional
details.
2014-11-09 23:42:57 +01:00
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