Skip to content

Commit

Permalink
chore: update chain id write
Browse files Browse the repository at this point in the history
  • Loading branch information
iosh committed Jul 7, 2024
1 parent 07c3865 commit b529d70
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions cfxrun/scripts/initConfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@ async function initialConfig() {
// If the mode is not Docker, refrain from altering the conflux.toml file or any other elements, including comments or spaces.
const stream = fs.createWriteStream("../conflux.toml", {flags: 'a'});

stream.write("\n");

if (!config.chain_id) {
config.chain_id = parseInt(Math.random() * 10000);

Expand All @@ -21,7 +19,7 @@ async function initialConfig() {
config.chain_id
);

stream.write(`chain_id = ${config.chain_id}\n`);
stream.write(`\nchain_id = ${config.chain_id}\n`);
}
if (!config.evm_chain_id) {
config.evm_chain_id = config.chain_id + 1;
Expand All @@ -31,7 +29,7 @@ async function initialConfig() {
config.evm_chain_id
);

stream.write(`evm_chain_id = ${config.evm_chain_id}\n`);
stream.write(`\nevm_chain_id = ${config.evm_chain_id}\n`);
}

// The createPosConfig function must always be executed to generate the pos configuration.
Expand Down

0 comments on commit b529d70

Please sign in to comment.