* wip-cbeams: (24 commits)
Allow configurability of bitcoin network with --bitcoin.network
Eliminate BootstrapNodes#DIGITAL_OCEAN_1_DEV
Move comments regarding default ports to Node#DEFAULT_PORT
Rename BootstrapNodes#{DEFAULT_BOOTSTRAP_NODE=>DEFAULT}
Rename app.cli.{SeedNode => BootstrapNode}
Remove dead code from UtilsDHT2.java
Remove commented code from SeedNode
Remove obsolete SeedNodeForTesting class
Rename networkInterface => interface
Eliminate the option to use TomP2P disk storage (for now)
Expose --port command-line option
Rename Node#{id => name}
Allow command-line configuration of local node id and port
Polish whitespace
Qualify id, ip and port options with 'bootstrap.node.*'
Extract clientPort constant
Introduce NETWORK_INTERFACE_UNSPECIFIED contstant
Move {MessageModule=>TomP2PMessageModule}#NETWORK_INTERFACE_KEY
Use extracted NETWORK_INTERFACE_KEY consistently
Polish TomP2PMessageModule#doConfigure
...
Conflicts:
src/test/java/io/bitsquare/msg/TomP2PTests.java
Instead of including testing-related bootstrap nodes in the
BootstrapNodes class, this change introduces a Node#withPort method that
allows for obtaining a copy of an existing bootstrap node (e.g.
DIGITAL_OCEAN_1) with a modified port value.
This approach to `with*` methods allows for convenient customization of
value types without sacrificing immutability. See [1] for details.
[1]: http://blog.joda.org/2014/03/valjos-value-java-objects.html
With this commit we're now using the naming "bootstrap node" everywhere
as opposed to the more fuzzy notion of "seed node" (which was originally
borrowed from Bitcoin Core, but doesn't really describe what we're up to
very well.
As it turns out, Kademlia also uses the terminology "bootstrap node" [1], so
we're in good company with this change.
[1]: https://en.wikipedia.org/wiki/Kademlia#Joining_the_network
In practice we always use TomP2P's in-memory storage. Eliminate the
useDiskStorage option for now, in order to simplify the ongoing
refactoring efforts.
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`.
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.
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.
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.
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.