Skip to content

Commit

Permalink
Rename properties used to configure mempool hostnames
Browse files Browse the repository at this point in the history
  • Loading branch information
cbeams committed May 11, 2020
1 parent c79bf3e commit 7064f0f
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -50,13 +50,13 @@ abstract class MempoolFeeRateProvider extends FeeRateProvider {
private static final int DEFAULT_MAX_BLOCKS = 2;
private static final int DEFAULT_REFRESH_INTERVAL = 2;

// Keys of properties defining the available API endpoints. To enable them, simply
// uncomment and adjust the corresponding lines in application.properties
private static final String API_ENDPOINT_HOSTNAME_KEY_1 = "service.mining.feeEstimate.apiEndpointHostname.1";
private static final String API_ENDPOINT_HOSTNAME_KEY_2 = "service.mining.feeEstimate.apiEndpointHostname.2";
private static final String API_ENDPOINT_HOSTNAME_KEY_3 = "service.mining.feeEstimate.apiEndpointHostname.3";
private static final String API_ENDPOINT_HOSTNAME_KEY_4 = "service.mining.feeEstimate.apiEndpointHostname.4";
private static final String API_ENDPOINT_HOSTNAME_KEY_5 = "service.mining.feeEstimate.apiEndpointHostname.5";
// Keys of properties defining the available Mempool API endpoints. To enable them,
// simply uncomment and adjust the corresponding lines in application.properties
private static final String MEMPOOL_HOSTNAME_KEY_1 = "bisq.price.mining.providers.mempoolHostname.1";
private static final String MEMPOOL_HOSTNAME_KEY_2 = "bisq.price.mining.providers.mempoolHostname.2";
private static final String MEMPOOL_HOSTNAME_KEY_3 = "bisq.price.mining.providers.mempoolHostname.3";
private static final String MEMPOOL_HOSTNAME_KEY_4 = "bisq.price.mining.providers.mempoolHostname.4";
private static final String MEMPOOL_HOSTNAME_KEY_5 = "bisq.price.mining.providers.mempoolHostname.5";

private static final RestTemplate restTemplate = new RestTemplate();

Expand Down Expand Up @@ -154,63 +154,63 @@ protected String getMempoolApiHostname() {
// application.properties file, then it defaults to mempool.space
// This ensures there is at least one provider attempting to connect,
// even if the properties file is corrupt or empty
return env.getProperty(API_ENDPOINT_HOSTNAME_KEY_1, "mempool.space");
return env.getProperty(MEMPOOL_HOSTNAME_KEY_1, "mempool.space");
}
}

@Component
@Order(2)
@ConditionalOnProperty(name = API_ENDPOINT_HOSTNAME_KEY_2)
@ConditionalOnProperty(name = MEMPOOL_HOSTNAME_KEY_2)
public static class Second extends MempoolFeeRateProvider {

public Second(Environment env) {
super(env);
}

protected String getMempoolApiHostname() {
return env.getProperty(API_ENDPOINT_HOSTNAME_KEY_2);
return env.getProperty(MEMPOOL_HOSTNAME_KEY_2);
}
}

@Component
@Order(3)
@ConditionalOnProperty(name = API_ENDPOINT_HOSTNAME_KEY_3)
@ConditionalOnProperty(name = MEMPOOL_HOSTNAME_KEY_3)
public static class Third extends MempoolFeeRateProvider {

public Third(Environment env) {
super(env);
}

protected String getMempoolApiHostname() {
return env.getProperty(API_ENDPOINT_HOSTNAME_KEY_3);
return env.getProperty(MEMPOOL_HOSTNAME_KEY_3);
}
}

@Component
@Order(4)
@ConditionalOnProperty(name = API_ENDPOINT_HOSTNAME_KEY_4)
@ConditionalOnProperty(name = MEMPOOL_HOSTNAME_KEY_4)
public static class Fourth extends MempoolFeeRateProvider {

public Fourth(Environment env) {
super(env);
}

protected String getMempoolApiHostname() {
return env.getProperty(API_ENDPOINT_HOSTNAME_KEY_4);
return env.getProperty(MEMPOOL_HOSTNAME_KEY_4);
}
}

@Component
@Order(5)
@ConditionalOnProperty(name = API_ENDPOINT_HOSTNAME_KEY_5)
@ConditionalOnProperty(name = MEMPOOL_HOSTNAME_KEY_5)
public static class Fifth extends MempoolFeeRateProvider {

public Fifth(Environment env) {
super(env);
}

protected String getMempoolApiHostname() {
return env.getProperty(API_ENDPOINT_HOSTNAME_KEY_5);
return env.getProperty(MEMPOOL_HOSTNAME_KEY_5);
}
}

Expand Down
10 changes: 5 additions & 5 deletions pricenode/src/main/resources/application.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ spring.jackson.serialization.indent_output=true

# To enable another fee estimation endpoint, simply uncomment one of the following lines
# and set it to hostname exposing the fee estimation API
service.mining.feeEstimate.apiEndpointHostname.1=mempool.space
service.mining.feeEstimate.apiEndpointHostname.2=mempool.emzy.de
# service.mining.feeEstimate.apiEndpointHostname.3=someHostOrIP
# service.mining.feeEstimate.apiEndpointHostname.4=someHostOrIP
# service.mining.feeEstimate.apiEndpointHostname.5=someHostOrIP
bisq.price.mining.providers.mempoolHostname.1=mempool.space
bisq.price.mining.providers.mempoolHostname.2=mempool.emzy.de
# bisq.price.mining.providers.mempoolHostname.3=someHostOrIP
# bisq.price.mining.providers.mempoolHostname.4=someHostOrIP
# bisq.price.mining.providers.mempoolHostname.5=someHostOrIP

0 comments on commit 7064f0f

Please sign in to comment.