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

feat: bundle app config #387

Closed
wants to merge 12 commits into from
Closed

feat: bundle app config #387

wants to merge 12 commits into from

Conversation

doitian
Copy link
Member

@doitian doitian commented Apr 2, 2019

Proposal: [PREVIEW]

  • Add ckb_resource::ResourceLocator to load config files, which fallbacks to the bundled files.
  • Add a new subcommand ckb init to dump the bundled config files.
  • The bundled config files support template to set the different options for different specs in the same file.
  • Add many checks before starting the app.
  • Refactor the code organization in src.
  • Options logger.file, db.path and network.path are set automatically from the data dir.

Breaking Changes:

  • Remove command line argument -c, and add command line argument -C.
  • No longer search the config file nodes/default.toml.
  • Remove logger.file, db.path and network.path from config file. Add config option logger.copy_to_stdout.

Future Enhancements:

  • Better exit message.
  • Verify genesis hash when starting the app.
  • Verify database version when starting the app.

TODO

  • Add tests to load bundled config files.
  • Add tests to load the config files generated by ckb init.
  • ckb init should quit if any file already exists unless --force is specified.
  • ckb init should write file to temp file first, and move to the target location to avoid generating partial file because of interrupts.

@doitian doitian changed the title Rework on Config [WIP] Rework on Config Apr 2, 2019
@doitian doitian changed the title [WIP] Rework on Config Rework on Config Apr 5, 2019
@doitian doitian changed the title Rework on Config feat: bundle app config Apr 5, 2019
@doitian doitian added the hotfix Fixing that must be submit to RC branch. label Apr 9, 2019
@doitian
Copy link
Member Author

doitian commented Apr 9, 2019

Rebased onto rc/v0.9.0

#425

@doitian doitian closed this Apr 9, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
hotfix Fixing that must be submit to RC branch.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants