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: Embed testnet chain spec in compiled binary #369

Merged
merged 5 commits into from
Mar 29, 2019
Merged

feat: Embed testnet chain spec in compiled binary #369

merged 5 commits into from
Mar 29, 2019

Conversation

xxuejie
Copy link
Collaborator

@xxuejie xxuejie commented Mar 28, 2019

No description provided.

spec/src/lib.rs Outdated Show resolved Hide resolved
Ok(spec)
}

pub fn pow_engine(&self) -> Arc<dyn PowEngine> {
self.pow.engine()
}

pub fn to_consensus(&self) -> Result<Consensus, Box<Error>> {
pub fn to_consensus(&self, spec_path: &SpecPath) -> Result<Consensus, Box<Error>> {
Copy link
Member

Choose a reason for hiding this comment

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

Refactoring to the builder pattern may simplify the code of Consensus creation.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I actually tried that path, but we are talking about 2 parameters which are both required to build Consensus, I'm not sure using a builder pattern would simplify this code. It might end up just with more code and no obvious gain.

Tho I can refactor this to a separate function instead of method on ChainSpec.

Copy link
Member

Choose a reason for hiding this comment

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

OK, I can try it later (someday... :)

@doitian doitian added the s:waiting-on-author Status: The marked PR is awaiting some action (such as code changes) from the PR author. label Mar 29, 2019
@xxuejie xxuejie added s:waiting-on-reviewers Status: Waiting for Review and removed s:waiting-on-author Status: The marked PR is awaiting some action (such as code changes) from the PR author. labels Mar 29, 2019
@doitian
Copy link
Member

doitian commented Mar 29, 2019

bors r+

bors bot added a commit that referenced this pull request Mar 29, 2019
369: feat: Embed testnet chain spec in compiled binary r=doitian a=xxuejie



Co-authored-by: Xuejie Xiao <xxuejie@gmail.com>
@doitian doitian removed s:waiting-on-reviewers Status: Waiting for Review labels Mar 29, 2019
@bors
Copy link
Contributor

bors bot commented Mar 29, 2019

Build succeeded

  • continuous-integration/travis-ci/push

@bors bors bot merged commit aef52ab into nervosnetwork:develop Mar 29, 2019
@doitian doitian mentioned this pull request Apr 8, 2019
doitian added a commit that referenced this pull request Apr 22, 2019
🎉[ᚬmaster] Rc/v0.9.0

### Bug Fixes

* #410: network panic errors r=jjyr a=jjyr

    * Peer Store no such table
    * get peer index panic

* #386: flatbuffers vtable `num_fields` overflow r=zhangsoledad a=doitian

    Refs nervosnetwork/cfb#16

* #385: Upgrade p2p fix repeat connection bug r=jjyr a=TheWaWaR

    Related PR: nervosnetwork/tentacle#92

* #382: reset peer store connection status when setup r=TheWaWaR a=jjyr

    1. reset peer status
    2. remove banned addrs from peer_attemps result

* #424: many bug fixes of the p2p network issues fix a=TheWaWaR,zhangsoledad

### Features

* #491: update lock cell for segwit and address format a=classicalliu

* #368: segregated witness r=janx,quake a=zhangsoledad

* #409: remove uncle cellbase r=doitian a=zhangsoledad

* #369: Embed testnet chain spec in compiled binary r=doitian a=xxuejie

* #344: Revise script structure r=xxuejie a=xxuejie

* #425: Bundle app config in compiled binary a=doitian

### Improvements

* #392: avoid recursive lock a=zhangsoledad

### BREAKING CHANGES

This release has changed core data structure, please delete the old data directory.

The testnet chain spec is also changed, which is incompatible with previous versions.

Command line argument `-c` is removed, and a new command line argument `-C` is added. See `ckb help` for details.

Now the command `ckb` no longer searches the config file `nodes/default.toml`. It looks for the config file `ckb.toml` or `ckb-miner.toml` in current directory and uses the default config options when not found. A new command `ckb init` is added, see its usage with `ckb init --help`.

Config file `ckb.toml` changes:

- Removed `logger.file`, `db.path` and `network.path` from config file.
- Added config option `logger.log_to_stdout` and `logger.log_to_file`.
- Section `block_assembler` now accepts two options `binary_hash` and `args`. 
- Added a new option to set sentry DSN.

File `miner.toml` changes:

- Option `spec` is moved under `chain`, which is consistent with `ckb.toml`.
- Move miner own config options under section `miner`.
- Remove `logger.file` from config file.
- Add config option `logger.log_to_stdout` and `logger.log_to_file`.

It is recommended to export the config files via `ckb init`, then apply the
modifications upon the new config files.
@xxuejie xxuejie deleted the embed-chain-specs branch July 6, 2020 04:49
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.

3 participants