Commit d797ea08 authored by zeroleak's avatar zeroleak
Browse files

cli args removed: --server --tor --proxy (use configuration file instead)

parent b1683819
......@@ -16,18 +16,12 @@ You can setup whirlpool-client-cli in 2 ways:
```
java -jar target/whirlpool-client-version-run.jar
[--listen[=8899]] [--authenticate]
[--server={MAINNET,TESTNET}] [--tor] [--proxy=(socks|http)://host:port] [--mixs-target=]
[--mixs-target=]
[--debug] [--debug-client] [--pushtx=auto|interactive|http://user:password@host:port] [--scode=] [--tx0-max-outputs=] {args...}
```
#### Optional arguments:
- listen: enable API for remote commands & GUI. Authentication on startup is optional, but you can authenticate on startup with --authenticate
- server: whirlpool server to connect to
- tor: route all traffic to Tor
- proxy: connect through SOCKS/HTTP proxy.
Tor proxy: socks://localhost:9050
Tor Browser: socks://localhost:9150
HTTP proxy: http://your-proxy:8080
- mixs-target: number of mixs to achieve per UTXO
#### Tech arguments: you probably shouldn't use it
......
package com.samourai.whirlpool.cli;
import com.samourai.whirlpool.cli.config.CliConfig;
import com.samourai.whirlpool.client.wallet.beans.WhirlpoolServer;
import java.lang.invoke.MethodHandles;
import java.util.Iterator;
import java.util.Optional;
import java.util.stream.Stream;
import org.apache.commons.lang3.StringUtils;
import org.apache.logging.log4j.util.Strings;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.ApplicationArguments;
......@@ -21,7 +19,6 @@ public class ApplicationArgs {
private static final String ARG_DEBUG = "debug";
private static final String ARG_DEBUG_CLIENT = "debug-client";
private static final String ARG_SERVER = "server";
private static final String ARG_LIST_POOLS = "list-pools";
private static final String ARG_SCODE = "scode";
private static final String ARG_CLIENTS = "clients";
......@@ -33,8 +30,6 @@ public class ApplicationArgs {
private static final String ARG_AUTO_TX0 = "auto-tx0";
private static final String ARG_AUTO_MIX = "auto-mix";
private static final String ARG_PUSHTX = "pushtx";
private static final String ARG_TOR = "tor";
private static final String ARG_PROXY = "proxy";
private static final String ARG_LISTEN = "listen";
private static final String ARG_API_KEY = "api-key";
private static final String ARG_INIT = "init";
......@@ -54,16 +49,6 @@ public class ApplicationArgs {
Boolean valueBool;
Integer valueInt;
value = optionalOption(ARG_SERVER);
if (!Strings.isEmpty(value)) {
java8.util.Optional<WhirlpoolServer> whirlpoolServer = WhirlpoolServer.find(value);
if (whirlpoolServer.isPresent()) {
cliConfig.setServer(whirlpoolServer.get());
} else {
log.error("Invalid server: " + value);
}
}
value = optionalOption(ARG_SCODE);
if (value != null) {
cliConfig.setScode(value);
......@@ -79,16 +64,6 @@ public class ApplicationArgs {
cliConfig.setPushtx(value);
}
valueBool = optionalBoolean(ARG_TOR);
if (valueBool != null) {
cliConfig.setTor(valueBool);
}
value = optionalOption(ARG_PROXY);
if (value != null) {
cliConfig.setProxy(value);
}
valueInt = optionalInt(ARG_CLIENTS);
if (valueInt != null) {
cliConfig.getMix().setClients(valueInt);
......
package com.samourai.whirlpool.client.run;
import com.samourai.whirlpool.cli.Application;
import com.samourai.whirlpool.client.wallet.beans.WhirlpoolServer;
import org.junit.After;
import org.junit.Assert;
import org.junit.Before;
......@@ -17,7 +16,6 @@ import org.springframework.test.context.junit4.SpringRunner;
@SpringBootTest
@Ignore
public class ApplicationTest extends AbstractApplicationTest {
protected static final String SERVER = WhirlpoolServer.LOCAL_TESTNET.name();
@Before
@Override
......@@ -33,7 +31,7 @@ public class ApplicationTest extends AbstractApplicationTest {
@Test
public void runListPools() {
String[] args = new String[] {"--debug", "--server=" + SERVER};
String[] args = new String[] {"--debug"};
ApplicationArguments appArgs = new DefaultApplicationArguments(args);
new Application().run(appArgs);
......@@ -42,6 +40,23 @@ public class ApplicationTest extends AbstractApplicationTest {
Assert.assertTrue(getErr().isEmpty());
}
@Test
public void runApp() {
String[] args =
new String[] {
"--listen", "--authenticate", "--debug-client", "--debug", "--auto-mix", "--clients=5"
};
ApplicationArguments appArgs = new DefaultApplicationArguments(args);
Application.main(args);
// new Application().run(appArgs);
while (true) {
try {
Thread.sleep(100000);
} catch (InterruptedException e) {
}
}
}
@Test
public void runWhirlpool() {
String[] args =
......@@ -54,8 +69,7 @@ public class ApplicationTest extends AbstractApplicationTest {
"--mixs=5",
"--debug",
"--pool=1btc",
"--test-mode",
"--server=" + SERVER
"--test-mode"
};
ApplicationArguments appArgs = new DefaultApplicationArguments(args);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment