Skip to content
This repository has been archived by the owner on Nov 6, 2020. It is now read-only.

New directory structure #3828

Merged
merged 7 commits into from Dec 15, 2016
Merged

New directory structure #3828

merged 7 commits into from Dec 15, 2016

Conversation

arkpar
Copy link
Collaborator

@arkpar arkpar commented Dec 12, 2016

This PR introduces a new directory structure for Paritys' files. The new structure looks like this:

.parity
  chains
    ethereum
      db
        906a34e69aec8c0d
          snapshot
          overlayrecent
            version
            db
              *.sst
          archive
            version
            db
              *.sst
      network
        nodes.json
      user_defauls	
    classic
    test
  keys
    ethereum
    test
    classic
  signer
  dapps
  ipc
  • --db-path and -d now set a root path for all files (.parity alternative).
  • db kill command is introduced.

Closes #3683, #1221, #2383, #2374

@arkpar arkpar added A0-pleasereview 🤓 Pull request needs code review. B7-releasenotes 📜 Changes should be mentioned in the release notes of the next minor version release. M4-core ⛓ Core client code / Rust. labels Dec 12, 2016
@coveralls
Copy link

Coverage Status

Changes Unknown when pulling 85fd629 on new-dirs into ** on master**.

@rphmeier
Copy link
Contributor

Seems to also close https://github.com/ethcore/parity/issues/2383

This seems much better. I assume the config file will go in ~/.parity/ root as well?

@@ -67,7 +67,7 @@ pub struct Spec {
/// What engine are we using for this?
pub engine: Arc<Engine>,
/// The fork identifier for this chain. Only needed to distinguish two chains sharing the same genesis.
pub fork_name: Option<String>,
pub data_dir: String,
Copy link
Contributor

Choose a reason for hiding this comment

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

This seems to break compatibility with previous chain specs.
Also the doc string here is now wrong.

Copy link
Collaborator Author

@arkpar arkpar Dec 12, 2016

Choose a reason for hiding this comment

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

Don't think anyone uses this for private chains. We use it for classic and expanse. Upgrade path for these is supported.

@@ -126,3 +129,76 @@ pub fn upgrade(db_path: Option<&str>) -> Result<usize, Error> {
upgrade_from_version(ver)
})
}


Copy link
Contributor

Choose a reason for hiding this comment

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

nit: whitespace

@arkpar
Copy link
Collaborator Author

arkpar commented Dec 12, 2016

Config goes into ~/.parity/ by default.

@rphmeier rphmeier added A8-looksgood 🦄 Pull request is reviewed well. and removed A0-pleasereview 🤓 Pull request needs code review. labels Dec 12, 2016
@coveralls
Copy link

Coverage Status

Changes Unknown when pulling 5fd2e15 on new-dirs into ** on master**.

@arkpar arkpar added A3-inprogress ⏳ Pull request is in progress. No review needed at this stage. and removed A8-looksgood 🦄 Pull request is reviewed well. labels Dec 13, 2016
@gavofyork
Copy link
Contributor

would be good to solve https://github.com/ethcore/parity/issues/1648 in this PR too since they both need paths sorting.

@rphmeier
Copy link
Contributor

having --db-path default set using app_dirs crate seems simple enough:

let app_info = AppInfo { name: "parity", author: "parity" };
let db_path = try!(get_app_root(AppDataType::UserData, &app_info));

@rphmeier
Copy link
Contributor

It even obeys XDG base dir standards :)

@coveralls
Copy link

Coverage Status

Changes Unknown when pulling be5fefe on new-dirs into ** on master**.

@arkpar arkpar added A0-pleasereview 🤓 Pull request needs code review. and removed A3-inprogress ⏳ Pull request is in progress. No review needed at this stage. labels Dec 14, 2016
@coveralls
Copy link

Coverage Status

Changes Unknown when pulling 3280f07 on new-dirs into ** on master**.

@gavofyork gavofyork added A9-buythatmanabeer 🍻 Pull request is reviewed well and worth buying the author a beer. and removed A0-pleasereview 🤓 Pull request needs code review. labels Dec 15, 2016
@gavofyork gavofyork merged commit 20b2f84 into master Dec 15, 2016
@gavofyork gavofyork deleted the new-dirs branch December 15, 2016 13:34
@gavofyork
Copy link
Contributor

gavofyork commented Dec 15, 2016

maybe make -d / --root-path -> for the root data directory ($HOME/.parity or whatever); --db-path -> just for the chain/state databases; --keys-path -> for keys, ...

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
A9-buythatmanabeer 🍻 Pull request is reviewed well and worth buying the author a beer. B7-releasenotes 📜 Changes should be mentioned in the release notes of the next minor version release. M4-core ⛓ Core client code / Rust.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants