Skip to content

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.

@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