class GenerateNodeIdRandomly implements GenerateNodeIdStrategy {

    @Override
    public String getNodePrivateKey() {
        ECKey key = new ECKey();
        Properties props = new Properties();
        props.setProperty("nodeIdPrivateKey", Hex.toHexString(key.getPrivKeyBytes()));
        props.setProperty("nodeId", Hex.toHexString(key.getNodeId()));

        File file = new File(databaseDir, "nodeId.properties");
        file.getParentFile().mkdirs();
        try (Writer writer = new FileWriter(file)) {
            props.store(writer, "Generated NodeID. To use your own nodeId please refer to 'peer.privateKey' config option.");
        } catch (IOException e) {
            throw new RuntimeException(e);
        }

        logger.info("New nodeID generated: " + props.getProperty("nodeId"));
        logger.info("Generated nodeID and its private key stored in " + file);

        return props.getProperty("nodeIdPrivateKey");
    }

      GenerateNodeIdRandomly(String databaseDir);

}