|
|
@ -43,7 +43,7 @@ public class NodePermissioningControllerFactory { |
|
|
|
final TransactionSimulator transactionSimulator, |
|
|
|
final TransactionSimulator transactionSimulator, |
|
|
|
final MetricsSystem metricsSystem) { |
|
|
|
final MetricsSystem metricsSystem) { |
|
|
|
|
|
|
|
|
|
|
|
Optional<SyncStatusNodePermissioningProvider> syncStatusProviderOptional; |
|
|
|
final Optional<SyncStatusNodePermissioningProvider> syncStatusProviderOptional; |
|
|
|
|
|
|
|
|
|
|
|
List<NodePermissioningProvider> providers = new ArrayList<>(); |
|
|
|
List<NodePermissioningProvider> providers = new ArrayList<>(); |
|
|
|
if (permissioningConfiguration.getLocalConfig().isPresent()) { |
|
|
|
if (permissioningConfiguration.getLocalConfig().isPresent()) { |
|
|
@ -60,17 +60,20 @@ public class NodePermissioningControllerFactory { |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (permissioningConfiguration.getSmartContractConfig().isPresent()) { |
|
|
|
if (permissioningConfiguration.getSmartContractConfig().isPresent() |
|
|
|
SmartContractPermissioningConfiguration smartContractPermissioningConfiguration = |
|
|
|
&& permissioningConfiguration |
|
|
|
permissioningConfiguration.getSmartContractConfig().get(); |
|
|
|
.getSmartContractConfig() |
|
|
|
if (smartContractPermissioningConfiguration.isSmartContractNodeAllowlistEnabled()) { |
|
|
|
.get() |
|
|
|
|
|
|
|
.isSmartContractNodeAllowlistEnabled()) { |
|
|
|
NodeSmartContractPermissioningController smartContractProvider = |
|
|
|
NodeSmartContractPermissioningController smartContractProvider = |
|
|
|
new NodeSmartContractPermissioningController( |
|
|
|
new NodeSmartContractPermissioningController( |
|
|
|
smartContractPermissioningConfiguration.getNodeSmartContractAddress(), |
|
|
|
permissioningConfiguration |
|
|
|
|
|
|
|
.getSmartContractConfig() |
|
|
|
|
|
|
|
.get() |
|
|
|
|
|
|
|
.getNodeSmartContractAddress(), |
|
|
|
transactionSimulator, |
|
|
|
transactionSimulator, |
|
|
|
metricsSystem); |
|
|
|
metricsSystem); |
|
|
|
providers.add(smartContractProvider); |
|
|
|
providers.add(smartContractProvider); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (fixedNodes.isEmpty()) { |
|
|
|
if (fixedNodes.isEmpty()) { |
|
|
|
syncStatusProviderOptional = Optional.empty(); |
|
|
|
syncStatusProviderOptional = Optional.empty(); |
|
|
@ -86,7 +89,14 @@ public class NodePermissioningControllerFactory { |
|
|
|
NodePermissioningController nodePermissioningController = |
|
|
|
NodePermissioningController nodePermissioningController = |
|
|
|
new NodePermissioningController(syncStatusProviderOptional, providers); |
|
|
|
new NodePermissioningController(syncStatusProviderOptional, providers); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
permissioningConfiguration |
|
|
|
|
|
|
|
.getSmartContractConfig() |
|
|
|
|
|
|
|
.ifPresent( |
|
|
|
|
|
|
|
config -> { |
|
|
|
|
|
|
|
if (config.isSmartContractNodeAllowlistEnabled()) { |
|
|
|
validatePermissioningContract(nodePermissioningController); |
|
|
|
validatePermissioningContract(nodePermissioningController); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
return nodePermissioningController; |
|
|
|
return nodePermissioningController; |
|
|
|
} |
|
|
|
} |
|
|
|