Skip to content

Commit

Permalink
Merge pull request nervosnetwork#4235 from eval-exec/exec/move-ckb-la…
Browse files Browse the repository at this point in the history
…uncher-migrate-to-independent-crate

Move `util/launcher/src/migrate.rs` to an independent crate
quake authored Nov 20, 2023
2 parents af4e3c1 + 2a93afe commit 4779635
Showing 22 changed files with 72 additions and 24 deletions.
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
@@ -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"
1 change: 1 addition & 0 deletions ckb-bin/Cargo.toml
Original file line number Diff line number Diff line change
@@ -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
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;

12 changes: 3 additions & 9 deletions util/launcher/Cargo.toml
Original file line number Diff line number Diff line change
@@ -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" }
@@ -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
@@ -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,
2 changes: 1 addition & 1 deletion util/launcher/src/shared_builder.rs
Original file line number Diff line number Diff line change
@@ -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};
@@ -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;
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 <dev@nervos.org>"]
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"]
File renamed without changes.
File renamed without changes.
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.
File renamed without changes.
File renamed without changes.

0 comments on commit 4779635

Please sign in to comment.