Skip to content

Commit

Permalink
Change node configuration: pex, inflation, empty blocks #42
Browse files Browse the repository at this point in the history
  • Loading branch information
szynwelski committed Jul 10, 2023
1 parent 6f4476c commit 79e6911
Show file tree
Hide file tree
Showing 11 changed files with 40 additions and 39 deletions.
1 change: 1 addition & 0 deletions network/local/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
addrbook.json
4 changes: 0 additions & 4 deletions network/local/sequencer-0/config/addrbook.json

This file was deleted.

6 changes: 3 additions & 3 deletions network/local/sequencer-0/config/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ send_rate = 5120000
recv_rate = 5120000

# Set true to enable the peer-exchange reactor
pex = true
pex = false

# Seed mode, in which node constantly crawls the network and looks for
# peers. If another node asks it for addresses, it responds and disconnects.
Expand Down Expand Up @@ -408,8 +408,8 @@ double_sign_check_height = 0
skip_timeout_commit = false

# EmptyBlocks mode and possible interval between empty blocks
create_empty_blocks = true
create_empty_blocks_interval = "0s"
create_empty_blocks = false
create_empty_blocks_interval = "30s"

# Reactor sleep duration parameters
peer_gossip_sleep_duration = "100ms"
Expand Down
10 changes: 5 additions & 5 deletions network/local/sequencer-0/config/genesis.json
Original file line number Diff line number Diff line change
Expand Up @@ -417,15 +417,15 @@
},
"mint": {
"minter": {
"inflation": "0.130000000000000000",
"inflation": "0.000000000000000000",
"annual_provisions": "0.000000000000000000"
},
"params": {
"mint_denom": "warptest",
"inflation_rate_change": "0.130000000000000000",
"inflation_max": "0.200000000000000000",
"inflation_min": "0.070000000000000000",
"goal_bonded": "0.670000000000000000",
"inflation_rate_change": "0.000000000000000000",
"inflation_max": "0.000000000000000000",
"inflation_min": "0.000000000000000000",
"goal_bonded": "1.000000000000000000",
"blocks_per_year": "6311520"
}
},
Expand Down
4 changes: 0 additions & 4 deletions network/local/sequencer-1/config/addrbook.json

This file was deleted.

6 changes: 3 additions & 3 deletions network/local/sequencer-1/config/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ send_rate = 5120000
recv_rate = 5120000

# Set true to enable the peer-exchange reactor
pex = true
pex = false

# Seed mode, in which node constantly crawls the network and looks for
# peers. If another node asks it for addresses, it responds and disconnects.
Expand Down Expand Up @@ -408,8 +408,8 @@ double_sign_check_height = 0
skip_timeout_commit = false

# EmptyBlocks mode and possible interval between empty blocks
create_empty_blocks = true
create_empty_blocks_interval = "0s"
create_empty_blocks = false
create_empty_blocks_interval = "30s"

# Reactor sleep duration parameters
peer_gossip_sleep_duration = "100ms"
Expand Down
10 changes: 5 additions & 5 deletions network/local/sequencer-1/config/genesis.json
Original file line number Diff line number Diff line change
Expand Up @@ -417,15 +417,15 @@
},
"mint": {
"minter": {
"inflation": "0.130000000000000000",
"inflation": "0.000000000000000000",
"annual_provisions": "0.000000000000000000"
},
"params": {
"mint_denom": "warptest",
"inflation_rate_change": "0.130000000000000000",
"inflation_max": "0.200000000000000000",
"inflation_min": "0.070000000000000000",
"goal_bonded": "0.670000000000000000",
"inflation_rate_change": "0.000000000000000000",
"inflation_max": "0.000000000000000000",
"inflation_min": "0.000000000000000000",
"goal_bonded": "1.000000000000000000",
"blocks_per_year": "6311520"
}
},
Expand Down
4 changes: 0 additions & 4 deletions network/local/sequencer-2/config/addrbook.json

This file was deleted.

6 changes: 3 additions & 3 deletions network/local/sequencer-2/config/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ send_rate = 5120000
recv_rate = 5120000

# Set true to enable the peer-exchange reactor
pex = true
pex = false

# Seed mode, in which node constantly crawls the network and looks for
# peers. If another node asks it for addresses, it responds and disconnects.
Expand Down Expand Up @@ -408,8 +408,8 @@ double_sign_check_height = 0
skip_timeout_commit = false

# EmptyBlocks mode and possible interval between empty blocks
create_empty_blocks = true
create_empty_blocks_interval = "0s"
create_empty_blocks = false
create_empty_blocks_interval = "30s"

# Reactor sleep duration parameters
peer_gossip_sleep_duration = "100ms"
Expand Down
10 changes: 5 additions & 5 deletions network/local/sequencer-2/config/genesis.json
Original file line number Diff line number Diff line change
Expand Up @@ -417,15 +417,15 @@
},
"mint": {
"minter": {
"inflation": "0.130000000000000000",
"inflation": "0.000000000000000000",
"annual_provisions": "0.000000000000000000"
},
"params": {
"mint_denom": "warptest",
"inflation_rate_change": "0.130000000000000000",
"inflation_max": "0.200000000000000000",
"inflation_min": "0.070000000000000000",
"goal_bonded": "0.670000000000000000",
"inflation_rate_change": "0.000000000000000000",
"inflation_max": "0.000000000000000000",
"inflation_min": "0.000000000000000000",
"goal_bonded": "1.000000000000000000",
"blocks_per_year": "6311520"
}
},
Expand Down
18 changes: 15 additions & 3 deletions utils/init-chain.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,6 @@ genOut() {

$SEQUENCER init warp-sequencer --chain-id $CHAIN_ID
$SEQUENCER config keyring-backend file

# Modify genesis.json
sed -i'' -e 's/"stake"/"warptest"/g' $HOME/$CONFIG_SUBDIR/genesis.json
}

gen() {
Expand Down Expand Up @@ -67,6 +64,20 @@ gen() {
log "Password: $1 : $PASSWORD"
}

replace() {
sed -i'' -e 's/"stake"/"warptest"/g' $TEMP_DIR/all/$CONFIG_SUBDIR/genesis.json
sed -i'' -e 's/"inflation": "0.130000000000000000",/"inflation": "0.000000000000000000",/g' $TEMP_DIR/all/$CONFIG_SUBDIR/genesis.json
sed -i'' -e 's/"inflation_rate_change": "0.130000000000000000",/"inflation_rate_change": "0.000000000000000000",/g' $TEMP_DIR/all/$CONFIG_SUBDIR/genesis.json
sed -i'' -e 's/"inflation_max": "0.200000000000000000",/"inflation_max": "0.000000000000000000",/g' $TEMP_DIR/all/$CONFIG_SUBDIR/genesis.json
sed -i'' -e 's/"inflation_min": "0.070000000000000000",/"inflation_min": "0.000000000000000000",/g' $TEMP_DIR/all/$CONFIG_SUBDIR/genesis.json
sed -i'' -e 's/"goal_bonded": "0.670000000000000000",/"goal_bonded": "1.000000000000000000",/g' $TEMP_DIR/all/$CONFIG_SUBDIR/genesis.json
sed -i'' -e 's/pex = true/pex = false/g' $TEMP_DIR/all/$CONFIG_SUBDIR/config.toml
sed -i'' -e 's/create_empty_blocks = true/create_empty_blocks = false/g' $TEMP_DIR/all/$CONFIG_SUBDIR/config.toml
sed -i'' -e 's/create_empty_blocks_interval = "0s"/create_empty_blocks_interval = "30s"/g' $TEMP_DIR/all/$CONFIG_SUBDIR/config.toml
# TODO: uncomment before going into production
# sed -i'' -e 's/skip_timeout_commit = false/skip_timeout_commit = true/g' $TEMP_DIR/all/$CONFIG_SUBDIR/config.toml
}

copy() {
cp $TEMP_DIR/all/$CONFIG_SUBDIR/*toml $REPO_DIR/network/local/$1/config
cp $TEMP_DIR/all/$CONFIG_SUBDIR/*json $REPO_DIR/network/local/$1/config
Expand All @@ -79,6 +90,7 @@ copy() {
run() {
# Out directory is only used for generating genesis.json
genOut
replace

# Initialize validators, each validator has its own directory
# this directory will later be used to run the validator node
Expand Down

0 comments on commit 79e6911

Please sign in to comment.