Skip to content

Commit

Permalink
Added Stride as v5 Host Zone (#576)
Browse files Browse the repository at this point in the history
Co-authored-by: Aidan Salzmann <[email protected]>
  • Loading branch information
sampocs and asalzmann authored Jan 14, 2023
1 parent 9a8b757 commit 2e461a3
Show file tree
Hide file tree
Showing 11 changed files with 308 additions and 92 deletions.
5 changes: 3 additions & 2 deletions dockernet/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,13 +72,14 @@ ST{CHAIN}_DENOM="st{min_denom}"
{CHAIN}_COIN_TYPE=${TYPE}_COIN_TYPE
{CHAIN}_RPC_PORT={the one included in the docker-compose above}
{CHAIN}_MAIN_CMD="${CHAIN}_CMD --home $DOCKERNET_HOME/state/${${CHAIN}_NODE_PREFIX}1"
{CHAIN}_RECEIVER_ADDRESS={any random address on the chain}
# Add *below* the RELAYER section!
RELAYER_{CHAIN}_EXEC="docker-compose run --rm relayer-{new-host-zone}"
RELAYER_{CHAIN}_ACCT=rly{add one since the account from the last host zone}
# NOTE: Update the HOST_RELAYER_ACCTS variable directly!
HOST_RELAYER_ACCTS=(... $RELAYER_{CHAIN}_ACCT)
# NOTE: Update the RELAYER_ACCTS variable directly!
RELAYER_ACCTS=(... $RELAYER_{CHAIN}_ACCT)
# stride1muwz5er4wq7svxnh5dgn2tssm92je5dwthxl7q
RELAYER_{CHAIN}_MNEMONIC="science depart where tell bus ski laptop follow child bronze rebel recall brief plug razor ship degree labor human series today embody fury harvest"
Expand Down
86 changes: 52 additions & 34 deletions dockernet/config.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,14 @@ HOST_CHAINS=()
# If no host zones are specified above:
# `start-docker` defaults to just GAIA if HOST_CHAINS is empty
# `start-docker-all` always runs all hosts
# Available host zones:
# - GAIA
# - JUNO
# - OSMO
# - STARS
# - HOST (Stride chain enabled as a host zone)
if [[ "${ALL_HOST_CHAINS:-false}" == "true" ]]; then
HOST_CHAINS=(GAIA JUNO OSMO STARS)
HOST_CHAINS=(GAIA OSMO HOST)
elif [[ "${#HOST_CHAINS[@]}" == "0" ]]; then
HOST_CHAINS=(GAIA)
fi
Expand All @@ -32,15 +38,17 @@ UPGRADE_NAME=""
UPGRADE_OLD_COMMIT_HASH=""

# DENOMS
ATOM_DENOM='uatom'
JUNO_DENOM='ujuno'
OSMO_DENOM='uosmo'
STRD_DENOM='ustrd'
STARS_DENOM='ustars'
ATOM_DENOM="uatom"
JUNO_DENOM="ujuno"
OSMO_DENOM="uosmo"
STRD_DENOM="ustrd"
STARS_DENOM="ustars"
WALK_DENOM="uwalk"
STATOM_DENOM="stuatom"
STJUNO_DENOM="stujuno"
STOSMO_DENOM="stuosmo"
STSTARS_DENOM="stustars"
STWALK_DENOM="stuwalk"

IBC_STRD_DENOM='ibc/FF6C2E86490C1C4FBBD24F55032831D2415B9D7882F85C3CC9C2401D79362BEA'

Expand All @@ -64,6 +72,11 @@ IBC_STARS_CHANNEL_1_DENOM='ibc/9222203B0B37D076F07B3CAC716533C80E7C4239499B6306C
IBC_STARS_CHANNEL_2_DENOM='ibc/C6469BA9DC791E65B3C1596CD2005941324C00659E2DF90D5E08D86B82E7E08B'
IBC_STARS_CHANNEL_3_DENOM='ibc/482A30C07803B0455B1492BAF94EC3D600E862D52A814F25A34BCCAAA132FEE9'

IBC_HOST_CHANNEL_0_DENOM='ibc/82DBA832457B89E1A344DA51761D92305F7581B7EA6C18D85037910988953C58'
IBC_HOST_CHANNEL_1_DENOM='ibc/FB7E2520A1ED6890E1632904A4ACA1B3D2883388F8E2B88F2D6A54AA15E4B49E'
IBC_HOST_CHANNEL_2_DENOM='ibc/D664DC1D38648FC4C697D9E9CF2D26369318DFE668B31F81809383A8A88CFCF4'
IBC_HOST_CHANNEL_3_DENOM='ibc/FD7AA7EB2C1D5D97A8693CCD71FFE3F5AFF12DB6756066E11E69873DE91A33EA'

# COIN TYPES
# Coin types can be found at https://github.com/satoshilabs/slips/blob/master/slip-0044.md
COSMOS_COIN_TYPE=118
Expand All @@ -83,6 +96,7 @@ STRIDE_EPOCH_EPOCH_DURATION="40s"
HOST_DAY_EPOCH_DURATION="60s"
HOST_HOUR_EPOCH_DURATION="60s"
HOST_WEEK_EPOCH_DURATION="60s"
HOST_MINT_EPOCH_DURATION="60s"
UNBONDING_TIME="120s"
MAX_DEPOSIT_PERIOD="30s"
VOTING_PERIOD="30s"
Expand Down Expand Up @@ -121,108 +135,109 @@ STRIDE_FEE_ADDRESS=stride1czvrk3jkvtj8m27kqsqu2yrkhw3h3ykwj3rxh6

# Binaries are contigent on whether we're doing an upgrade or not
if [[ "$UPGRADE_NAME" == "" ]]; then
STRIDE_CMD="$DOCKERNET_HOME/../build/strided"
STRIDE_BINARY="$DOCKERNET_HOME/../build/strided"
else
STRIDE_CMD="$UPGRADES/binaries/strided1"
STRIDE_BINARY="$UPGRADES/binaries/strided1"
fi
STRIDE_MAIN_CMD="$STRIDE_CMD --home $DOCKERNET_HOME/state/${STRIDE_NODE_PREFIX}1"
STRIDE_MAIN_CMD="$STRIDE_BINARY --home $DOCKERNET_HOME/state/${STRIDE_NODE_PREFIX}1"

# GAIA
GAIA_CHAIN_ID=GAIA
GAIA_NODE_PREFIX=gaia
GAIA_NUM_NODES=1
GAIA_CMD="$DOCKERNET_HOME/../build/gaiad"
GAIA_BINARY="$DOCKERNET_HOME/../build/gaiad"
GAIA_VAL_PREFIX=gval
GAIA_REV_ACCT=grev1
GAIA_ADDRESS_PREFIX=cosmos
GAIA_DENOM=$ATOM_DENOM
GAIA_RPC_PORT=26557
GAIA_COIN_TYPE=$COSMOS_COIN_TYPE
GAIA_MAIN_CMD="$GAIA_CMD --home $DOCKERNET_HOME/state/${GAIA_NODE_PREFIX}1"
GAIA_MAIN_CMD="$GAIA_BINARY --home $DOCKERNET_HOME/state/${GAIA_NODE_PREFIX}1"
GAIA_RECEIVER_ADDRESS='cosmos1g6qdx6kdhpf000afvvpte7hp0vnpzapuyxp8uf'

# JUNO
JUNO_CHAIN_ID=JUNO
JUNO_NODE_PREFIX=juno
JUNO_NUM_NODES=1
JUNO_CMD="$DOCKERNET_HOME/../build/junod"
JUNO_BINARY="$DOCKERNET_HOME/../build/junod"
JUNO_VAL_PREFIX=jval
JUNO_REV_ACCT=jrev1
JUNO_ADDRESS_PREFIX=juno
JUNO_DENOM=$JUNO_DENOM
JUNO_RPC_PORT=26457
JUNO_COIN_TYPE=$COSMOS_COIN_TYPE
JUNO_MAIN_CMD="$JUNO_CMD --home $DOCKERNET_HOME/state/${JUNO_NODE_PREFIX}1"
JUNO_MAIN_CMD="$JUNO_BINARY --home $DOCKERNET_HOME/state/${JUNO_NODE_PREFIX}1"
JUNO_RECEIVER_ADDRESS='juno1sy0q0jpaw4t3hnf6k5wdd4384g0syzlp7rrtsg'

# OSMO
OSMO_CHAIN_ID=OSMO
OSMO_NODE_PREFIX=osmo
OSMO_NUM_NODES=1
OSMO_CMD="$DOCKERNET_HOME/../build/osmosisd"
OSMO_BINARY="$DOCKERNET_HOME/../build/osmosisd"
OSMO_VAL_PREFIX=oval
OSMO_REV_ACCT=orev1
OSMO_ADDRESS_PREFIX=osmo
OSMO_DENOM=$OSMO_DENOM
OSMO_RPC_PORT=26357
OSMO_COIN_TYPE=$COSMOS_COIN_TYPE
OSMO_MAIN_CMD="$OSMO_CMD --home $DOCKERNET_HOME/state/${OSMO_NODE_PREFIX}1"
OSMO_MAIN_CMD="$OSMO_BINARY --home $DOCKERNET_HOME/state/${OSMO_NODE_PREFIX}1"
OSMO_RECEIVER_ADDRESS='osmo1w6wdc2684g9h3xl8nhgwr282tcxx4kl06n4sjl'

# STARS
STARS_CHAIN_ID=STARS
STARS_NODE_PREFIX=stars
STARS_NUM_NODES=1
STARS_CMD="$DOCKERNET_HOME/../build/starsd"
STARS_BINARY="$DOCKERNET_HOME/../build/starsd"
STARS_VAL_PREFIX=sgval
STARS_REV_ACCT=sgrev1
STARS_ADDRESS_PREFIX=stars
STARS_DENOM=$STARS_DENOM
STARS_RPC_PORT=26257
STARS_COIN_TYPE=$COSMOS_COIN_TYPE
STARS_MAIN_CMD="$STARS_CMD --home $DOCKERNET_HOME/state/${STARS_NODE_PREFIX}1"
STARS_MAIN_CMD="$STARS_BINARY --home $DOCKERNET_HOME/state/${STARS_NODE_PREFIX}1"
STARS_RECEIVER_ADDRESS='stars15dywcmy6gzsc8wfefkrx0c9czlwvwrjenqthyq'


# HERMES
HERMES_CMD="$DOCKERNET_HOME/../build/hermes/release/hermes --config $STATE/hermes/config.toml"
HERMES_EXEC="$DOCKER_COMPOSE run --rm hermes hermes"

HERMES_STRIDE_ACCT=hrly1
HERMES_GAIA_ACCT=hrly2
HERMES_JUNO_ACCT=hrly3
HERMES_OSMO_ACCT=hrly4
HERMES_STARS_ACCT=hrly5

HERMES_STRIDE_MNEMONIC="alter old invest friend relief slot swear pioneer syrup economy vendor tray focus hedgehog artist legend antenna hair almost donkey spice protect sustain increase"
HERMES_GAIA_MNEMONIC="resemble accident lake amateur physical jewel taxi nut demand magnet person blanket trip entire awkward fiber usual current index limb lady lady depart train"
HERMES_JUNO_MNEMONIC="uphold decorate moon memory taste century work pride force genius width ripple myself year steel ivory type sweet tree ignore danger pudding owner discover"
HERMES_OSMO_MNEMONIC="lawn inside color february double myth depart invite miracle nest silver spider spray recall theme loan exotic puzzle uncover dial young earn disagree fee"
HERMES_STARS_MNEMONIC="inherit shallow bargain explain fence vocal fury perfect jeans figure festival abstract soldier entry bubble ketchup swim useless doctor thing imitate can shock coin"
# HOST (Stride running as a host zone)
HOST_CHAIN_ID=HOST
HOST_NODE_PREFIX=host
HOST_NUM_NODES=1
HOST_BINARY="$DOCKERNET_HOME/../build/strided"
HOST_VAL_PREFIX=hval
HOST_ADDRESS_PREFIX=stride
HOST_REV_ACCT=hrev1
HOST_DENOM=$WALK_DENOM
HOST_COIN_TYPE=$COSMOS_COIN_TYPE
HOST_RPC_PORT=26157
HOST_MAIN_CMD="$HOST_BINARY --home $DOCKERNET_HOME/state/${HOST_NODE_PREFIX}1"
HOST_RECEIVER_ADDRESS='stride1trm75t8g83f26u4y8jfds7pms9l587a7q227k9'

# RELAYER
RELAYER_CMD="$DOCKERNET_HOME/../build/relayer --home $STATE/relayer"
RELAYER_GAIA_EXEC="$DOCKER_COMPOSE run --rm relayer-gaia"
RELAYER_JUNO_EXEC="$DOCKER_COMPOSE run --rm relayer-juno"
RELAYER_OSMO_EXEC="$DOCKER_COMPOSE run --rm relayer-osmo"
RELAYER_STARS_EXEC="$DOCKER_COMPOSE run --rm relayer-stars"
RELAYER_HOST_EXEC="$DOCKER_COMPOSE run --rm relayer-host"

RELAYER_STRIDE_ACCT=rly1
RELAYER_GAIA_ACCT=rly2
RELAYER_JUNO_ACCT=rly3
RELAYER_OSMO_ACCT=rly4
RELAYER_STARS_ACCT=rly5
HOST_RELAYER_ACCTS=($RELAYER_GAIA_ACCT $RELAYER_JUNO_ACCT $RELAYER_OSMO_ACCT $RELAYER_STARS_ACCT)
RELAYER_HOST_ACCT=rly6
RELAYER_ACCTS=($RELAYER_GAIA_ACCT $RELAYER_JUNO_ACCT $RELAYER_OSMO_ACCT $RELAYER_STARS_ACCT $RELAYER_HOST_ACCT)

RELAYER_GAIA_MNEMONIC="fiction perfect rapid steel bundle giant blade grain eagle wing cannon fever must humble dance kitchen lazy episode museum faith off notable rate flavor"
RELAYER_JUNO_MNEMONIC="kiwi betray topple van vapor flag decorate cement crystal fee family clown cry story gain frost strong year blanket remain grass pig hen empower"
RELAYER_OSMO_MNEMONIC="unaware wine ramp february bring trust leaf beyond fever inside option dilemma save know captain endless salute radio humble chicken property culture foil taxi"
RELAYER_STARS_MNEMONIC="deposit dawn erosion talent old broom flip recipe pill hammer animal hill nice ten target metal gas shoe visual nephew soda harbor child simple"
RELAYER_HOST_MNEMONIC="renew umbrella teach spoon have razor knee sock divert inner nut between immense library inhale dog truly return run remain dune virus diamond clinic"
RELAYER_MNEMONICS=(
"$RELAYER_GAIA_MNEMONIC"
"$RELAYER_JUNO_MNEMONIC"
"$RELAYER_OSMO_MNEMONIC"
"$RELAYER_STARS_MNEMONIC"
"$RELAYER_HOST_MNEMONIC"
)

STRIDE_ADDRESS() {
Expand All @@ -240,6 +255,9 @@ OSMO_ADDRESS() {
STARS_ADDRESS() {
$STARS_MAIN_CMD keys show ${STARS_VAL_PREFIX}1 --keyring-backend test -a
}
HOST_ADDRESS() {
$HOST_MAIN_CMD keys show ${HOST_VAL_PREFIX}1 --keyring-backend test -a
}

CSLEEP() {
for i in $(seq $1); do
Expand Down
22 changes: 22 additions & 0 deletions dockernet/config/relayer_config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,20 @@ chains:
timeout: 20s
output-format: json
sign-mode: direct
host:
type: cosmos
value:
key: rly6
chain-id: HOST
rpc-addr: http://host1:26657
account-prefix: stride
keyring-backend: test
gas-adjustment: 1.2
gas-prices: 0.01uwalk
debug: false
timeout: 20s
output-format: json
sign-mode: direct
# {new-host-zone}:
# type: cosmos
# value:
Expand Down Expand Up @@ -122,6 +136,14 @@ paths:
src-channel-filter:
rule: ""
channel-list: []
stride-host:
src:
chain-id: STRIDE
dst:
chain-id: HOST
src-channel-filter:
rule: ""
channel-list: []
# stride-{new-host-zone}:
# src:
# chain-id: STRIDE
Expand Down
37 changes: 37 additions & 0 deletions dockernet/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,36 @@ services:
image: stridezone:stars
volumes:
- ./state/stars5:/home/stars/.starsd

host1:
image: stridezone:stride
volumes:
- ./state/host1:/home/stride/.stride
ports:
- "26157:26657"
- "1267:1317"
- "9040:9090"

host2:
image: stridezone:stride
volumes:
- ./state/host2:/home/stride/.stride

host3:
image: stridezone:stride
volumes:
- ./state/host3:/home/stride/.stride

host4:
image: stridezone:stride
volumes:
- ./state/host4:/home/stride/.stride

host5:
image: stridezone:stride
volumes:
- ./state/host5:/home/stride/.stride

# Fill in new host zone being tested here

hermes:
Expand Down Expand Up @@ -170,3 +200,10 @@ services:
- ./state/relayer-stars:/home/relayer/.relayer
restart: always
command: [ "bash", "start.sh", "stride-stars" ]

relayer-host:
image: stridezone:relayer
volumes:
- ./state/relayer-host:/home/relayer/.relayer
restart: always
command: [ "bash", "start.sh", "stride-host" ]
Loading

0 comments on commit 2e461a3

Please sign in to comment.