|
|
@ -104,7 +104,9 @@ public class NodePermissioningControllerFactory { |
|
|
|
.ifPresent( |
|
|
|
.ifPresent( |
|
|
|
config -> { |
|
|
|
config -> { |
|
|
|
if (config.isSmartContractNodeAllowlistEnabled()) { |
|
|
|
if (config.isSmartContractNodeAllowlistEnabled()) { |
|
|
|
validatePermissioningContract(nodePermissioningController); |
|
|
|
validatePermissioningContract( |
|
|
|
|
|
|
|
nodePermissioningController, |
|
|
|
|
|
|
|
permissioningConfiguration.getSmartContractConfig().get()); |
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
@ -145,7 +147,8 @@ public class NodePermissioningControllerFactory { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private void validatePermissioningContract( |
|
|
|
private void validatePermissioningContract( |
|
|
|
final NodePermissioningController nodePermissioningController) { |
|
|
|
final NodePermissioningController nodePermissioningController, |
|
|
|
|
|
|
|
final SmartContractPermissioningConfiguration smartContractPermissioningConfig) { |
|
|
|
LOG.debug("Validating onchain node permissioning smart contract configuration"); |
|
|
|
LOG.debug("Validating onchain node permissioning smart contract configuration"); |
|
|
|
|
|
|
|
|
|
|
|
try { |
|
|
|
try { |
|
|
@ -156,8 +159,11 @@ public class NodePermissioningControllerFactory { |
|
|
|
EnodeURL.fromString( |
|
|
|
EnodeURL.fromString( |
|
|
|
"enode://6f8a80d14311c39f35f516fa664deaaaa13e85b2f7493f37f6144d86991ec012937307647bd3b9a82abe2974e1407241d54947bbb39763a4cac9f77166ad92a0@10.3.58.6:30303")); |
|
|
|
"enode://6f8a80d14311c39f35f516fa664deaaaa13e85b2f7493f37f6144d86991ec012937307647bd3b9a82abe2974e1407241d54947bbb39763a4cac9f77166ad92a0@10.3.58.6:30303")); |
|
|
|
} catch (Exception e) { |
|
|
|
} catch (Exception e) { |
|
|
|
final String msg = "Error validating onchain node permissioning smart contract configuration"; |
|
|
|
final String msg = |
|
|
|
LOG.error(msg + ":", e); |
|
|
|
String.format( |
|
|
|
|
|
|
|
"Error: node permissioning contract at address %s does not match the expected interface version %s.", |
|
|
|
|
|
|
|
smartContractPermissioningConfig.getNodeSmartContractAddress(), |
|
|
|
|
|
|
|
smartContractPermissioningConfig.getNodeSmartContractInterfaceVersion()); |
|
|
|
throw new IllegalStateException(msg, e); |
|
|
|
throw new IllegalStateException(msg, e); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|