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

Move util/launcher/src/migrate.rs to an independent crate #4235

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
eaa387d
Add `util/migrate` crate
eval-exec Nov 17, 2023
0752647
Add dependencies for `ckb-migrate`
eval-exec Nov 17, 2023
4ac28f2
Move util/launcher/migration-template into ckb-migrate
eval-exec Nov 17, 2023
d33cdc1
Move util/launcher/src/migrations into ckb-migrate
eval-exec Nov 17, 2023
b685164
Move util/launcher/src/tests.rs into ckb-migrate
eval-exec Nov 17, 2023
2fb84d5
Remove util/launcher/migration-template from ckb workspace members
eval-exec Nov 17, 2023
6c1cf99
Add util/migrate as ckb workspace members
eval-exec Nov 17, 2023
cd7cbd9
Remove migration-template from ckb-launcher's dependencies
eval-exec Nov 17, 2023
492a5ae
Add ckb-migrate as ckb-launcher's dependencies
eval-exec Nov 17, 2023
e1a4370
Add ckb-migrate as ckb-bin's dependencies
eval-exec Nov 17, 2023
5cfa069
Move util/launcher/src/migrate.rs into ckb-migrate
eval-exec Nov 17, 2023
06a3398
Remove migrate modules declaration from ckb-launcher
eval-exec Nov 17, 2023
30835d4
Include all util/migrate components to ckb-migrate
eval-exec Nov 17, 2023
9190a4b
Add migrations module for ckb-migrate
eval-exec Nov 17, 2023
07daf59
Fix ckb-launcher should use ckb-migrate
eval-exec Nov 17, 2023
ea735d7
Fix ckb-bin should use ckb-migrate
eval-exec Nov 17, 2023
545a716
Update `Cargo.lock` by `make prod`
eval-exec Nov 17, 2023
4ff1a95
Add tempfile for ckb-migrate
eval-exec Nov 17, 2023
3ea7166
Add doc for ckb-migrate
eval-exec Nov 17, 2023
e2f8e57
Remove useless dependencies from ckb-launcher
eval-exec Nov 17, 2023
2a93afe
Fix check-cargotoml.sh
eval-exec Nov 17, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 21 additions & 5 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,8 @@ members = [
"sync",
"util/instrument",
"rpc",
"util/launcher/migration-template",
"util/migrate/migration-template",
"util/migrate",
"util/light-client-protocol-server",
"util/launcher",
"ckb-bin"
Expand Down
1 change: 1 addition & 0 deletions ckb-bin/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ ckb-memory-tracker = { path = "../util/memory-tracker", version = "= 0.113.0-pre
ckb-chain-iter = { path = "../util/chain-iter", version = "= 0.113.0-pre" }
ckb-verification-traits = { path = "../verification/traits", version = "= 0.113.0-pre" }
ckb-async-runtime = { path = "../util/runtime", version = "= 0.113.0-pre" }
ckb-migrate = { path = "../util/migrate", version = "= 0.113.0-pre" }
ckb-launcher = { path = "../util/launcher", version = "= 0.113.0-pre" }
base64 = "0.21.0"
tempfile.workspace = true
Expand Down
2 changes: 1 addition & 1 deletion ckb-bin/src/subcommand/migrate.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use ckb_app_config::{ExitCode, MigrateArgs};
use ckb_launcher::migrate::Migrate;
use ckb_migrate::migrate::Migrate;
use is_terminal::IsTerminal;
use std::cmp::Ordering;

Expand Down
12 changes: 3 additions & 9 deletions util/launcher/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,7 @@ repository = "https://github.com/nervosnetwork/ckb"
ckb-types = { path = "../types", version = "= 0.113.0-pre" }
ckb-store = { path = "../../store", version = "= 0.113.0-pre" }
ckb-db = { path = "../../db", version = "= 0.113.0-pre" }
ckb-migration-template = { path = "migration-template", version = "= 0.113.0-pre" }
ckb-app-config = { path = "../app-config", version = "= 0.113.0-pre" }
ckb-db-migration = { path = "../../db-migration", version = "= 0.113.0-pre" }
ckb-logger = { path = "../logger", version = "= 0.113.0-pre" }
ckb-db-schema = { path = "../../db-schema", version = "= 0.113.0-pre" }
ckb-error = { path = "../../error", version = "= 0.113.0-pre" }
Expand All @@ -41,15 +39,11 @@ ckb-snapshot = { path = "../snapshot", version = "= 0.113.0-pre" }
ckb-tx-pool = { path = "../../tx-pool", version = "= 0.113.0-pre" }
ckb-light-client-protocol-server = { path = "../light-client-protocol-server", version = "= 0.113.0-pre" }
ckb-block-filter = { path = "../../block-filter", version = "= 0.113.0-pre" }
ckb-hash = { path = "../hash", version = "= 0.113.0-pre" }
num_cpus = "1.10"
ckb-migrate = { path = "../migrate", version = "= 0.113.0-pre" }
once_cell = "1.8.0"
tempfile.workspace = true

[dev-dependencies]
ckb-systemtime = {path = "../systemtime", version = "= 0.113.0-pre", features = ["enable_faketime"] }

[features]
with_sentry = [ "ckb-sync/with_sentry", "ckb-network/with_sentry", "ckb-app-config/with_sentry" ]
portable = ["ckb-db/portable", "ckb-db-migration/portable"]
march-native = ["ckb-db/march-native", "ckb-db-migration/march-native"]
portable = ["ckb-db/portable", "ckb-migrate/portable"]
march-native = ["ckb-db/march-native", "ckb-migrate/march-native"]
7 changes: 0 additions & 7 deletions util/launcher/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,7 @@
//!
//! ckb launcher is helps to launch ckb node.

// declare here for mute ./devtools/ci/check-cargotoml.sh error
extern crate num_cpus;

pub mod migrate;
mod migrations;
mod shared_builder;
#[cfg(test)]
mod tests;

use ckb_app_config::{
BlockAssemblerConfig, ExitCode, RpcConfig, RpcModule, RunArgs, SupportProtocol,
Expand Down
2 changes: 1 addition & 1 deletion util/launcher/src/shared_builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
//!
//! which can be used in order to configure the properties of a new shared.

use crate::migrate::Migrate;
use ckb_app_config::ExitCode;
use ckb_app_config::{BlockAssemblerConfig, DBConfig, NotifyConfig, StoreConfig, TxPoolConfig};
use ckb_async_runtime::{new_background_runtime, Handle};
Expand All @@ -14,6 +13,7 @@ use ckb_db_schema::COLUMNS;
use ckb_error::{Error, InternalErrorKind};
use ckb_freezer::Freezer;
use ckb_logger::{error, info};
use ckb_migrate::migrate::Migrate;
use ckb_notify::{NotifyController, NotifyService, PoolTransactionEntry};
use ckb_proposal_table::ProposalTable;
use ckb_proposal_table::ProposalView;
Expand Down
32 changes: 32 additions & 0 deletions util/migrate/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
[package]
name = "ckb-migrate"
version = "0.113.0-pre"
license = "MIT"
authors = ["Nervos Core Dev <[email protected]>"]
edition = "2021"
description = "TODO(doc): @eval-exec crate description"
homepage = "https://github.com/nervosnetwork/ckb"
repository = "https://github.com/nervosnetwork/ckb"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
ckb-migration-template = { path = "migration-template", version = "= 0.113.0-pre" }
ckb-db = { path = "../../db", version = "= 0.113.0-pre" }
ckb-error = { path = "../../error", version = "= 0.113.0-pre" }
ckb-db-schema = { path = "../../db-schema", version = "= 0.113.0-pre" }
ckb-db-migration = { path = "../../db-migration", version = "= 0.113.0-pre" }
ckb-app-config = { path = "../app-config", version = "= 0.113.0-pre" }
ckb-types = { path = "../types", version = "= 0.113.0-pre" }
ckb-store = { path = "../../store", version = "= 0.113.0-pre" }
ckb-chain-spec = { path = "../../spec", version = "= 0.113.0-pre" }
ckb-hash = { path = "../hash", version = "= 0.113.0-pre" }
tempfile.workspace = true
num_cpus = "1.10"

[dev-dependencies]
ckb-systemtime = {path = "../systemtime", version = "= 0.113.0-pre", features = ["enable_faketime"] }

[features]
portable = ["ckb-db/portable", "ckb-db-migration/portable"]
march-native = ["ckb-db/march-native", "ckb-db-migration/march-native"]
11 changes: 11 additions & 0 deletions util/migrate/src/lib.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
//! CKB migrate.
//!
//! ckb migrate help to migrate CKB's data on schema change.

// declare here for mute ./devtools/ci/check-cargotoml.sh error
extern crate num_cpus;

pub mod migrate;
mod migrations;
#[cfg(test)]
mod tests;
File renamed without changes.
File renamed without changes.
Loading