-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #19 from Conflux-Chain/posConfig
add script to create pos configurations
- Loading branch information
Showing
12 changed files
with
1,107 additions
and
369 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,7 @@ | ||
#!/bin/bash | ||
|
||
# init config | ||
cd ./scripts | ||
node initConfig.js | ||
cd .. | ||
cd ./scripts && node initConfig.js && cd .. | ||
|
||
# start conflux | ||
/bin/conflux --config ./conflux.toml |
Binary file not shown.
This file was deleted.
Oops, something went wrong.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import { execa } from "execa"; | ||
import fs from "node:fs/promises"; | ||
import YAML from 'yaml' | ||
|
||
|
||
export async function createPosConfig(chainId) { | ||
await execa`pos-genesis-tool random --initial-seed=0000000000000000000000000000000000000000000000000000000000000000 --num-validator=1 --num-genesis-validator=1 --chain-id=${chainId}`; | ||
|
||
const waypoint_config = await fs.readFile('./waypoint_config', 'utf8'); | ||
const posConfigRaw = await fs.readFile('../pos_config/pos_config.yaml', 'utf8'); | ||
|
||
const posConfig = YAML.parse(posConfigRaw); | ||
console.log("posConfig", posConfig); | ||
posConfig.base.waypoint.from_config = waypoint_config; | ||
console.log("update posConfig", posConfig); | ||
await fs.writeFile('../pos_config/pos_config.yaml', YAML.stringify(posConfig)); | ||
await execa`ls -l` | ||
await execa`mv ./genesis_file ../pos_config/genesis_file`; | ||
|
||
await execa`mv ./initial_nodes.json ../pos_config/initial_nodes.json`; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.