|
|
@@ -141,7 +141,8 @@ public class LedgerInitProperties { |
|
|
|
|
|
|
|
public static LedgerInitProperties resolve(String initSettingFile) { |
|
|
|
Properties props = FileUtils.readProperties(initSettingFile, "UTF-8"); |
|
|
|
return resolve(props); |
|
|
|
File realFile = new File(initSettingFile); |
|
|
|
return resolve(realFile.getParentFile().getPath(), props); |
|
|
|
} |
|
|
|
|
|
|
|
public static LedgerInitProperties resolve(InputStream in) { |
|
|
@@ -150,6 +151,10 @@ public class LedgerInitProperties { |
|
|
|
} |
|
|
|
|
|
|
|
public static LedgerInitProperties resolve(Properties props) { |
|
|
|
return resolve(null, props); |
|
|
|
} |
|
|
|
|
|
|
|
public static LedgerInitProperties resolve(String dir, Properties props) { |
|
|
|
String hexLedgerSeed = PropertiesUtils.getRequiredProperty(props, LEDGER_SEED).replace("-", ""); |
|
|
|
byte[] ledgerSeed = HexUtils.decode(hexLedgerSeed); |
|
|
|
LedgerInitProperties initProps = new LedgerInitProperties(ledgerSeed); |
|
|
@@ -166,7 +171,7 @@ public class LedgerInitProperties { |
|
|
|
initProps.consensusProvider = PropertiesUtils.getRequiredProperty(props, CONSENSUS_SERVICE_PROVIDER); |
|
|
|
String consensusConfigFilePath = PropertiesUtils.getRequiredProperty(props, CONSENSUS_CONFIG); |
|
|
|
try { |
|
|
|
File consensusConfigFile = ResourceUtils.getFile(consensusConfigFilePath); |
|
|
|
File consensusConfigFile = FileUtils.getFile(dir, consensusConfigFilePath); |
|
|
|
initProps.consensusConfig = FileUtils.readProperties(consensusConfigFile); |
|
|
|
} catch (FileNotFoundException e) { |
|
|
|
throw new IllegalArgumentException( |
|
|
|