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

#972: Strategy for generating nodeId and nodePrivateKey #1104

Merged
merged 1 commit into from
Jul 1, 2018

Conversation

lucassaldanha
Copy link
Contributor

Fixes #972

@coveralls
Copy link

Coverage Status

Coverage increased (+0.04%) to 55.956% when pulling e524fdb on lucassaldanha:issue-972 into aa6e7d8 on ethereum:develop.

@zilm13
Copy link
Collaborator

zilm13 commented Jun 26, 2018

@lucassaldanha I'd prefer direct way to set fallback strategy in GenerateNodeIdFromPropsFile and change its name to GetNodeIdFromPropsFile. You will need to pass databaseDir 2 times in SystemProperties on init but it will not look like a hidden magic. Everything else looks great!
@mkalinin what do you think?

@zilm13
Copy link
Collaborator

zilm13 commented Jun 26, 2018

So it will look this way in SystemProperties:

this.generateNodeIdStrategy = new GetNodeIdFromPropsFile(databaseDir()).withFallback(new GenerateNodeIdRandomly(databaseDir()));

@lucassaldanha
Copy link
Contributor Author

I'd prefer direct way to set fallback strategy in GenerateNodeIdFromPropsFile

@zilm13 Sure! Do you want the fallback to be optional? e.g. If one doesn't specify the fallback, what should happen? Thrown an error?

@zilm13
Copy link
Collaborator

zilm13 commented Jun 27, 2018

@lucassaldanha yeah I think exception is better than null, so we see that something is wrong immediately if we have bad initialization.

@lucassaldanha lucassaldanha force-pushed the issue-972 branch 2 times, most recently from 03b4bd5 to 8278344 Compare June 27, 2018 16:23
@lucassaldanha
Copy link
Contributor Author

@zilm13 I've updated the PR. Let me know what you think. :)

@zilm13 zilm13 merged commit 121dfba into ethereum:develop Jul 1, 2018
@zilm13
Copy link
Collaborator

zilm13 commented Jul 1, 2018

@lucassaldanha Looks good, thanks

@mkalinin mkalinin added this to the 1.9.0-Constantinople milestone Oct 12, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants