Skip to content

Commit

Permalink
upgrade to V0.36.1 (#27)
Browse files Browse the repository at this point in the history
* upgrade docker images and script for v0.36.1

* some breaking changes in env and docker compose files
  • Loading branch information
0x4r45h authored May 23, 2024
1 parent dc37f71 commit fe34a59
Show file tree
Hide file tree
Showing 15 changed files with 236 additions and 205 deletions.
6 changes: 4 additions & 2 deletions .env.sample
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
# Example env file
EXTIP=''
EXTERNAL_IP=0.0.0.0
P2P_PORT=28658
SERVE_PORT=48123
RPC_PORT=26657
NAMADA_TAG=v0.32.1
NAMADA_TAG=v0.36.1
# set genesis start date from current date in seconds
GENESIS_DELAY=5

# Hermes
HERMES_TAG=1.7.4-namada-long-memo
Expand Down
16 changes: 5 additions & 11 deletions README.MD
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,6 @@ There are a bunch of [blog posts](https://mirror.xyz/0xe4e0B45aa2b06Df651337E351
- Docker (or Docker Desktop on Windows/Mac)
---

# Caution!
There is bug in version v0.31.6 for connecting to default node, for all commands that needs to connect to a node you have to explicitly pass `--node http://0.0.0.0:26657`.
for example :
```shell
namadac balance --node http://0.0.0.0:26657
```
# Important!
IF YOU ARE UPGRADING THIS PACKAGE FROM OLDER VERSIONS MAKE SURE CORRECT NAMADA VERSIONS ARE SET IN YOUR `.env` FILE.
you can always find the latest version supported packages in the `.env.sample` package
Expand All @@ -32,25 +26,25 @@ cp .env.sample .env
Pull images from docker hub or build them from scratch.
To pull images do
```shell
docker compose pull
docker compose --profile main pull
```
Or, build images from the dockerfile (takes more time and requires a lot of resources) :

```shell
docker compose build
docker compose --profile main build
```

# Run The Network

To start the blockchain with 3 validators
```shell
docker compose up -d
docker compose --profile main up -d
```
for the first time launching it give it 1-2 min to download necessary files and setup the chain. then you can use it

#### Check logs
```shell
docker compose logs -f
docker compose --profile main logs -f
```
#### Execute commands
exec into one of the validators , e.g.
Expand Down Expand Up @@ -116,7 +110,7 @@ Click Load Unpacked and point to the `extensions/chrome` in this project
# Tear Down
To remove everything
```shell
docker compose --profile hermes --profile interface down -v -t 0
docker compose --profile main --profile hermes --profile interface down -v -t 0
```

# Know Issues
Expand Down
23 changes: 16 additions & 7 deletions config/genesis-chain-b/parameters.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# General protocol parameters.
[parameters]
native_token = "NAM"
is_native_token_transferable = true
# Minimum number of blocks in an epoch.
min_num_of_blocks = 4
# Maximum expected time per block (in seconds).
Expand All @@ -16,15 +17,14 @@ tx_allowlist = []
# Implicit VP WASM name
implicit_vp = "vp_implicit"
# Expected number of epochs per year (also sets the min duration of an epoch in seconds)
epochs_per_year = 31536
# NOTE: use longer epochs for testing hermes, e.g. 31_536
epochs_per_year = 31_536
# Maximum number of signature per transaction
max_signatures_per_transaction = 15
# Max gas for block
max_block_gas = 20000000
# Fee unshielding gas limit
fee_unshielding_gas_limit = 20000
# Fee unshielding descriptions limit
fee_unshielding_descriptions_limit = 15

# Map of the cost per gas unit for every token allowed for fee payment
[parameters.minimum_gas_price]
Expand Down Expand Up @@ -80,13 +80,15 @@ min_proposal_fund = 500
# proposal code size in bytes
max_proposal_code_size = 600000
# min proposal period length in epochs
min_proposal_voting_period = 3
min_proposal_voting_period = 2
# max proposal period length in epochs
max_proposal_period = 27
# maximum number of characters in the proposal content
max_proposal_content_size = 10000
# minimum epochs between end and grace epoch
min_proposal_grace_epochs = 6
# minimum epochs between end and activation epoch
min_proposal_grace_epochs = 2
# maximum number of epochs between current epoch and start epoch
max_proposal_latency = 30

# Public goods funding parameters
[pgf_params]
Expand All @@ -95,4 +97,11 @@ stewards = []
# The pgf funding inflation rate
pgf_inflation_rate = "0.1"
# The pgf stewards inflation rate
stewards_inflation_rate = "0.01"
stewards_inflation_rate = "0.01"

# IBC parameters
[ibc_params]
# default mint limit of each token
default_mint_limit = "0"
# default per-epoch throughput limit of each token
default_per_epoch_throughput_limit = "0"
21 changes: 11 additions & 10 deletions config/genesis-chain-b/tokens.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,18 @@
[token.NAM]
denom = 6

[token.NAM.parameters]
max_reward_rate = "0.1"
kd_gain_nom = "0.1"
kp_gain_nom = "0.1"
locked_ratio_target = "0.6667"
[token.NAM.masp_params]
max_reward_rate = "0.01"
kd_gain_nom = "0.25"
kp_gain_nom = "0.25"
locked_amount_target = 10000


[token.ETH]
denom = 18

[token.ETH.parameters]
max_reward_rate = "0.1"
kd_gain_nom = "0.1"
kp_gain_nom = "0.1"
locked_ratio_target = "0.6667"
[token.ETH.masp_params]
max_reward_rate = "0.01"
kd_gain_nom = "0.25"
kp_gain_nom = "0.25"
locked_amount_target = 10000
1 change: 1 addition & 0 deletions config/genesis/balances.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Genesis token balances to be added here during startup
# note that addresses will be automatically populated during the first run of containers

[token.NAM]

Expand Down
21 changes: 15 additions & 6 deletions config/genesis/parameters.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# General protocol parameters.
[parameters]
native_token = "NAM"
is_native_token_transferable = true
# Minimum number of blocks in an epoch.
min_num_of_blocks = 4
# Maximum expected time per block (in seconds).
Expand All @@ -16,15 +17,14 @@ tx_allowlist = []
# Implicit VP WASM name
implicit_vp = "vp_implicit"
# Expected number of epochs per year (also sets the min duration of an epoch in seconds)
epochs_per_year = 31536
# NOTE: use longer epochs for testing hermes, e.g. 31_536
epochs_per_year = 31_536_000
# Maximum number of signature per transaction
max_signatures_per_transaction = 15
# Max gas for block
max_block_gas = 20000000
# Fee unshielding gas limit
fee_unshielding_gas_limit = 20000
# Fee unshielding descriptions limit
fee_unshielding_descriptions_limit = 15

# Map of the cost per gas unit for every token allowed for fee payment
[parameters.minimum_gas_price]
Expand Down Expand Up @@ -82,11 +82,13 @@ max_proposal_code_size = 600000
# min proposal period length in epochs
min_proposal_voting_period = 2
# max proposal period length in epochs
max_proposal_period = 6
max_proposal_period = 27
# maximum number of characters in the proposal content
max_proposal_content_size = 10000
# minimum epochs between end and grace epoch
# minimum epochs between end and activation epoch
min_proposal_grace_epochs = 2
# maximum number of epochs between current epoch and start epoch
max_proposal_latency = 30

# Public goods funding parameters
[pgf_params]
Expand All @@ -95,4 +97,11 @@ stewards = ["steward-1"]
# The pgf funding inflation rate
pgf_inflation_rate = "0.1"
# The pgf stewards inflation rate
stewards_inflation_rate = "0.01"
stewards_inflation_rate = "0.01"

# IBC parameters
[ibc_params]
# default mint limit of each token
default_mint_limit = "0"
# default per-epoch throughput limit of each token
default_per_epoch_throughput_limit = "0"
70 changes: 35 additions & 35 deletions config/genesis/tokens.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,62 +3,62 @@
[token.NAM]
denom = 6

[token.NAM.parameters]
max_reward_rate = "0.1"
kd_gain_nom = "0.1"
kp_gain_nom = "0.1"
locked_ratio_target = "0.6667"
[token.NAM.masp_params]
max_reward_rate = "0.01"
kd_gain_nom = "0.25"
kp_gain_nom = "0.25"
locked_amount_target = 10000

[token.BTC]
denom = 8

[token.BTC.parameters]
max_reward_rate = "0.1"
kd_gain_nom = "0.1"
kp_gain_nom = "0.1"
locked_ratio_target = "0.6667"
[token.BTC.masp_params]
max_reward_rate = "0.01"
kd_gain_nom = "0.25"
kp_gain_nom = "0.25"
locked_amount_target = 10000

[token.ETH]
denom = 18

[token.ETH.parameters]
max_reward_rate = "0.1"
kd_gain_nom = "0.1"
kp_gain_nom = "0.1"
locked_ratio_target = "0.6667"
[token.ETH.masp_params]
max_reward_rate = "0.01"
kd_gain_nom = "0.25"
kp_gain_nom = "0.25"
locked_amount_target = 10000

[token.DOT]
denom = 10

[token.DOT.parameters]
max_reward_rate = "0.1"
kd_gain_nom = "0.1"
kp_gain_nom = "0.1"
locked_ratio_target = "0.6667"
[token.DOT.masp_params]
max_reward_rate = "0.01"
kd_gain_nom = "0.25"
kp_gain_nom = "0.25"
locked_amount_target = 10000

[token.Schnitzel]
denom = 6

[token.Schnitzel.parameters]
max_reward_rate = "0.1"
kd_gain_nom = "0.1"
kp_gain_nom = "0.1"
locked_ratio_target = "0.6667"
[token.Schnitzel.masp_params]
max_reward_rate = "0.01"
kd_gain_nom = "0.25"
kp_gain_nom = "0.25"
locked_amount_target = 10000

[token.Apfel]
denom = 6

[token.Apfel.parameters]
max_reward_rate = "0.1"
kd_gain_nom = "0.1"
kp_gain_nom = "0.1"
locked_ratio_target = "0.6667"
[token.Apfel.masp_params]
max_reward_rate = "0.01"
kd_gain_nom = "0.25"
kp_gain_nom = "0.25"
locked_amount_target = 10000

[token.Kartoffel]
denom = 6

[token.Kartoffel.parameters]
max_reward_rate = "0.1"
kd_gain_nom = "0.1"
kp_gain_nom = "0.1"
locked_ratio_target = "0.6667"
[token.Kartoffel.masp_params]
max_reward_rate = "0.01"
kd_gain_nom = "0.25"
kp_gain_nom = "0.25"
locked_amount_target = 10000
3 changes: 0 additions & 3 deletions config/genesis/validity-predicates.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,3 @@ filename = "vp_implicit.wasm"
[wasm.vp_user]
filename = "vp_user.wasm"

# Token VP
[wasm.vp_token]
filename = "vp_token.wasm"
2 changes: 0 additions & 2 deletions config/hermes/start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@ while true; do
sleep 5
fi
done
#export CHAIN_A_ID=$(curl -s namada-1:26657/status | jq '.result.node_info.network' | sed 's/"//g')
#export CHAIN_B_ID=$(curl -s chain-b:26657/status | jq '.result.node_info.network' | sed 's/"//g')
export CHAIN_A_NAM_ADDR=$(awk 'NR==1' /root/.namada-shared/tokens-addresses)
export CHAIN_B_NAM_ADDR=$(awk 'NR==1' /root/.namada-shared/chain-b-token-addrs)
export HERMES_CONFIG=/root/.hermes/config.toml
Expand Down
12 changes: 9 additions & 3 deletions config/make_balances.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
#!/usr/bin/env python3
import os
import sys
import toml
import os
import re

validator_directory = sys.argv[1]
balances_toml = sys.argv[2]
output_toml_path = sys.argv[3]

balances_config = {}

Expand All @@ -19,6 +19,7 @@
if len(toml_files) == 1:
toml_file_path = os.path.join(subdir_path, toml_files[0])
transactions_toml = toml.load(toml_file_path)
# add a new item to balances config with this alias
balances_config[alias] = []
try:
address = transactions_toml['validator_account'][0]['address']
Expand All @@ -30,6 +31,7 @@
balances_config[alias].append(address)
except (KeyError, IndexError) as e:
pass

output_toml = toml.load(balances_toml)
ACCOUNT_AMOUNT = "220000000000"
FAUCET_AMOUNT = "9123372036854000000"
Expand All @@ -42,4 +44,8 @@
else:
output_toml['token'][token][addr] = ACCOUNT_AMOUNT

print(toml.dumps(output_toml))
toml_content = toml.dumps(output_toml)
# Write the TOML content to the file
with open(output_toml_path, 'w') as file:
file.write(toml_content)
print(toml_content)
Loading

0 comments on commit fe34a59

Please sign in to comment.