Skip to content

Commit

Permalink
Merge #369
Browse files Browse the repository at this point in the history
369: feat: Embed testnet chain spec in compiled binary r=doitian a=xxuejie



Co-authored-by: Xuejie Xiao <[email protected]>
  • Loading branch information
bors[bot] and xxuejie committed Mar 29, 2019
2 parents fe1535b + aef52ab commit e32bb6e
Show file tree
Hide file tree
Showing 14 changed files with 340 additions and 31 deletions.
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
2 changes: 1 addition & 1 deletion nodes_template/miner.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
data_dir = "default"
chain = "spec/dev.toml"
chain = { Local = "spec/dev.toml" }
rpc_url = "http://127.0.0.1:8114/"
cycles_limit = 100000000
bytes_limit = 10000000
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 <[email protected]>"]
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"
Loading

0 comments on commit e32bb6e

Please sign in to comment.