Skip to content

Commit

Permalink
Merge pull request #1623 from anoma/bengt/fix-build-network-2
Browse files Browse the repository at this point in the history
build_network works with default args
  • Loading branch information
bengtlofgren authored Jun 28, 2023
2 parents fdeaf23 + 4a4d365 commit ce6abb0
Showing 1 changed file with 8 additions and 10 deletions.
18 changes: 8 additions & 10 deletions scripts/build_network.sh
Original file line number Diff line number Diff line change
Expand Up @@ -137,10 +137,10 @@ validate_arguments() {
check_wasm_files

if [ "$#" -eq 2 ]; then
BASE_DIR=$($NAMADA_BIN_DIR/namadac utils default-base-dir)
BASE_DIR="$($NAMADA_BIN_DIR/namadac utils default-base-dir)"
echo "Using default BASE_DIR: $BASE_DIR"
else [ "$#" -eq 3 ];
BASE_DIR=$3
BASE_DIR="$3"
fi
}

Expand All @@ -156,7 +156,7 @@ package() {

ALIAS='validator-local-dev'

$NAMADA_BIN_DIR/namadac --base-dir $BASE_DIR utils init-genesis-validator \
$NAMADA_BIN_DIR/namadac --base-dir "$BASE_DIR" utils init-genesis-validator \
--alias $ALIAS \
--net-address 127.0.0.1:26656 \
--commission-rate 0.1 \
Expand All @@ -166,13 +166,13 @@ package() {
# get the directory of this script
SCRIPT_DIR="$(dirname $0)"
NAMADA_NETWORK_CONFIG_PATH="${CHAIN_DIR}/network-config-processed.toml"
$SCRIPT_DIR/utils/add_validator_shard.py $BASE_DIR/pre-genesis/$ALIAS/validator.toml $NETWORK_CONFIG_PATH >$NAMADA_NETWORK_CONFIG_PATH
$SCRIPT_DIR/utils/add_validator_shard.py "$BASE_DIR"/pre-genesis/$ALIAS/validator.toml $NETWORK_CONFIG_PATH >$NAMADA_NETWORK_CONFIG_PATH

python3 wasm/checksums.py

NAMADA_CHAIN_PREFIX='local'

$NAMADA_BIN_DIR/namadac --base-dir $BASE_DIR utils init-network \
$NAMADA_BIN_DIR/namadac --base-dir "$BASE_DIR" utils init-network \
--chain-prefix "$NAMADA_CHAIN_PREFIX" \
--genesis-path "$NAMADA_NETWORK_CONFIG_PATH" \
--wasm-checksums-path wasm/checksums.json \
Expand All @@ -189,15 +189,15 @@ package() {
export NAMADA_NETWORK_CONFIGS_SERVER='http://localhost:8123'
nohup bash -c "python3 -m http.server --directory ${CHAIN_DIR} 8123 &" &&
sleep 2 &&
$NAMADA_BIN_DIR/namadac --base-dir $BASE_DIR utils join-network \
$NAMADA_BIN_DIR/namadac --base-dir "$BASE_DIR" utils join-network \
--genesis-validator "$ALIAS" \
--chain-id "${NAMADA_CHAIN_ID}" \
--dont-prefetch-wasm

cp wasm/*.wasm "$BASE_DIR/${NAMADA_CHAIN_ID}/wasm/"
cp wasm/checksums.json "$BASE_DIR/${NAMADA_CHAIN_ID}/wasm/"

tar -cvzf "${NAMADA_CHAIN_ID}.prebuilt.tar.gz" $BASE_DIR
tar -cvzf "${NAMADA_CHAIN_ID}.prebuilt.tar.gz" "$BASE_DIR"
mv "${NAMADA_CHAIN_ID}.prebuilt.tar.gz" $CHAIN_DIR

git checkout --ours -- wasm/checksums.json
Expand All @@ -217,6 +217,4 @@ main() {
package "$@"
}


main "$@"

main "$@"

0 comments on commit ce6abb0

Please sign in to comment.