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

feat: Embed testnet chain spec in compiled binary #369

Merged
merged 5 commits into from
Mar 29, 2019
Merged
Show file tree
Hide file tree
Changes from 2 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
141 changes: 141 additions & 0 deletions Cargo.lock

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

2 changes: 1 addition & 1 deletion nodes_template/default.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ data_dir = "default"
path = "default/db"

[chain]
spec = "spec/dev.toml"
spec = { Local = "spec/dev.toml" }

[logger]
file = "ckb.log"
Expand Down
7 changes: 7 additions & 0 deletions spec/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ version = "0.8.0-pre"
license = "MIT"
authors = ["Nervos Core Dev <dev@nervos.org>"]
edition = "2018"
build = "build.rs"
include = ["/chainspecs"]

[dependencies]
serde = "1.0"
Expand All @@ -13,3 +15,8 @@ numext-fixed-hash = { version = "0.1", features = ["support_rand", "support_heap
numext-fixed-uint = { version = "0.1", features = ["support_rand", "support_heapsize", "support_serde"] }
ckb-core = { path = "../core" }
ckb-pow = { path = "../pow" }
includedir = "0.5.0"
phf = "0.7.21"

[build-dependencies]
includedir_codegen = "0.5.0"
8 changes: 8 additions & 0 deletions spec/build.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
use includedir_codegen::Compression;

fn main() {
includedir_codegen::start("FILES")
.dir("chainspecs", Compression::Gzip)
.build("chainspecs.rs")
.unwrap();
}
Binary file not shown.
36 changes: 36 additions & 0 deletions spec/chainspecs/testnet/testnet.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name = "ckb_testnet"

[genesis]
version = 0
parent_hash = "0x0000000000000000000000000000000000000000000000000000000000000000"
timestamp = 0
txs_commit = "0x0000000000000000000000000000000000000000000000000000000000000000"
txs_proposal = "0x0000000000000000000000000000000000000000000000000000000000000000"
difficulty = "0x100"
cellbase_id = "0x0000000000000000000000000000000000000000000000000000000000000000"
uncles_hash = "0x0000000000000000000000000000000000000000000000000000000000000000"

[genesis.seal]
nonce = 0
proof = [0]

[params]
initial_block_reward = 50000
max_block_cycles = 100000000

[pow]
func = "Cuckoo"

[pow.params]
# the 2-log of the graph size, which is the size in bits of the node
# identifiers
edge_bits = 15

# length of the cycle to be found, must be an even number, a minimum of 12 is
# recommended
cycle_length = 12

# An array list paths to system cell files, which is absolute or relative to
# the directory containing this config file.
[[system_cells]]
path = "cells/secp256k1_blake2b_lock"
doitian marked this conversation as resolved.
Show resolved Hide resolved
Loading