Skip to content

Commit

Permalink
add pos_config generate doc
Browse files Browse the repository at this point in the history
  • Loading branch information
Pana committed Jul 5, 2024
1 parent 4052f58 commit 44b944c
Show file tree
Hide file tree
Showing 7 changed files with 103 additions and 1 deletion.
1 change: 1 addition & 0 deletions cfxrun/conflux.toml
Original file line number Diff line number Diff line change
Expand Up @@ -566,6 +566,7 @@ cip78_patch_transition_number = 6
cip90_transition_height = 6
cip90_transition_number = 6
cip105_transition_number = 6
sigma_fix_transition_number = 6

# v2.3
cip107_transition_number = 7
Expand Down
Binary file added cfxrun/pos_config/genesis_file
Binary file not shown.
56 changes: 56 additions & 0 deletions cfxrun/pos_config/initial_nodes.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
{
"initial_nodes": [
{
"address": "0x1816e5d69b6bdb0eda6b9f99cadb642b48fbcef0",
"bls_key": "b157f238403a5b980546fd19ca48f79a2613e3e3a91d14ee69908b8816e4c53665370b2fbd0db62cc4aa0e8caeedc9b5",
"vrf_key": "027c3093ba97f57fbbad84d21770385f72b755a7a7c82adace8a632a628f9eb98e",
"voting_power": 2000,
"register_tx": {
"nonce": "0x0",
"gas_price": "0x1",
"gas": "0x30d40",
"action": { "Call": "0x0888000000000000000000000000000000000005" },
"value": "0x0",
"storage_limit": 16000,
"epoch_height": 0,
"chain_id": 1,
"data": [
227, 53, 180, 81, 149, 11, 214, 93, 186, 104, 147, 176, 36, 78, 87,
240, 217, 106, 135, 74, 210, 36, 59, 164, 241, 255, 100, 11, 98, 115,
254, 205, 72, 40, 132, 194, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 208, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 160, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 96, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 48, 177, 87, 242, 56, 64, 58, 91, 152, 5, 70,
253, 25, 202, 72, 247, 154, 38, 19, 227, 227, 169, 29, 20, 238, 105,
144, 139, 136, 22, 228, 197, 54, 101, 55, 11, 47, 189, 13, 182, 44,
196, 170, 14, 140, 174, 237, 201, 181, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 33, 2, 124, 48, 147, 186,
151, 245, 127, 187, 173, 132, 210, 23, 112, 56, 95, 114, 183, 85, 167,
167, 200, 42, 218, 206, 138, 99, 42, 98, 143, 158, 185, 142, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 64, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 160,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 48, 178, 156, 115, 62, 200, 81, 228, 52, 173,
197, 187, 174, 129, 107, 178, 2, 190, 212, 192, 196, 94, 215, 97, 51,
89, 46, 121, 128, 102, 166, 123, 88, 63, 46, 80, 227, 144, 100, 65,
199, 200, 35, 193, 245, 14, 118, 2, 69, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 32, 245, 154, 53, 182, 221,
209, 77, 97, 58, 181, 190, 217, 232, 129, 82, 195, 59, 139, 89, 124,
104, 239, 231, 129, 37, 231, 117, 28, 119, 244, 181, 68
]
}
}
],
"initial_committee": [
["950bd65dba6893b0244e57f0d96a874ad2243ba4f1ff640b6273fecd482884c2", 300]
],
"initial_seed": "0x0000000000000000000000000000000000000000000000000000000000000000"
}
18 changes: 18 additions & 0 deletions cfxrun/pos_config/pos_config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@

base:
#data_dir: ./pos_db
role: validator
waypoint:
from_config: 0:214f3881979cafee76c8bb516f2270fed3801c0a858a533e1a2079f294e47f3f
consensus:
round_initial_timeout_ms: 60000
safety_rules:
service:
type: local
execution:
genesis_file_location: ./genesis_file
logger:
file: ./log/pos.log
level: INFO
#storage:
#dir: ./pos_db/db
Binary file added cfxrun/pos_config/pos_key
Binary file not shown.
11 changes: 10 additions & 1 deletion docs/about-dev-node-config.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,13 @@ next_hardfork_transition_height=10 # cip130, cip133

cip1559_transition_height=10
cancun_opcodes_transition_number=10
```
```

## How to generate pos_config files

1. (use conflux-rust compile binary ./target/release/pos-genesis-tool) Run `./target/release/pos-genesis-tool random --initial-seed=0000000000000000000000000000000000000000000000000000000000000000 --num-validator=1 --num-genesis-validator=1 --chain-id=1` to generate PoS genesis data.
2. Use the content in the generated `waypoint_config` to configure the field `base.waypoint.from_config` in the pos configuration file template `fullnode-configs/pos_config.yaml`.
3. Create directory `pos_config`, and put `genesis_file`, `initial_nodes.json`, and `pos_config.yaml` in it.
4. Move the corresponding private key within `private_keys` to `pos_config`, and rename it to `pos_key`.
5. Default pos_key password is empty.

18 changes: 18 additions & 0 deletions fullnode-configs/pos_config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@

base:
#data_dir: ./pos_db
role: validator
waypoint:
from_config: 0:bb0ed10fe051eb8f9365cc12f4edf14efa1d2117d823cdb6df1a82f777d8ff94
consensus:
round_initial_timeout_ms: 60000
safety_rules:
service:
type: local
execution:
genesis_file_location: ./genesis_file
logger:
file: ./log/pos.log
level: INFO
#storage:
#dir: ./pos_db/db

0 comments on commit 44b944c

Please sign in to comment.