Skip to content

Commit d279f34

Browse files
zhangsoledaddoitian
authored andcommitted
feat: unify config format with json
1 parent 380386d commit d279f34

16 files changed

Lines changed: 189 additions & 187 deletions

File tree

Cargo.lock

Lines changed: 30 additions & 49 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ build = "build.rs"
77

88
[dependencies]
99
clap = { version = "2", features = ["yaml"] }
10-
toml = "0.4"
1110
serde = "1.0"
1211
serde_derive = "1.0"
1312
log = "0.4"

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,5 +101,5 @@ $ cargo run -- run --data-dir=/tmp/node2
101101

102102
Modify development config file
103103
```shell
104-
cp src/config/development.toml /tmp/node1/config.toml
104+
cp src/config/default.json /tmp/node1/config.json
105105
```

core/src/global.rs

Lines changed: 0 additions & 8 deletions
This file was deleted.

core/src/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ pub mod chain;
2020
pub mod difficulty;
2121
pub mod error;
2222
pub mod extras;
23-
pub mod global;
2423
pub mod header;
2524
pub mod script;
2625
pub mod service;

explorer/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ npm run build
1919

2020
start node with development config file:
2121
```
22-
cp src/config/development.toml /tmp/node1/config.toml
22+
cp src/config/default.json /tmp/node1/config.json
2323
2424
cargo run -- run --data-dir=/tmp/node1
2525
```

spec/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ license = "MIT"
55
authors = ["Nervos Core Dev <dev@nervos.org>"]
66

77
[dependencies]
8-
serde_yaml = "0.7"
8+
serde_json = "1.0"
99
bigint = { git = "https://github.com/nervosnetwork/bigint" }
1010
ckb-core = { path = "../core" }
1111
serde_derive = "1.0"

spec/res/dev.json

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
{
2+
"__comments__": {
3+
"system_cells": [
4+
"When loading dev.yaml, we will modify the path here to simplify loading,",
5+
"but if you are copying this file elsewhere, you will need to provide full path ",
6+
"or relative path to where ckb is executing."
7+
],
8+
9+
"edge_bits": [
10+
"the 2-log of the graph size",
11+
"which is the size in bits of the node identifiers"
12+
],
13+
14+
"cycle_length": [
15+
"length of the cycle to be found, must be an even number",
16+
"a minimum of 12 is recommended"
17+
]
18+
},
19+
20+
"name": "ckb",
21+
"genesis": {
22+
"seal": {
23+
"nonce": 0,
24+
"proof": [0]
25+
},
26+
"version": 0,
27+
"parent_hash": "0x0000000000000000000000000000000000000000000000000000000000000000",
28+
"timestamp": 0,
29+
"txs_commit": "0x0000000000000000000000000000000000000000000000000000000000000000",
30+
"txs_proposal": "0x0000000000000000000000000000000000000000000000000000000000000000",
31+
"difficulty": "0x100",
32+
"cellbase_id": "0x0000000000000000000000000000000000000000000000000000000000000000",
33+
"uncles_hash": "0x0000000000000000000000000000000000000000000000000000000000000000"
34+
},
35+
"params": {
36+
"initial_block_reward": 50000
37+
},
38+
"system_cells": [
39+
{"path": "verify"},
40+
{"path": "always_success"}
41+
],
42+
"pow": {
43+
"Cuckoo": {
44+
"edge_bits": 15,
45+
"cycle_length": 12
46+
}
47+
}
48+
}

spec/res/dev.yaml

Lines changed: 0 additions & 25 deletions
This file was deleted.

0 commit comments

Comments
 (0)