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 node crate to its own folder #1406

Closed
wants to merge 16 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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
1,781 changes: 917 additions & 864 deletions Cargo.lock

Large diffs are not rendered by default.

239 changes: 1 addition & 238 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,30 +1,3 @@
[package]
name = "centrifuge-chain"
version = "0.10.28"
authors = ["Centrifuge <[email protected]>"]
description = "Centrifuge chain implementation in Rust."
build = "build.rs"
edition = "2021"
license = "LGPL-3.0"
default-run = "centrifuge-chain"
homepage = "https://centrifuge.io/"
repository = "https://github.com/centrifuge/centrifuge-chain"

[package.metadata.wasm-pack.profile.release]
# `wasm-opt` has some problems on linux, see
# https://github.com/rustwasm/wasm-pack/issues/781 etc.
wasm-opt = false

[badges]
travis-ci = { repository = "centrifuge/centrifuge-chain", branch = "master" }
maintenance = { status = "actively-developed" }
is-it-maintained-issue-resolution = { repository = "centrifuge/centrifuge-chain" }
is-it-maintained-open-issues = { repository = "centrifuge/centrifuge-chain" }

[[bin]]
name = "centrifuge-chain"
path = "src/main.rs"

[workspace]
members = [
"libs/mock-builder",
Expand Down Expand Up @@ -67,217 +40,7 @@ members = [
"runtime/centrifuge",
"runtime/common",
"runtime/integration-tests",
]

[dependencies]
# third-party dependencies
async-trait = "0.1"
clap = { version = "4.0.9", features = ["derive"] }
codec = { package = "parity-scale-codec", version = "3.0", default-features = false }
futures = "0.3.25"
hex-literal = "0.2.1"
jsonrpsee = { version = "0.16.2", features = ["server", "macros"] }
log = "0.4.8"
serde = { version = "1.0.119", features = ["derive"] }
url = "2.2.2"

# client dependencies
grandpa = { package = "sc-finality-grandpa", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.38" }
sc-basic-authorship = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.38" }
sc-chain-spec = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.38" }
sc-cli = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.38" }
sc-client-api = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.38" }
sc-consensus = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.38" }
sc-executor = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.38" }
sc-network = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.38" }
sc-network-sync = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.38" }
sc-rpc = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.38" }
sc-rpc-api = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.38" }
sc-service = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.38" }
sc-telemetry = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.38" }
sc-tracing = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.38" }
sc-transaction-pool = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.38" }
sc-transaction-pool-api = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.38" }
sp-api = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.38" }
sp-block-builder = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.38" }
sp-blockchain = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.38" }
sp-consensus = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.38" }
sp-consensus-aura = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.38" }
sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.38" }
sp-io = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.38" }
sp-keystore = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.38" }
sp-offchain = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.38" }
sp-runtime = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.38" }
sp-session = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.38" }
sp-timestamp = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.38" }
sp-transaction-pool = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.38" }
substrate-prometheus-endpoint = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.38" }

# Cli specific
frame-benchmarking-cli = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.38" }
try-runtime-cli = { git = "https://github.com/paritytech/substrate", optional = true, branch = "polkadot-v0.9.38" }

# Local dependencies
cfg-types = { path = "./libs/types" }
pallet-anchors = { path = "./pallets/anchors" }
pallet-pool-system = { path = "./pallets/pool-system" }
pallet-transaction-payment-rpc = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.38" }
substrate-frame-rpc-system = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.38" }

# Cumulus dependencies
cumulus-client-cli = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.38" }
cumulus-client-consensus-aura = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.38" }
cumulus-client-consensus-common = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.38" }
cumulus-client-network = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.38" }
cumulus-client-service = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.38" }
cumulus-pallet-session-benchmarking = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.38" }
cumulus-primitives-core = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.38" }
cumulus-primitives-parachain-inherent = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.38" }
cumulus-relay-chain-inprocess-interface = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.38" }
cumulus-relay-chain-interface = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.38" }

# Polkadot dependencies
polkadot-cli = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.38" }
polkadot-primitives = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.38" }
polkadot-service = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.38" }

# node-specific dependencies
altair-runtime = { path = "runtime/altair", default-features = false }
centrifuge-runtime = { path = "runtime/centrifuge", default-features = false }
cfg-primitives = { path = "libs/primitives" }
cfg-utils = { path = "libs/utils" }
development-runtime = { path = "runtime/development", default-features = false }
runtime-common = { path = "runtime/common" }

# benchmarking
frame-benchmarking = { git = "https://github.com/paritytech/substrate", optional = true, branch = "polkadot-v0.9.38" }

# integration testing
runtime-integration-tests = { path = "runtime/integration-tests", optional = true, default-features = false }

# xcm
xcm = { git = "https://github.com/paritytech/polkadot", default-features = false, branch = "release-v0.9.38" }

# frontier
fc-consensus = { git = "https://github.com/PureStake/frontier", default-features = false, branch = "moonbeam-polkadot-v0.9.38" }
fc-db = { git = "https://github.com/PureStake/frontier", default-features = false, branch = "moonbeam-polkadot-v0.9.38" }
fc-mapping-sync = { git = "https://github.com/PureStake/frontier", default-features = false, branch = "moonbeam-polkadot-v0.9.38" }
fc-rpc = { git = "https://github.com/PureStake/frontier", default-features = false, branch = "moonbeam-polkadot-v0.9.38" }
fc-rpc-core = { git = "https://github.com/PureStake/frontier", default-features = false, branch = "moonbeam-polkadot-v0.9.38" }
fp-consensus = { git = "https://github.com/PureStake/frontier", default-features = false, branch = "moonbeam-polkadot-v0.9.38" }
fp-rpc = { git = "https://github.com/PureStake/frontier", default-features = false, branch = "moonbeam-polkadot-v0.9.38" }
fp-storage = { git = "https://github.com/PureStake/frontier", default-features = false, branch = "moonbeam-polkadot-v0.9.38" }

[build-dependencies]
substrate-build-script-utils = { optional = true, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.38" }
vergen = "3.0.4"

[dev-dependencies]
frame-system = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.38" }
getrandom = { version = "0.2", features = ["js"] }
pallet-transaction-payment = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.38" }
sc-service-test = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.38" }
sp-keyring = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.38" }
tempfile = "3.1.0"

[features]
default = ["std", "cli"]
std = [
"serde/std",
"sc-service/rocksdb",
"substrate-build-script-utils",
"altair-runtime/std",
"centrifuge-runtime/std",
"cfg-primitives/std",
"cfg-types/std",
"cfg-utils/std",
"clap/std",
"cumulus-primitives-core/std",
"cumulus-primitives-parachain-inherent/std",
"development-runtime/std",
"fp-consensus/std",
"fp-rpc/std",
"fp-storage/std",
"futures/std",
"frame-benchmarking/std",
"log/std",
"pallet-anchors/std",
"pallet-pool-system/std",
"codec/std",
"polkadot-primitives/std",
"runtime-common/std",
"sc-executor/std",
"serde/std",
"sp-api/std",
"sp-block-builder/std",
"sp-consensus-aura/std",
"sp-core/std",
"sp-io/std",
"sp-keystore/std",
"sp-offchain/std",
"sp-runtime/std",
"sp-session/std",
"sp-timestamp/std",
"sp-transaction-pool/std",
"xcm/std",
"cumulus-pallet-session-benchmarking/std",
"fp-consensus/std",
"fp-rpc/std",
"fp-storage/std",
"futures/std",
"sp-io/std",
"getrandom/std",
"runtime-integration-tests/std",
]
runtime-benchmarks = [
"frame-benchmarking/runtime-benchmarks",
"frame-system/runtime-benchmarks",
"altair-runtime/runtime-benchmarks",
"centrifuge-runtime/runtime-benchmarks",
"development-runtime/runtime-benchmarks",
"runtime-common/runtime-benchmarks",
"polkadot-cli/runtime-benchmarks",
"cfg-primitives/runtime-benchmarks",
"cfg-types/runtime-benchmarks",
"cfg-utils/runtime-benchmarks",
"cumulus-pallet-session-benchmarking/runtime-benchmarks",
"frame-benchmarking-cli/runtime-benchmarks",
"pallet-anchors/runtime-benchmarks",
"pallet-pool-system/runtime-benchmarks",
"polkadot-primitives/runtime-benchmarks",
"polkadot-service/runtime-benchmarks",
"runtime-integration-tests/runtime-benchmarks",
"sc-service/runtime-benchmarks",
"sp-runtime/runtime-benchmarks",
]
cli = [
"try-runtime-cli",
]
try-runtime = [
"cfg-primitives/try-runtime",
"centrifuge-runtime/try-runtime",
"altair-runtime/try-runtime",
"development-runtime/try-runtime",
"try-runtime-cli",
"cfg-types/try-runtime",
"cfg-utils/try-runtime",
"pallet-anchors/try-runtime",
"pallet-pool-system/try-runtime",
"polkadot-cli/try-runtime",
"polkadot-service/try-runtime",
"runtime-common/try-runtime",
'sp-runtime/try-runtime',
]

fast-runtime = [
"altair-runtime/fast-runtime",
"centrifuge-runtime/fast-runtime",
"development-runtime/fast-runtime",
"runtime-integration-tests/fast-runtime",
]

testnet-runtime = [
"altair-runtime/testnet-runtime",
"node",
]

#
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ RUN curl https://sh.rustup.rs -sSf | sh -s -- -y && \
export PATH="$PATH:$HOME/.cargo/bin" && \
rustup default $RUST_TOOLCHAIN && \
rustup target add wasm32-unknown-unknown --toolchain $RUST_TOOLCHAIN && \
cargo build "--$PROFILE" $OPTS
cargo build -p centrifuge-chain "--$PROFILE" $OPTS

# ===== SECOND STAGE ======

Expand Down
9 changes: 5 additions & 4 deletions ci/script.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ cargo --version

case $TARGET in
build-node)
cargo build --release "$@"
cargo build -p centrifuge-chain --release "$@"
;;

build-runtime)
Expand All @@ -37,11 +37,12 @@ case $TARGET in
;;

tests)
RUST_MIN_STACK=8388608 cargo test --workspace --release --features runtime-benchmarks,try-runtime --exclude runtime-integration-tests
cargo test --workspace --release --features runtime-benchmarks,try-runtime,fast-runtime --exclude runtime-integration-tests
;;

integration)
RUST_MIN_STACK=8388608 cargo test --release --package runtime-integration-tests --features fast-runtime
# We use the same features as tests to reuse the artifacts
cargo test -p runtime-integration-tests --release --features runtime-benchmarks,try-runtime,fast-runtime
;;

fmt)
Expand All @@ -53,7 +54,7 @@ case $TARGET in
;;

clippy)
cargo clippy --workspace -- -D warnings -A clippy::unnecessary-cast -A clippy::bool-to-int-with-if
cargo clippy --workspace --release --features runtime-benchmarks,try-runtime,fast-runtime -- -D warnings -A clippy::unnecessary-cast -A clippy::bool-to-int-with-if
;;

benchmark)
Expand Down
Loading