-
Notifications
You must be signed in to change notification settings - Fork 214
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 #676 from lavanet/CNS-remove-ignite-dep
CNSremove ignite dep
- Loading branch information
Showing
7 changed files
with
139 additions
and
94 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
#!/usr/bin/env python3 | ||
|
||
import json | ||
import toml | ||
|
||
# Specify the file path, field to edit, and new value | ||
path = '/home/user/.lava/config/' | ||
genesis = 'genesis.json' | ||
config = 'config.toml' | ||
|
||
# Load the JSON file | ||
with open(path + genesis, 'r') as file: | ||
data = json.load(file) | ||
|
||
data["app_state"]["gov"]["deposit_params"]["min_deposit"][0]["denom"] = "ulava" | ||
data["app_state"]["gov"]["deposit_params"]["min_deposit"][0]["amount"] = "10000000" | ||
data["app_state"]["gov"]["voting_params"]["voting_period"] = "3s" | ||
data["app_state"]["mint"]["params"]["mint_denom"] = "ulava" | ||
data["app_state"]["staking"]["params"]["bond_denom"] = "ulava" | ||
data["app_state"]["crisis"]["constant_fee"]["denom"] = "ulava" | ||
|
||
# Save the changes back to the JSON file | ||
with open(path + genesis, 'w') as file: | ||
json.dump(data, file, indent=4) | ||
|
||
|
||
|
||
# Step 1: Read the contents of the .toml file | ||
with open(path + config, 'r') as file: | ||
data = toml.load(file) | ||
|
||
# Step 2: Modify the content as required | ||
data["consensus"]["timeout_propose"] = "1s" | ||
data["consensus"]["timeout_propose_delta"] = "500ms" | ||
data["consensus"]["timeout_prevote"] = "1s" | ||
data["consensus"]["timeout_prevote_delta"] = "500ms" | ||
data["consensus"]["timeout_propose"] = "1s" | ||
data["consensus"]["timeout_precommit"] = "500ms" | ||
data["consensus"]["timeout_precommit_delta"] = "1s" | ||
data["consensus"]["timeout_commit"] = "1s" | ||
|
||
# Step 3: Write the updated content back to the .toml file | ||
with open(path + config, 'w') as file: | ||
toml.dump(data, file) |
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,54 @@ | ||
#!/bin/bash | ||
# make install | ||
|
||
rm -rf ~/.lava | ||
lavad init validator | ||
|
||
lavad config broadcast-mode block | ||
lavad config keyring-backend test | ||
|
||
# Specify the file path, field to edit, and new value | ||
path="$HOME/.lava/config/" | ||
genesis='genesis.json' | ||
config='config.toml' | ||
app='app.toml' | ||
|
||
# Edit genesis file | ||
data=$(cat "$path$genesis" \ | ||
| jq '.app_state.gov.deposit_params.min_deposit[0].denom = "ulava"' \ | ||
| jq '.app_state.gov.deposit_params.min_deposit[0].amount = "10000000"' \ | ||
| jq '.app_state.gov.voting_params.voting_period = "3s"' \ | ||
| jq '.app_state.mint.params.mint_denom = "ulava"' \ | ||
| jq '.app_state.staking.params.bond_denom = "ulava"' \ | ||
| jq '.app_state.crisis.constant_fee.denom = "ulava"' \ | ||
) | ||
|
||
echo -n "$data" > "$path$genesis" | ||
|
||
# Edit conflict.toml file | ||
sed -i "$path$config" \ | ||
-e 's/timeout_propose = .*/timeout_propose = "1s"/' \ | ||
-e 's/timeout_propose_delta = .*/timeout_propose_delta = "500ms"/' \ | ||
-e 's/timeout_prevote = .*/timeout_prevote = "1s"/' \ | ||
-e 's/timeout_prevote_delta = .*/timeout_prevote_delta = "500ms"/' \ | ||
-e 's/timeout_precommit = .*/timeout_precommit = "500ms"/' \ | ||
-e 's/timeout_precommit_delta = .*/timeout_precommit_delta = "1s"/' \ | ||
-e 's/timeout_commit = .*/timeout_commit = "1s"/' \ | ||
-e 's/skip_timeout_commit = .*/skip_timeout_commit = false/' | ||
|
||
# Edit app.toml file | ||
sed -i "$path$app" \ | ||
-e 's/enable = .*/enable = true/' | ||
|
||
|
||
# Add users | ||
users=("alice" "bob" "user1" "user2" "user3" "user4" "servicer1" "servicer2" "servicer3" "servicer4" "servicer5" "servicer6" "servicer7" "servicer8" "servicer9" "servicer10") | ||
|
||
for user in "${users[@]}"; do | ||
lavad keys add "$user" | ||
lavad add-genesis-account "$user" 50000000000000ulava | ||
done | ||
|
||
lavad gentx alice 100000000000ulava --chain-id lava | ||
lavad collect-gentxs | ||
lavad start |
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
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