Move blockstack-core into a separate folder (develop branch) (#3814)

* move `src` to `blockstack-core/`

* fix paths

* stackers.db

* Remove src/net

* Renaming to `stackslib`

* Revert Cargo.lock changes.

* stackslib
This commit is contained in:
Sergey Shandar
2023-08-03 16:08:32 -07:00
committed by GitHub
parent 2e756fe500
commit 7afb43086d
173 changed files with 208 additions and 207 deletions

90
Cargo.lock generated
View File

@@ -377,50 +377,6 @@ dependencies = [
"futures-lite",
]
[[package]]
name = "blockstack-core"
version = "0.0.1"
dependencies = [
"assert-json-diff",
"chrono",
"clarity",
"criterion",
"curve25519-dalek",
"ed25519-dalek",
"integer-sqrt",
"lazy_static",
"libc",
"mio 0.6.23",
"nix",
"percent-encoding",
"pox-locking",
"prometheus",
"rand 0.7.3",
"rand_chacha 0.2.2",
"regex",
"ripemd",
"rstest 0.17.0",
"rstest_reuse 0.5.0",
"rusqlite",
"secp256k1",
"serde",
"serde_derive",
"serde_json",
"serde_stacker",
"sha2 0.10.6",
"sha3",
"siphasher",
"slog",
"slog-json",
"slog-term",
"stacks-common",
"stdext",
"stx-genesis",
"time 0.2.27",
"url",
"winapi 0.3.9",
]
[[package]]
name = "bumpalo"
version = "3.12.0"
@@ -2700,7 +2656,6 @@ dependencies = [
"async-std",
"backtrace",
"base64 0.12.3",
"blockstack-core",
"chrono",
"clarity",
"http-types",
@@ -2717,12 +2672,57 @@ dependencies = [
"serde_json",
"slog",
"stacks-common",
"stackslib",
"stx-genesis",
"tokio",
"toml",
"warp",
]
[[package]]
name = "stackslib"
version = "0.0.1"
dependencies = [
"assert-json-diff",
"chrono",
"clarity",
"criterion",
"curve25519-dalek",
"ed25519-dalek",
"integer-sqrt",
"lazy_static",
"libc",
"mio 0.6.23",
"nix",
"percent-encoding",
"pox-locking",
"prometheus",
"rand 0.7.3",
"rand_chacha 0.2.2",
"regex",
"ripemd",
"rstest 0.17.0",
"rstest_reuse 0.5.0",
"rusqlite",
"secp256k1",
"serde",
"serde_derive",
"serde_json",
"serde_stacker",
"sha2 0.10.6",
"sha3",
"siphasher",
"slog",
"slog-json",
"slog-term",
"stacks-common",
"stdext",
"stx-genesis",
"time 0.2.27",
"url",
"winapi 0.3.9",
]
[[package]]
name = "standback"
version = "0.2.17"

View File

@@ -1,135 +1,8 @@
[package]
name = "blockstack-core"
version = "0.0.1"
authors = [ "Jude Nelson <jude@stacks.org>",
"Aaron Blankstein <aaron@blockstack.com>",
"Ludo Galabru <ludovic@blockstack.com>" ]
license = "GPLv3"
homepage = "https://github.com/blockstack/stacks-blockchain"
repository = "https://github.com/blockstack/stacks-blockchain"
description = "Reference implementation of the Stacks 2.0 Blockchain"
keywords = [ "stacks", "stx", "bitcoin", "crypto", "blockstack", "decentralized", "dapps", "blockchain" ]
readme = "README.md"
resolver = "2"
edition = "2021"
rust-version = "1.61"
[profile.release]
debug = true
[lib]
name = "blockstack_lib"
path = "src/lib.rs"
[[bin]]
name = "stacks-inspect"
path = "src/main.rs"
[[bin]]
name = "clarity-cli"
path = "src/clarity_cli_main.rs"
[[bin]]
name = "blockstack-cli"
path = "src/blockstack_cli.rs"
[dependencies]
rand = "0.7.3"
rand_chacha = "=0.2.2"
serde = "1"
serde_derive = "1"
serde_stacker = "0.1"
sha3 = "0.10.1"
ripemd = "0.1.1"
regex = "1"
mio = "0.6"
lazy_static = "1.4.0"
url = "2.1.0"
percent-encoding = "2.1.0"
prometheus = { version = "0.9", optional = true }
integer-sqrt = "0.1.3"
slog = { version = "2.5.2", features = [ "max_level_trace" ] }
slog-term = "2.6.0"
slog-json = { version = "2.3.0", optional = true }
chrono = "0.4.19"
libc = "0.2.82"
clarity = { package = "clarity", path = "./clarity/." }
stacks_common = { package = "stacks-common", path = "./stacks-common/." }
pox_locking = { package = "pox-locking", path = "./pox-locking/." }
siphasher = "0.3.7"
[target.'cfg(unix)'.dependencies]
nix = "0.23"
[target.'cfg(windows)'.dependencies]
winapi = { version = "0.3", features = ["consoleapi", "handleapi", "synchapi", "winbase"] }
[target.'cfg(windows)'.dev-dependencies]
winapi = { version = "0.3", features = ["fileapi", "processenv", "winnt"] }
[dependencies.serde_json]
version = "1.0"
features = ["arbitrary_precision", "unbounded_depth"]
[dependencies.secp256k1]
version = "0.24.3"
features = ["serde", "recovery"]
[dependencies.rusqlite]
version = "=0.24.2"
features = ["blob", "serde_json", "i128_blob", "bundled", "trace"]
[dependencies.ed25519-dalek]
version = "=1.0.0-pre.3"
features = ["serde"]
[dependencies.curve25519-dalek]
version = "=2.0.0"
features = ["serde"]
[dependencies.time]
version = "0.2.23"
features = ["std"]
[dev-dependencies]
assert-json-diff = "1.0.0"
criterion = "0.3.5"
stdext = "0.3.1"
stx_genesis = { package = "stx-genesis", path = "./stx-genesis/."}
clarity = { package = "clarity", features = ["default", "testing"], path = "./clarity/." }
stacks_common = { package = "stacks-common", features = ["default", "testing"], path = "./stacks-common/." }
rstest = "0.17.0"
rstest_reuse = "0.5.0"
[features]
default = ["developer-mode"]
profile-sqlite = []
disable-costs = []
developer-mode = []
monitoring_prom = ["prometheus"]
slog_json = ["slog-json", "stacks_common/slog_json", "clarity/slog_json", "pox_locking/slog_json"]
testing = []
# Use a bit more than default optimization for
# dev builds to speed up test execution
[profile.dev]
opt-level = 1
# Use release-level optimization for dependencies
# This slows down "first" builds on development environments,
# but won't impact subsequent builds.
[profile.dev.package."*"]
opt-level = 3
[target.'cfg(all(any(target_arch = "x86_64", target_arch = "x86", target_arch = "aarch64"), not(target_env = "msvc")))'.dependencies]
sha2 = { version = "0.10", features = ["asm"] }
[target.'cfg(any(not(any(target_arch = "x86_64", target_arch = "x86", target_arch = "aarch64")), target_env = "msvc"))'.dependencies]
sha2 = { version = "0.10" }
[workspace]
resolver = "2"
members = [
".",
"stackslib",
"stacks-common",
"pox-locking",
"clarity",
"stx-genesis",

View File

@@ -27,7 +27,7 @@ regex = "1"
lazy_static = "1.4.0"
integer-sqrt = "0.1.3"
slog = { version = "2.5.2", features = [ "max_level_trace" ] }
stacks_common = { package = "stacks-common", path = "../stacks-common/." }
stacks_common = { package = "stacks-common", path = "../stacks-common" }
rstest = "0.17.0"
rstest_reuse = "0.5.0"

View File

@@ -6,5 +6,5 @@ name = "core-contracts"
costs_version = 1
[contracts.bns]
path = "../../src/chainstate/stacks/boot/bns.clar"
path = "../../stackslib/src/chainstate/stacks/boot/bns.clar"
depends_on = []

View File

@@ -19,8 +19,8 @@ name = "pox_locking"
path = "src/lib.rs"
[dependencies]
clarity = { package = "clarity", path = "../clarity/." }
stacks_common = { package = "stacks-common", path = "../stacks-common/." }
clarity = { package = "clarity", path = "../clarity" }
stacks_common = { package = "stacks-common", path = "../stacks-common" }
slog = { version = "2.5.2", features = [ "max_level_trace" ] }
[features]

128
stackslib/Cargo.toml Normal file
View File

@@ -0,0 +1,128 @@
[package]
name = "stackslib"
version = "0.0.1"
authors = [ "Jude Nelson <jude@stacks.org>",
"Aaron Blankstein <aaron@blockstack.com>",
"Ludo Galabru <ludovic@blockstack.com>" ]
license = "GPLv3"
homepage = "https://github.com/blockstack/stacks-blockchain"
repository = "https://github.com/blockstack/stacks-blockchain"
description = "Reference implementation of the Stacks 2.0 Blockchain"
keywords = [ "stacks", "stx", "bitcoin", "crypto", "blockstack", "decentralized", "dapps", "blockchain" ]
readme = "README.md"
resolver = "2"
edition = "2021"
rust-version = "1.61"
[profile.release]
debug = true
[lib]
name = "blockstack_lib"
path = "src/lib.rs"
[[bin]]
name = "stacks-inspect"
path = "src/main.rs"
[[bin]]
name = "clarity-cli"
path = "src/clarity_cli_main.rs"
[[bin]]
name = "blockstack-cli"
path = "src/blockstack_cli.rs"
[dependencies]
rand = "0.7.3"
rand_chacha = "=0.2.2"
serde = "1"
serde_derive = "1"
serde_stacker = "0.1"
sha3 = "0.10.1"
ripemd = "0.1.1"
regex = "1"
mio = "0.6"
lazy_static = "1.4.0"
url = "2.1.0"
percent-encoding = "2.1.0"
prometheus = { version = "0.9", optional = true }
integer-sqrt = "0.1.3"
slog = { version = "2.5.2", features = [ "max_level_trace" ] }
slog-term = "2.6.0"
slog-json = { version = "2.3.0", optional = true }
chrono = "0.4.19"
libc = "0.2.82"
clarity = { path = "../clarity" }
stacks-common = { path = "../stacks-common" }
pox-locking = { path = "../pox-locking" }
siphasher = "0.3.7"
[target.'cfg(unix)'.dependencies]
nix = "0.23"
[target.'cfg(windows)'.dependencies]
winapi = { version = "0.3", features = ["consoleapi", "handleapi", "synchapi", "winbase"] }
[target.'cfg(windows)'.dev-dependencies]
winapi = { version = "0.3", features = ["fileapi", "processenv", "winnt"] }
[dependencies.serde_json]
version = "1.0"
features = ["arbitrary_precision", "unbounded_depth"]
[dependencies.secp256k1]
version = "0.24.3"
features = ["serde", "recovery"]
[dependencies.rusqlite]
version = "=0.24.2"
features = ["blob", "serde_json", "i128_blob", "bundled", "trace"]
[dependencies.ed25519-dalek]
version = "=1.0.0-pre.3"
features = ["serde"]
[dependencies.curve25519-dalek]
version = "=2.0.0"
features = ["serde"]
[dependencies.time]
version = "0.2.23"
features = ["std"]
[dev-dependencies]
assert-json-diff = "1.0.0"
criterion = "0.3.5"
stdext = "0.3.1"
stx-genesis = { path = "../stx-genesis"}
clarity = { features = ["default", "testing"], path = "../clarity" }
stacks-common = { features = ["default", "testing"], path = "../stacks-common" }
rstest = "0.17.0"
rstest_reuse = "0.5.0"
[features]
default = ["developer-mode"]
profile-sqlite = []
disable-costs = []
developer-mode = []
monitoring_prom = ["prometheus"]
slog_json = ["slog-json", "stacks-common/slog_json", "clarity/slog_json", "pox-locking/slog_json"]
testing = []
# Use a bit more than default optimization for
# dev builds to speed up test execution
[profile.dev]
opt-level = 1
# Use release-level optimization for dependencies
# This slows down "first" builds on development environments,
# but won't impact subsequent builds.
[profile.dev.package."*"]
opt-level = 3
[target.'cfg(all(any(target_arch = "x86_64", target_arch = "x86", target_arch = "aarch64"), not(target_env = "msvc")))'.dependencies]
sha2 = { version = "0.10", features = ["asm"] }
[target.'cfg(any(not(any(target_arch = "x86_64", target_arch = "x86", target_arch = "aarch64")), target_env = "msvc"))'.dependencies]
sha2 = { version = "0.10" }

View File

@@ -172,7 +172,7 @@ The decode-microblock command decodes a serialized Stacks microblock and prints
The microblock, if given, must be a hex string. Alternatively, you may pass `-` instead, and the
raw binary microblock will be read from stdin.
N.B. Stacks microblocks are not stored as files in the Stacks chainstate -- they are stored in
N.B. Stacks microblocks are not stored as files in the Stacks chainstate -- they are stored in
block's sqlite database.";
const DECODE_MICROBLOCKS_USAGE: &str = "blockstack-cli (options) decode-microblocks [microblocks-path-or-stdin]
@@ -181,7 +181,7 @@ The decode-microblocks command decodes a serialized list of Stacks microblocks a
The microblocks, if given, must be a hex string. Alternatively, you may pass `-` instead, and the
raw binary microblocks will be read from stdin.
N.B. Stacks microblocks are not stored as files in the Stacks chainstate -- they are stored in
N.B. Stacks microblocks are not stored as files in the Stacks chainstate -- they are stored in
block's sqlite database.";
#[derive(Debug)]
@@ -594,7 +594,7 @@ fn generate_secret_key(args: &[String], version: TransactionVersion) -> Result<S
)
.expect("Failed to generate address from public key");
Ok(format!(
"{{
"{{
\"secretKey\": \"{}\",
\"publicKey\": \"{}\",
\"stacksAddress\": \"{}\"
@@ -910,7 +910,7 @@ mod test {
"1",
"0",
"foo-contract",
"./sample-contracts/tokens.clar",
"../sample-contracts/tokens.clar",
];
assert!(main_handler(to_string_vec(&publish_args)).is_ok());
@@ -921,7 +921,7 @@ mod test {
"1",
"0",
"foo-contract",
"./sample-contracts/non-existent-tokens.clar",
"../sample-contracts/non-existent-tokens.clar",
];
assert!(format!(

View File

@@ -2028,7 +2028,7 @@ mod test {
"test",
&[
"check".to_string(),
"sample-contracts/tokens.clar".to_string(),
"../sample-contracts/tokens.clar".to_string(),
],
);
@@ -2043,7 +2043,7 @@ mod test {
"test",
&[
"check".to_string(),
"sample-contracts/tokens.clar".to_string(),
"../sample-contracts/tokens.clar".to_string(),
db_name.clone(),
],
);
@@ -2060,7 +2060,7 @@ mod test {
&[
"launch".to_string(),
"S1G2081040G2081040G2081040G208105NK8PE5.tokens".to_string(),
"sample-contracts/tokens.clar".to_string(),
"../sample-contracts/tokens.clar".to_string(),
db_name.clone(),
],
);
@@ -2076,7 +2076,7 @@ mod test {
"test",
&[
"check".to_string(),
"sample-contracts/names.clar".to_string(),
"../sample-contracts/names.clar".to_string(),
db_name.clone(),
],
);
@@ -2092,7 +2092,7 @@ mod test {
"test",
&[
"check".to_string(),
"sample-contracts/names.clar".to_string(),
"../sample-contracts/names.clar".to_string(),
db_name.clone(),
"--contract_id".to_string(),
"S1G2081040G2081040G2081040G208105NK8PE5.tokens".to_string(),
@@ -2111,7 +2111,7 @@ mod test {
&[
"check".to_string(),
"--output_analysis".to_string(),
"sample-contracts/names.clar".to_string(),
"../sample-contracts/names.clar".to_string(),
db_name.clone(),
],
);
@@ -2129,7 +2129,7 @@ mod test {
&[
"check".to_string(),
"--costs".to_string(),
"sample-contracts/names.clar".to_string(),
"../sample-contracts/names.clar".to_string(),
db_name.clone(),
],
);
@@ -2148,7 +2148,7 @@ mod test {
&[
"launch".to_string(),
"S1G2081040G2081040G2081040G208105NK8PE5.names".to_string(),
"sample-contracts/names.clar".to_string(),
"../sample-contracts/names.clar".to_string(),
"--costs".to_string(),
"--assets".to_string(),
db_name.clone(),
@@ -2190,7 +2190,7 @@ mod test {
&[
"eval".to_string(),
"S1G2081040G2081040G2081040G208105NK8PE5.tokens".to_string(),
"sample-contracts/tokens-mint.clar".to_string(),
"../sample-contracts/tokens-mint.clar".to_string(),
db_name.clone(),
],
);
@@ -2218,7 +2218,7 @@ mod test {
"eval".to_string(),
"--costs".to_string(),
"S1G2081040G2081040G2081040G208105NK8PE5.tokens".to_string(),
"sample-contracts/tokens-mint.clar".to_string(),
"../sample-contracts/tokens-mint.clar".to_string(),
db_name.clone(),
],
);
@@ -2246,7 +2246,7 @@ mod test {
&[
"eval_at_chaintip".to_string(),
"S1G2081040G2081040G2081040G208105NK8PE5.tokens".to_string(),
"sample-contracts/tokens-mint.clar".to_string(),
"../sample-contracts/tokens-mint.clar".to_string(),
db_name.clone(),
],
);
@@ -2273,7 +2273,7 @@ mod test {
&[
"eval_at_chaintip".to_string(),
"S1G2081040G2081040G2081040G208105NK8PE5.tokens".to_string(),
"sample-contracts/tokens-mint.clar".to_string(),
"../sample-contracts/tokens-mint.clar".to_string(),
db_name.clone(),
"--costs".to_string(),
],
@@ -2309,7 +2309,7 @@ mod test {
"test",
&[
"check".to_string(),
"sample-contracts/tokens-ft.clar".to_string(),
"../sample-contracts/tokens-ft.clar".to_string(),
],
);
@@ -2325,7 +2325,7 @@ mod test {
&[
"launch".to_string(),
"S1G2081040G2081040G2081040G208105NK8PE5.tokens-ft".to_string(),
"sample-contracts/tokens-ft.clar".to_string(),
"../sample-contracts/tokens-ft.clar".to_string(),
db_name.clone(),
"--assets".to_string(),
],

Some files were not shown because too many files have changed in this diff Show More