Skip to content

Commit a207bab

Browse files
committed
fix(tools): send chain metadata url from upgrade testing
Signed-off-by: Artur Troian <[email protected]>
1 parent b756ba4 commit a207bab

File tree

2 files changed

+12
-16
lines changed

2 files changed

+12
-16
lines changed

make/test-upgrade.mk

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,11 @@ SNAPSHOT_SOURCE ?= sandbox
2525

2626
ifeq ($(SNAPSHOT_SOURCE),mainnet)
2727
SNAPSHOT_NETWORK := akashnet-2
28+
CHAIN_METADATA_URL := https://raw.githubusercontent.com/akash-network/net/master/mainnet/meta.json
2829
else
2930
ifeq ($(SNAPSHOT_SOURCE),sandbox)
3031
SNAPSHOT_NETWORK := sandbox-01
32+
CHAIN_METADATA_URL := https://raw.githubusercontent.com/akash-network/net/master/sandbox/meta.json
3133
else
3234
$(error "invalid snapshot source $(SNAPSHOT_SOURCE)")
3335
endif
@@ -44,6 +46,7 @@ $(AKASH_INIT):
4446
--ufrom=$(UPGRADE_FROM) \
4547
--uto=$(UPGRADE_TO) \
4648
--config="$(PWD)/config.json" \
49+
--chain-meta=$(CHAIN_METADATA_URL) \
4750
--state-config=$(STATE_CONFIG) \
4851
--snapshot-url=$(SNAPSHOT_URL) init
4952
touch $@
@@ -66,20 +69,20 @@ test: init
6669

6770
.PHONY: test-reset
6871
test-reset:
69-
$(ROOT_DIR)/script/upgrades.sh --workdir=$(AP_RUN_DIR) --config="$(PWD)/config.json" --uto=$(UPGRADE_TO) --snapshot-url=$(SNAPSHOT_URL) clean
70-
#$(ROOT_DIR)/script/upgrades.sh --workdir=$(AP_RUN_DIR) --config="$(PWD)/config.json" --uto=$(UPGRADE_TO) --snapshot-url=$(SNAPSHOT_URL) --gbv=$(GENESIS_BINARY_VERSION) bins
71-
$(ROOT_DIR)/script/upgrades.sh --workdir=$(AP_RUN_DIR) --config="$(PWD)/config.json" --uto=$(UPGRADE_TO) --snapshot-url=$(SNAPSHOT_URL) keys
72-
$(ROOT_DIR)/script/upgrades.sh --workdir=$(AP_RUN_DIR) --config="$(PWD)/config.json" --state-config=$(STATE_CONFIG) --snapshot-url=$(SNAPSHOT_URL) prepare-state
72+
$(ROOT_DIR)/script/upgrades.sh --workdir=$(AP_RUN_DIR) --config="$(PWD)/config.json" --uto=$(UPGRADE_TO) --snapshot-url=$(SNAPSHOT_URL) --chain-meta=$(CHAIN_METADATA_URL) clean
73+
#$(ROOT_DIR)/script/upgrades.sh --workdir=$(AP_RUN_DIR) --config="$(PWD)/config.json" --uto=$(UPGRADE_TO) --snapshot-url=$(SNAPSHOT_URL) --gbv=$(GENESIS_BINARY_VERSION) --chain-meta=$(CHAIN_METADATA_URL) bins
74+
$(ROOT_DIR)/script/upgrades.sh --workdir=$(AP_RUN_DIR) --config="$(PWD)/config.json" --uto=$(UPGRADE_TO) --snapshot-url=$(SNAPSHOT_URL) --chain-meta=$(CHAIN_METADATA_URL) keys
75+
$(ROOT_DIR)/script/upgrades.sh --workdir=$(AP_RUN_DIR) --config="$(PWD)/config.json" --state-config=$(STATE_CONFIG) --snapshot-url=$(SNAPSHOT_URL) --chain-meta=$(CHAIN_METADATA_URL) prepare-state
7376

7477
.PHONY: prepare-state
7578
prepare-state:
76-
$(ROOT_DIR)/script/upgrades.sh --workdir=$(AP_RUN_DIR) --config="$(PWD)/config.json" --state-config=$(STATE_CONFIG) prepare-state
79+
$(ROOT_DIR)/script/upgrades.sh --workdir=$(AP_RUN_DIR) --config="$(PWD)/config.json" --state-config=$(STATE_CONFIG) --chain-meta=$(CHAIN_METADATA_URL) prepare-state
7780

7881
.PHONY: bins
7982
bins:
8083
ifneq ($(findstring build,$(SKIP)),build)
8184
bins:
82-
$(ROOT_DIR)/script/upgrades.sh --workdir=$(AP_RUN_DIR) --config="$(PWD)/config.json" --uto=$(UPGRADE_TO) bins
85+
$(ROOT_DIR)/script/upgrades.sh --workdir=$(AP_RUN_DIR) --config="$(PWD)/config.json" --uto=$(UPGRADE_TO) --chain-meta=$(CHAIN_METADATA_URL) bins
8386
endif
8487

8588
.PHONY: clean

script/upgrades.sh

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -445,16 +445,12 @@ function prepare_state() {
445445
pushd "$(pwd)"
446446
cd "${valdir}"
447447

448-
cp -r "${validators_dir}/.akash0/data" ./
449-
450-
pushd "$(pwd)"
451-
452-
cd "config"
448+
rm -f "config/genesis.json"
453449

454-
ln -snf "../../.akash0/config/genesis.json" "genesis.json"
450+
cp -r "${validators_dir}/.akash0/data" ./
451+
cp -snf "${validators_dir}/.akash0/config/genesis.json" "config/genesis.json"
455452

456453
popd
457-
popd
458454
fi
459455

460456
((cnt++)) || true
@@ -485,9 +481,6 @@ function clean() {
485481
rm -rf "$cosmovisor_dir/current"
486482
rm -rf "$cosmovisor_dir/upgrades/${UPGRADE_TO}/upgrade-info.json"
487483

488-
# mkdir -p "$valdir/data"
489-
# echo '{"height":"0","round": 0,"step": 0}' | jq > "$valdir/data/priv_validator_state.json"
490-
491484
((cnt++)) || true
492485
done
493486
}

0 commit comments

Comments
 (0)