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(config): Simplify config and data dir parsing #19

Merged
merged 6 commits into from
Nov 26, 2018

Conversation

doitian
Copy link
Member

@doitian doitian commented Nov 22, 2018

BREAKING CHANGE:

Command line arguments and some config options and chan spec options have been
changed. It may break scripts and integration tests that depends on the
command line interface.

  • Command line argument --config|-c is now a top option, which should be
    specified before sub-command.
  • Remove command line arguments --data-dir and --chain. They should be
    configured via the config file.
  • Add a new config option data_dir, which configures the path of data
    directory.
  • Option ckb.chain now only accepts a path.
  • Option system_cells in chain spec now only accepts paths.

The path data_dir and ckb.chain can be an absolute path, or relative to
the directory containing the config file.

The paths of system_cells in chain spec can be absolute, or relative to the
directory containing the chain spec file.

If --config|-c is omitted, the app tries ckb.json, nodes/default.json in
order.

It is recommended to use nodes/default.json for development, which can be
created by cp -r nodes_template/ nodes. The default config saves data
in nodes/default/, and loads chains spec nodes/spec/dev.json.

Following locations are obsoleted data directories, which can be removed on
development machines:

  • Linux
    • $XDG_DATA_HOME/ckb
    • $XDG_DATA_HOME/NervosDev
    • $HOME/.local/share/ckb
    • $HOME/.local/share/NervosDev
  • macOS
    • $HOME/Library/Application Support/ckb
    • $HOME/Library/Application Support/NervosDev

@doitian doitian force-pushed the doitian/uniform-config branch 2 times, most recently from fa62211 to fee2fa6 Compare November 22, 2018 13:13
BREAKING CHANGE:

Command line arguments and some config options and chan spec options have been
changed. It may break scripts and integration tests that depends on the
command line interface.

- Command line argument `--config|-c` is now a top option, which should be
  specified before sub-command.
- Remove command line arguments `--data-dir` and `--chain`. They should be
  configured via the config file.
- Add a new config option `data_dir`, which configures the path of data
  directory.
- Option `ckb.chain` now only accepts a path.
- Option `system_cells` in chain spec now only accepts paths.

The path `data_dir` and `ckb.chain` can be an absolute path, or relative to
the directory containing the config file.

The paths of `system_cells` in chain spec can be absolute, or relative to the
directory containing the chain spec file.

If `--config|-c` is omitted, the app tries `ckb.json`, `nodes/default.json` in
order.

It is recommended to use `nodes/default.json` for development, which can be
created by copying `nodes/default.example.json`. The default config saves data
in `nodes/default/`, and loads chains spec `nodes/spec/dev.json`.

Following locations are obsoleted data directories, which can be removed on
development machines:

- Linux
  - `$XDG_DATA_HOME/ckb`
  - `$XDG_DATA_HOME/NervosDev`
  - `$HOME/.local/share/ckb`
  - `$HOME/.local/share/NervosDev`
- macOS
  - `$HOME/Library/Application Support/ckb`
  - `$HOME/Library/Application Support/NervosDev`
@xxuejie
Copy link
Collaborator

xxuejie commented Nov 23, 2018

With the new path, can we remove old cells at spec/res/cells?

@doitian
Copy link
Member Author

doitian commented Nov 23, 2018

Yes, they should be moved to nodes/spec

@doitian doitian requested a review from quake November 26, 2018 03:51
quake
quake previously approved these changes Nov 26, 2018
@doitian doitian merged commit b4fdc29 into develop Nov 26, 2018
@doitian doitian deleted the doitian/uniform-config branch November 26, 2018 06:21
XuJiandong pushed a commit to XuJiandong/ckb that referenced this pull request Apr 16, 2024
* Add testcase: chech max pipe limits on child

* Optimize test case max_fd_limits

* Fix CI error

* Add testcase about spawn

* Add testcase: Add some code that is not covered
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.

None yet

3 participants