Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support Custom Genesis Config for Non-Standard NetworkIDs #719

Merged
merged 20 commits into from
Jan 22, 2021

Conversation

patrick-ogrady
Copy link
Contributor

@patrick-ogrady patrick-ogrady commented Jan 19, 2021

This PR adds a --genesis CLI argument that enables the user to specify the genesis config of the custom network their node is going to be running.

Changes

  • Add --genesis implementation
  • Pass existing tests
  • Add genesis validation
  • Fix initialStakedFunds typo in genesis/config.go
  • Add new tests

Follow-Ups

@codecov
Copy link

codecov bot commented Jan 20, 2021

Codecov Report

Merging #719 (5e99ba5) into dev (2c39947) will increase coverage by 0.16919%.
The diff coverage is 85.71429%.

@@                 Coverage Diff                 @@
##                 dev        #719         +/-   ##
===================================================
+ Coverage   56.69442%   56.86361%   +0.16919%     
===================================================
  Files            320         320                 
  Lines          20420       20514         +94     
===================================================
+ Hits           11577       11665         +88     
- Misses          7586        7591          +5     
- Partials        1257        1258          +1     

@patrick-ogrady patrick-ogrady changed the title [WIP] Support Custom Genesis Config for Non-Standard NetworkIDs Support Custom Genesis Config for Non-Standard NetworkIDs Jan 20, 2021
"fuji": {
networkID: constants.FujiID,
customConfig: localGenesisConfigJSON, // won't load
expected: "2e6b699298a664793bff42dae9c1af8d9c54645d8b376fd331e0b67475578e0a",
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there is probably a better way to do this....

Copy link
Contributor Author

@patrick-ogrady patrick-ogrady Jan 20, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought about using an anonymous function to load these on-the-fly but didn't like the look (basically just replicated the logic of Genesis to create the Config we wanted)...still thinking.

genesis/genesis.go Outdated Show resolved Hide resolved
@patrick-ogrady patrick-ogrady changed the title Support Custom Genesis Config for Non-Standard NetworkIDs [WIP] Support Custom Genesis Config for Non-Standard NetworkIDs Jan 20, 2021
@patrick-ogrady patrick-ogrady force-pushed the genesis-config-flag branch 4 times, most recently from c928a60 to bea5d88 Compare January 20, 2021 19:42
@patrick-ogrady patrick-ogrady changed the title [WIP] Support Custom Genesis Config for Non-Standard NetworkIDs Support Custom Genesis Config for Non-Standard NetworkIDs Jan 21, 2021
@patrick-ogrady patrick-ogrady changed the base branch from master to dev January 21, 2021 03:46
genesis/genesis.go Outdated Show resolved Hide resolved
genesis/genesis.go Outdated Show resolved Hide resolved
genesis/genesis.go Outdated Show resolved Hide resolved
genesis/genesis_test.go Outdated Show resolved Hide resolved
@StephenButtolph StephenButtolph merged commit d4718bc into dev Jan 22, 2021
@StephenButtolph StephenButtolph deleted the genesis-config-flag branch January 22, 2021 21:58
StephenButtolph added a commit that referenced this pull request Jul 29, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants