3
0
mirror of https://github.com/Qortal/altcoinj.git synced 2025-01-30 23:02:15 +00:00

Correct maven instruction in the README file and make ForwardingService work on mainnet again by fixing command line arg parsing.

Resolves issue 523.
This commit is contained in:
Mike Hearn 2014-03-10 17:36:32 +01:00
parent 8229daf38d
commit 829656b153
2 changed files with 8 additions and 5 deletions

7
README
View File

@ -11,10 +11,13 @@ find your unzipped Maven install directory.
Now try running one of the example apps:
cd examples
mvn exec:java -Dexec.mainClass=com.google.bitcoin.examples.ForwardingService <insert a bitcoin address here>
mvn exec:java -Dexec.mainClass=com.google.bitcoin.examples.ForwardingService -Dexec.args="<insert a bitcoin address here>"
It will download the block chain and eventually print a Bitcoin address. If you send coins to it,
it will forward them on to the address you specified.
it will forward them on to the address you specified. Note that this example app does not use
checkpointing, so the initial chain sync will be pretty slow. You can make an app that starts up and
does the initial sync much faster by including a checkpoints file; see the documentation for
more info on this.
Now you are ready to follow the tutorial:

View File

@ -43,7 +43,7 @@ public class ForwardingService {
public static void main(String[] args) throws Exception {
// This line makes the log output more compact and easily read, especially when using the JDK log adapter.
BriefLogFormatter.init();
if (args.length < 2) {
if (args.length < 1) {
System.err.println("Usage: address-to-send-back-to [regtest|testnet]");
return;
}
@ -51,10 +51,10 @@ public class ForwardingService {
// Figure out which network we should connect to. Each one gets its own set of files.
NetworkParameters params;
String filePrefix;
if (args[1].equals("testnet")) {
if (args.length > 1 && args[1].equals("testnet")) {
params = TestNet3Params.get();
filePrefix = "forwarding-service-testnet";
} else if (args[1].equals("regtest")) {
} else if (args.length > 1 && args[1].equals("regtest")) {
params = RegTestParams.get();
filePrefix = "forwarding-service-regtest";
} else {