fboucquez / symbol-bootstrap

A tool that allows you to quickly configure and setup Symbol testnets and nodes.
Apache License 2.0
47 stars 28 forks source link

On v1.1.4,problem occurs with the node built with PROMPT_MAIN #378

Closed dusanjp closed 2 years ago

dusanjp commented 2 years ago

When with bootstrap v1.1.4 renewCertificates does not work properly on nodes built using "privateKeySecurityMode: PROMPT_MAIN" image

Also, if "privateKeySecurityMode: PROMPT_MAIN" is used and built new node with config / start is executed, an error will be issued and the process will end. image

dusanjp commented 2 years ago

The custompreset used in this validation is:

`privateKeySecurityMode: PROMPT_MAIN

privateKeySecurityMode: ENCRYPT

nodes:

    #mainPrivateKey: 8B7B3769C2D1CD6B82E01AE6B5B0CC6723FB9ADEE5E70B98580C942FAA75D7A4
    mainPublicKey: B473A112CCFFBB60E9A816DC86D97D4C41CED0D2067A1A105313A63E39E3BD5A

main address = TAA6DP62XPOGLJ7EPOQZOSEBA3CH2QSOXMF4DVOZ`

Until v1.1.3, the above problems have not occurred.

cryptoBeliever commented 2 years ago

@fboucquez I investigated the issue. The error happens in this line: https://github.com/fboucquez/symbol-bootstrap/blob/dev/src/service/BootstrapAccountResolver.ts#L57

I was able to fix it by copy same method isValidPrivateKey into BootstrapAccountResolver and replace CommandUtils.isValidPrivateKey with BootstrapAccountResolver.isValidPrivateKey

Not sure what is cause but would be good to check other prompts with validation too.

fboucquez commented 2 years ago

Thanks @dusanjp for reporting this issue.

@cryptoBeliever, thanks for the suggestion! It's one of those ugly circular dependencies that are hard to detect, related to how imports work, if the files import more than it should. Could you have a look at pr #379 ?

cryptoBeliever commented 2 years ago

Hello, @fboucquez I missed your comment. I've checked, and I'm able to:

with strategy PROMPT_MAIN :+1: :+1: