HelixNetwork / pendulum

Pendulum is a distributed messaging protocol that enables globally available tamper proof timestamps :hourglass_flowing_sand:
https://dev.hlx.ai
Other
10 stars 6 forks source link

Key generation with a prebuilt jar #136

Closed oracle58 closed 4 years ago

oracle58 commented 5 years ago

Steps to reproduce

  1. mkdir somedir
  2. cd somedir
  3. place the prebuilt jar in somedir
  4. java -jar helix-<version>.jar -p 8085 -nominee <pathToSeed>

Issue

The Nominee.key file is automatically generated in and read from .src/main/resources, if this directory does not exist, following error is thrown:

java.io.FileNotFoundException: ./src/main/resources/Nominee.key (No such file or directory)
    at java.io.FileOutputStream.open0(Native Method)
    at java.io.FileOutputStream.open(FileOutputStream.java:270)
    at java.io.FileOutputStream.<init>(FileOutputStream.java:213)
    at java.io.FileOutputStream.<init>(FileOutputStream.java:101)
    at java.io.FileWriter.<init>(FileWriter.java:63)
    at net.helix.hlx.crypto.Merkle.createKeyfile(Merkle.java:168)
    at net.helix.hlx.service.milestone.impl.MilestonePublisher.generateKeyfile(MilestonePublisher.java:111)
    at net.helix.hlx.service.milestone.impl.MilestonePublisher.startScheduledExecutorService(MilestonePublisher.java:138)
    at net.helix.hlx.HLX$HLXLauncher.main(HLX.java:140)
    at net.helix.hlx.HLX.main(HLX.java:65)

Expected behavior

If not run from the source repository, a resources directory should be created in the directory in which the jar is executed.

cristina-vasiu commented 5 years ago

Fixed in https://github.com/HelixNetwork/helix/commit/bc40644d37384a7c71d0439d03a7f05f320c5e0d