Skip to content

Commit

Permalink
ci: fix chaosnet build
Browse files Browse the repository at this point in the history
  • Loading branch information
k-yang committed Dec 14, 2023
1 parent 0357f92 commit ead15eb
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 12 deletions.
4 changes: 4 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
temp/
build/
dist/
*.md
4 changes: 2 additions & 2 deletions contrib/docker-compose/docker-compose-chaosnet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -197,8 +197,8 @@ services:
environment:
NODE: nibiru-0:9090
MNEMONIC: undo donkey arena rule old portion long forget rescue post stuff normal reduce raw unable warrior method stairs valley enhance glory lens sign zero
SEND_COINS: 11000000unibi,100000000unusd,100000000uusdt
MAX_SEND_COINS: 110000000unibi,1000000000unusd,1000000000uusdt
SEND_COINS: 11000000unibi
MAX_SEND_COINS: 110000000unibi
depends_on:
nibiru-0:
condition: service_healthy
Expand Down
21 changes: 11 additions & 10 deletions contrib/scripts/chaosnet.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ set -e

# Set localnet settings
MNEMONIC=${MNEMONIC:-"guard cream sadness conduct invite crumble clock pudding hole grit liar hotel maid produce squeeze return argue turtle know drive eight casino maze host"}
VAL_ADDR="nibi1zaavvzxez0elundtn32qnk9lkm8kmcsz44g7xl"
CHAIN_ID=${CHAIN_ID:-"nibiru-localnet-0"}
LCD_PORT=${LCD_PORT:-"1317"}
GRPC_PORT=${GRPC_PORT:-"9090"}
Expand Down Expand Up @@ -60,37 +59,39 @@ add_genesis_perp_markets_with_coingecko_prices() {
return 1
fi

nibid genesis add-genesis-perp-market --pair=ubtc:unusd --sqrt-depth=$reserve_amt --price-multiplier=$price_btc
nibid genesis add-genesis-perp-market --pair=ubtc:unusd --sqrt-depth=$reserve_amt --price-multiplier=$price_btc --oracle-pair=ubtc:uusd

price_eth=$(cat tmp_market_prices.json | jq -r '.ethereum.usd')
price_eth=${price_eth%.*}
if [ -z "$price_eth" ]; then
return 1
fi

nibid genesis add-genesis-perp-market --pair=ueth:unusd --sqrt-depth=$reserve_amt --price-multiplier=$price_eth
nibid genesis add-genesis-perp-market --pair=ueth:unusd --sqrt-depth=$reserve_amt --price-multiplier=$price_eth --oracle-pair=ueth:uusd
}

add_genesis_perp_markets_with_coingecko_prices

# recover mnemonic
echo "$MNEMONIC" | nibid keys add validator --recover
nibid genesis add-genesis-account $(nibid keys show validator -a) "10000000000000unibi"

# x/sudo
add_genesis_param ".app_state.sudo.sudoers.root = \"$VAL_ADDR\""
add_genesis_param ".app_state.sudo.sudoers.root = \"$(nibid keys show validator -a)\""

# x/oracle
add_genesis_param '.app_state.oracle.params.twap_lookback_window = "900s"'
add_genesis_param '.app_state.oracle.params.vote_period = "10"'
add_genesis_param '.app_state.oracle.params.min_voters = "1"'
nibid genesis add-genesis-pricefeeder-delegation --validator $(nibid keys show validator -a --bech val) --pricefeeder nibi19n0clnacpjv0d3t8evvzp3fptlup9srjdqunzs

# ------------------------------------------------------------------------
# Start Network
# genesis accounts and balances
# ------------------------------------------------------------------------

echo "$MNEMONIC" | nibid keys add validator --recover
nibid genesis add-genesis-account $(nibid keys show validator -a) "10000000000000unibi,10000000000000unusd,10000000000000uusdt,10000000000000uusdc"
nibid genesis add-genesis-account nibi1wx9360p9rvy9m5cdhsua6qpdf9ktvwhjqw949s "10000000000000unibi,10000000000000unusd,10000000000000uusdt,10000000000000uusdc" # faucet
nibid genesis add-genesis-account nibi1wx9360p9rvy9m5cdhsua6qpdf9ktvwhjqw949s "10000000000000unibi" # faucet
nibid genesis add-genesis-account nibi1g7vzqfthhf4l4vs6skyjj27vqhe97m5gp33hxy "10000000000000unibi" # liquidator
nibid genesis add-genesis-account nibi19n0clnacpjv0d3t8evvzp3fptlup9srjdqunzs "10000000000000unibi" # pricefeeder

# gen_txs
nibid genesis gentx validator 900000000unibi --chain-id $CHAIN_ID
nibid genesis collect-gentxs
nibid genesis add-genesis-pricefeeder-delegation --validator $(nibid keys show validator -a --bech val) --pricefeeder nibi19n0clnacpjv0d3t8evvzp3fptlup9srjdqunzs

0 comments on commit ead15eb

Please sign in to comment.