Skip to content
This repository has been archived by the owner on Jun 11, 2024. It is now read-only.

Unable to export generator info as per the help guide #8848

Closed
Tracked by #7226
sameersubudhi opened this issue Aug 11, 2023 · 1 comment
Closed
Tracked by #7226

Unable to export generator info as per the help guide #8848

sameersubudhi opened this issue Aug 11, 2023 · 1 comment
Assignees
Milestone

Comments

@sameersubudhi
Copy link

Expected behavior

I should be able to export the generator info as per the help guide.

sameer@Sameers-MBP scripts % ../bin/run generator export -h           
Export to <FILE>.

USAGE
  $ lisk-core generator export [-d <value>] [--pretty] [-o <value>]

FLAGS
  -d, --data-path=<value>  Directory path to specify where node data is stored. Environment
                           variable "LISK_DATA_PATH" can also be used.
  -o, --output=<value>     The output directory. Default will set to current working
                           directory.
  --pretty                 Prints JSON in pretty format rather than condensed.

DESCRIPTION
  Export to <FILE>.

EXAMPLES
  generator:export --output /mypath/genInfo.json

  generator:export --output /mypath/genInfo.json --data-path ./data 

Actual behavior

Exporting generator info behaves unexpected as specified below and is not inline with the help guide:

  1. Running ../bin/run generator export prints the output to the STDOUT
sameer@Sameers-MBP scripts % ../bin/run generator export
{
  "keys": [
    {
      "address": "lskzzw334cgd7cew5mb9bbayjmojbodgmw9pdym6p",
      "plain": {
        "generatorKey": "1a4e92e2b0c235fff9bcff3b417c5a47cb5f5240c54f297360a5a516a91bc4fc",
        "generatorPrivateKey": "c77b2f1f79240bcb15a19336bebd9653886beea724c44a418f0baf26a452dc1f1a4e92e2b0c235fff9bcff3b417c5a47cb5f5240c54f297360a5a516a91bc4fc",
        "blsKey": "a4f8a7ab03605906f89a6b3e2a6091c53feae76f3a9e48593732fc027babbbfd6cf6fa5c98251f8453cb6b57fda99ced",
        "blsPrivateKey": "5787d50e94d4533d46ca9e2d1b2715bf56a3b4e71bbeed9902b2245a81439721"
      }
    },
    ...
    {
      "address": "lskg2ktfe4n4yd963pusqf8vbgqv7arwx9c5o8kpu",
      "plain": {
        "generatorKey": "3d95ed7a8a4f61d213afe443d54ceb42c36e6def9928b6280f65f0cb89e905f3",
        "generatorPrivateKey": "72c6f77a375c68510e627cc1a865c71ea7be8387abc90a8e62c11ef4bc6d44ed3d95ed7a8a4f61d213afe443d54ceb42c36e6def9928b6280f65f0cb89e905f3",
        "blsKey": "832d2cdd741b0df3f80311ed90deec394c13ed05da115d3c1fc135c96556911c6b00592451de0ab37296417559852080",
        "blsPrivateKey": "5d39d5cac9be981f68ef60feddb8666b931f92580cec408e20502d8278faf8e8"
      }
    }
  ],
  "generatorInfo": [
    {
      "address": "lskzzw334cgd7cew5mb9bbayjmojbodgmw9pdym6p",
      "height": 704,
      "maxHeightGenerated": 607,
      "maxHeightPrevoted": 636
    },
    ...
    {
      "address": "lskg2ktfe4n4yd963pusqf8vbgqv7arwx9c5o8kpu",
      "height": 731,
      "maxHeightGenerated": 638,
      "maxHeightPrevoted": 658
    }
  ]
}
  1. Errors when specifying custom --output directory
sameer@Sameers-MBP scripts % ../bin/run generator export --output ~/Desktop       
    Error: EISDIR: illegal operation on a directory, open '/Users/sameer/Desktop'
    Code: EISDIR
sameer@Sameers-MBP scripts % ../bin/run generator export --output /Users/sameer/Desktop
    Error: EISDIR: illegal operation on a directory, open '/Users/sameer/Desktop'
    Code: EISDIR
  1. Errors when specifying custom --output filename (only filename)
sameer@Sameers-MBP scripts % ../bin/run generator export --output generators.json      
    Error: ENOENT: no such file or directory, mkdir
    Code: ENOENT
  1. Works only when specifying custom --output filename (with relative or absolute patch), contrary to the help guide
sameer@Sameers-MBP scripts % ../bin/run generator export --output /Users/sameer/Desktop/generators.json
sameer@Sameers-MBP scripts % echo $?
0


sameer@Sameers-MBP scripts % ../bin/run generator export --output ./generators.json                    
sameer@Sameers-MBP scripts % echo $?                                               
0

Steps to reproduce

Please check above

Which version(s) does this affect? (Environment, OS, etc...)

v6.0.0-beta.6

@mosmartin mosmartin self-assigned this Aug 14, 2023
@mosmartin
Copy link
Contributor

@sameersubudhi am having a look into this issue. However (good news 😉), I am not able to reproduce it. I am able to export to an output file. Please see attached.

Command
image

Output File
image

Is it still persistent for you? If so, let's huddle and review.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants