mirror of
https://github.com/Qortal/qortal.git
synced 2025-04-22 19:07:51 +00:00
save dynamically created identity beck to file
This commit is contained in:
parent
f0d4c1e8de
commit
706dc03b3e
@ -39,6 +39,8 @@ import org.qortal.settings.Settings;
|
|||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.nio.charset.StandardCharsets;
|
import java.nio.charset.StandardCharsets;
|
||||||
import java.nio.file.StandardCopyOption;
|
import java.nio.file.StandardCopyOption;
|
||||||
|
import static java.nio.file.StandardOpenOption.CREATE;
|
||||||
|
import static java.nio.file.StandardOpenOption.WRITE;
|
||||||
import java.nio.file.Files;
|
import java.nio.file.Files;
|
||||||
import java.nio.file.Path;
|
import java.nio.file.Path;
|
||||||
|
|
||||||
@ -116,6 +118,13 @@ public class RNSNetwork {
|
|||||||
serverIdentity = new Identity();
|
serverIdentity = new Identity();
|
||||||
log.info("APP_NAME: {}, storage path: {}", APP_NAME, serverIdentityPath);
|
log.info("APP_NAME: {}, storage path: {}", APP_NAME, serverIdentityPath);
|
||||||
log.info("new server identity created dynamically.");
|
log.info("new server identity created dynamically.");
|
||||||
|
// save it back to file by default for next start (possibly add setting to override)
|
||||||
|
try {
|
||||||
|
Files.write(serverIdentityPath, serverIdentity.getPrivateKey(), CREATE, WRITE);
|
||||||
|
log.info("serverIdentity written back to file");
|
||||||
|
} catch (IOException e) {
|
||||||
|
log.error("Error while saving serverIdentity to {}", serverIdentityPath, e);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
log.debug("Server Identity: {}", serverIdentity.toString());
|
log.debug("Server Identity: {}", serverIdentity.toString());
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user