Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Tor testNetwork option to typesafe config #1119

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions desktop_app/src/main/resources/desktop.conf
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ application {
socketTimeout = 120
}
tor {
testNetwork = false
directoryAuthorities = []
torrcOverrides = {}
socketTimeout = 120
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ public class TorTransport implements Transport {
public static final class Config implements Transport.Config {
public static Config from(String baseDir, com.typesafe.config.Config config) {
return new Config(
config.getBoolean("testNetwork"),
baseDir,
(int) TimeUnit.SECONDS.toMillis(config.getInt("socketTimeout")),
parseDirectoryAuthorities(config.getList("directoryAuthorities")),
Expand Down Expand Up @@ -78,12 +79,18 @@ private static String getStringFromConfigValue(ConfigValue configValue, String k
.unwrapped();
}

private final boolean isTestNetwork;
private final int socketTimeout;
private final String baseDir;
private final Set<DirectoryAuthority> directoryAuthorities;
private final Map<String, String> torrcOverrides;

public Config(String baseDir, int socketTimeout, Set<DirectoryAuthority> directoryAuthorities, Map<String, String> torrcOverrides) {
public Config(boolean isTestNetwork,
String baseDir,
int socketTimeout,
Set<DirectoryAuthority> directoryAuthorities,
Map<String, String> torrcOverrides) {
this.isTestNetwork = isTestNetwork;
this.baseDir = baseDir;
this.socketTimeout = socketTimeout;
this.directoryAuthorities = directoryAuthorities;
Expand Down
1 change: 1 addition & 0 deletions oracle_node_app/src/main/resources/oracle_node.conf
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ application {
socketTimeout = 120
}
tor {
testNetwork = false
directoryAuthorities = []
torrcOverrides = {}
socketTimeout = 120
Expand Down
1 change: 1 addition & 0 deletions rest_api_app/src/main/resources/rest_api.conf
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ application {
socketTimeout = 120
}
tor {
testNetwork = false
torrcOverrides = {}
socketTimeout = 120
}
Expand Down
1 change: 1 addition & 0 deletions seed_node_app/src/main/resources/seed_node.conf
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ application {
socketTimeout = 120
}
tor {
testNetwork = false
directoryAuthorities = []
torrcOverrides = {}
socketTimeout = 120
Expand Down