Skip to content

Commit b361c63

Browse files
committed
#303 Upgrade Cosmos-SDK to v0.47.8
Upgrade binary version and checksum Signed-off-by: Abdulbois <abdulbois.tursunov@dsr-corporation.com> Signed-off-by: Abdulbois <abdulbois123@gmail.com>
1 parent 4fcecc8 commit b361c63

10 files changed

+130
-438
lines changed

genlocalnetappbins.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ docker container create --name ${IMAGE_TAG}-inst ${IMAGE_TAG}
1111

1212
if [ -n "$MAINNET_STABLE_VERSION" ]; then
1313
wget "https://github.com/zigbee-alliance/distributed-compliance-ledger/releases/download/${MAINNET_STABLE_VERSION}/dcld"
14-
chmod ugo+x dcld
14+
chmod ugo+x dcld
1515
fi
1616

1717
for node_name in node0 node1 node2 node3 observer0 lightclient0; do

genlocalnetconfig.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ $DCL_BINARY config chain-id "$CHAIN_ID"
5353
$DCL_BINARY config output json
5454
$DCL_BINARY config node "tcp://localhost:26657"
5555
$DCL_BINARY config keyring-backend test
56-
$DCL_BINARY config broadcast-mode sync
56+
$DCL_BINARY config broadcast-mode block
5757

5858
(echo "$KEYPASSWD"; echo "$KEYPASSWD") | $DCL_BINARY keys add jack
5959
(echo "$KEYPASSWD"; echo "$KEYPASSWD") | $DCL_BINARY keys add alice

integration_tests/cli/common.sh

+4-2
Original file line numberDiff line numberDiff line change
@@ -124,13 +124,13 @@ create_new_account(){
124124

125125
echo "Jack proposes account for \"$name\" with roles: \"$roles\""
126126
result=$(echo $passphrase | dcld tx auth propose-add-account --address="$address" --pubkey="$pubkey" --roles=$roles --from jack --yes)
127-
result=$(get_txn_result "$result")
127+
_result=$(get_txn_result "$_result")
128128
check_response "$result" "\"code\": 0"
129129
echo "$result"
130130

131131
echo "Alice approves account for \"$name\" with roles: \"$roles\""
132132
result=$(echo $passphrase | dcld tx auth approve-add-account --address="$address" --from alice --yes)
133-
result=$(get_txn_result "$result")
133+
_result=$(get_txn_result "$_result")
134134
check_response "$result" "\"code\": 0"
135135
echo "$result"
136136
}
@@ -153,6 +153,7 @@ create_new_vendor_account(){
153153
echo "Jack proposes account for \"$_name\" with Vendor role"
154154
_result=$(echo $passphrase | dcld tx auth propose-add-account --address="$_address" --pubkey="$_pubkey" --roles=Vendor --vid=$_vid --from jack --yes)
155155
fi
156+
156157
_result=$(get_txn_result "$_result")
157158
check_response "$_result" "\"code\": 0"
158159
}
@@ -224,6 +225,7 @@ wait_for_height() {
224225

225226
echo "Waiting for height: $target_height... Current height: ${current_height:-unavailable}, " \
226227
"wait time: $waited, time limit: $wait_time." &>${_output}
228+
docker logs node0 -n 50
227229
done
228230
}
229231

integration_tests/run-all.sh

+23-23
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,29 @@ make image &>${DETAILED_OUTPUT_TARGET}
111111

112112
cleanup_pool
113113

114+
# Upgrade procedure tests
115+
if [[ $TESTS_TO_RUN =~ "all" || $TESTS_TO_RUN =~ "upgrade" ]]; then
116+
UPGRADE_SHELL_TEST="./integration_tests/upgrade/test-upgrade.sh"
117+
118+
init_pool yes localnet_init_latest_stable_release "v0.12.0"
119+
120+
log "*****************************************************************************************"
121+
log "Running $UPGRADE_SHELL_TEST"
122+
log "*****************************************************************************************"
123+
124+
if bash "$UPGRADE_SHELL_TEST" &>${DETAILED_OUTPUT_TARGET}; then
125+
rm dcld_mainnet_stable
126+
log "$UPGRADE_SHELL_TEST finished successfully"
127+
source integration_tests/upgrade/add-new-node-after-upgrade.sh
128+
check_adding_new_node
129+
else
130+
log "$UPGRADE_SHELL_TEST failed"
131+
exit 1
132+
fi
133+
134+
cleanup_pool
135+
fi
136+
114137
# Cli shell tests
115138
if [[ $TESTS_TO_RUN =~ "all" || $TESTS_TO_RUN =~ "cli" ]]; then
116139
CLI_SHELL_TESTS=$(find integration_tests/cli -type f -name '*.sh' -not -name "common.sh")
@@ -191,26 +214,3 @@ if [[ $TESTS_TO_RUN =~ "all" || $TESTS_TO_RUN =~ "deploy" ]]; then
191214
exit 1
192215
fi
193216
fi
194-
195-
# Upgrade procedure tests
196-
if [[ $TESTS_TO_RUN =~ "all" || $TESTS_TO_RUN =~ "upgrade" ]]; then
197-
UPGRADE_SHELL_TEST="./integration_tests/upgrade/test-upgrade.sh"
198-
199-
init_pool yes localnet_init_latest_stable_release "v0.12.0"
200-
201-
log "*****************************************************************************************"
202-
log "Running $UPGRADE_SHELL_TEST"
203-
log "*****************************************************************************************"
204-
205-
if bash "$UPGRADE_SHELL_TEST" &>${DETAILED_OUTPUT_TARGET}; then
206-
rm dcld_mainnet_stable
207-
log "$UPGRADE_SHELL_TEST finished successfully"
208-
source integration_tests/upgrade/add-new-node-after-upgrade.sh
209-
check_adding_new_node
210-
else
211-
log "$UPGRADE_SHELL_TEST failed"
212-
exit 1
213-
fi
214-
215-
cleanup_pool
216-
fi

integration_tests/upgrade/01-test-upgrade-initialize-0.12.sh

100644100755
+25-23
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,10 @@ wget -O dcld-initial "https://github.com/zigbee-alliance/distributed-compliance-
2222
chmod ugo+x dcld-initial
2323

2424
DCLD_BIN="./dcld-initial"
25+
$DCLD_BIN config broadcast-mode block
2526

2627
container="validator-demo"
2728
add_validator_node() {
28-
# FIXME: as it's called before upgrade, mainnet stable version of dcld needs to be used (not the latest master)
2929
random_string account
3030
address=""
3131
LOCALNET_DIR=".localnet"
@@ -41,15 +41,9 @@ add_validator_node() {
4141
passphrase="test1234"
4242
docker_network="distributed-compliance-ledger_localnet"
4343

44-
docker build -f Dockerfile-build -t dcld-build .
45-
docker container create --name dcld-build-inst dcld-build
46-
docker cp dcld-build-inst:/go/bin/dcld ./
47-
docker rm dcld-build-inst
48-
4944
docker run -d --name $container --ip $ip -p "$node_p2p_port-$node_client_port:26656-26657" --network $docker_network -i dcledger
5045

51-
docker cp ./dcld "$container":"$DCL_USER_HOME"/
52-
rm -f ./dcld
46+
docker cp $DCLD_BIN "$container":"$DCL_USER_HOME"/dcld
5347

5448
test_divider
5549

@@ -78,30 +72,30 @@ add_validator_node() {
7872

7973
address="$(docker exec $container /bin/sh -c "echo $passphrase | ./dcld keys show $account -a")"
8074
pubkey="$(docker exec $container /bin/sh -c "echo $passphrase | ./dcld keys show $account -p")"
81-
alice_address="$(dcld keys show alice -a)"
82-
bob_address="$(dcld keys show bob -a)"
83-
jack_address="$(dcld keys show jack -a)"
75+
alice_address="$($DCLD_BIN keys show alice -a)"
76+
bob_address="$($DCLD_BIN keys show bob -a)"
77+
jack_address="$($DCLD_BIN keys show jack -a)"
8478
echo "Create account for $account and Assign NodeAdmin role"
85-
echo $passphrase | dcld tx auth propose-add-account --address="$address" --pubkey="$pubkey" --roles="NodeAdmin" --from jack --yes
86-
echo $passphrase | dcld tx auth approve-add-account --address="$address" --from alice --yes
87-
echo $passphrase | dcld tx auth approve-add-account --address="$address" --from bob --yes
79+
echo $passphrase | $DCLD_BIN tx auth propose-add-account --address="$address" --pubkey="$pubkey" --roles="NodeAdmin" --from jack --yes
80+
echo $passphrase | $DCLD_BIN tx auth approve-add-account --address="$address" --from alice --yes
81+
echo $passphrase | $DCLD_BIN tx auth approve-add-account --address="$address" --from bob --yes
8882

8983
test_divider
9084
vaddress=$(docker exec $container ./dcld tendermint show-address)
9185
vpubkey=$(docker exec $container ./dcld tendermint show-validator)
9286

9387
echo "Check pool response for yet unknown node \"$node_name\""
94-
result=$(dcld query validator node --address "$address")
88+
result=$($DCLD_BIN query validator node --address "$address")
9589
check_response "$result" "Not Found"
9690
echo "$result"
97-
result=$(dcld query validator last-power --address "$address")
91+
result=$($DCLD_BIN query validator last-power --address "$address")
9892
check_response "$result" "Not Found"
9993
echo "$result"
10094

10195
echo "$account Add Node \"$node_name\" to validator set"
10296

10397
! read -r -d '' _script << EOF
104-
set -eu; echo test1234 | dcld tx validator add-node --pubkey='$vpubkey' --moniker="$node_name" --from="$account" --yes
98+
set -eu; echo test1234 | $DCLD_BIN tx validator add-node --pubkey='$vpubkey' --moniker="$node_name" --from="$account" --yes
10599
EOF
106100
result="$(docker exec "$container" /bin/sh -c "echo test1234 | ./dcld tx validator add-node --pubkey='$vpubkey' --moniker="$node_name" --from="$account" --yes")"
107101
check_response "$result" "\"code\": 0"
@@ -119,7 +113,7 @@ EOF
119113
docker exec -d $container cosmovisor start
120114
sleep 10
121115

122-
result=$(dcld query validator node --address "$address")
116+
result=$($DCLD_BIN query validator node --address "$address")
123117
validator_address=$(echo "$result" | jq -r '.owner')
124118
echo "$result"
125119
}
@@ -199,10 +193,18 @@ user_3_address=$(echo $passphrase | $DCLD_BIN keys show $user_3 -a)
199193
user_3_pubkey=$(echo $passphrase | $DCLD_BIN keys show $user_3 -p)
200194

201195
echo "Create Vendor account $vendor_account"
202-
create_new_vendor_account $vendor_account $vid
196+
result="$(echo $passphrase | $DCLD_BIN keys add "$vendor_account")"
197+
_address=$(echo $passphrase | $DCLD_BIN keys show $vendor_account -a)
198+
_pubkey=$(echo $passphrase | $DCLD_BIN keys show $vendor_account -p)
199+
result="$(echo $passphrase | $DCLD_BIN tx auth propose-add-account --address="$_address" --pubkey="$_pubkey" --vid="$vid" --roles="Vendor" --from jack --yes)"
203200

204201
echo "Create CertificationCenter account"
205-
create_new_account certification_center_account "CertificationCenter"
202+
certification_center_account="certification_center_account_"
203+
result="$(echo $passphrase | $DCLD_BIN keys add $certification_center_account)"
204+
_address=$(echo $passphrase | $DCLD_BIN keys show $certification_center_account -a)
205+
_pubkey=$(echo $passphrase | $DCLD_BIN keys show $certification_center_account -p)
206+
result="$(echo $passphrase | $DCLD_BIN tx auth propose-add-account --address="$_address" --pubkey="$_pubkey" --roles="CertificationCenter" --from jack --yes)"
207+
result="$(echo $passphrase | $DCLD_BIN tx auth approve-add-account --address="$_address" --from alice --yes)"
206208

207209
random_string trustee_account_4
208210
random_string trustee_account_5
@@ -470,14 +472,14 @@ test_divider
470472

471473
echo "Disable node"
472474
# FIXME: use proper binary (not dcld but $DCLD_BIN)
473-
result=$(docker exec "$container" /bin/sh -c "echo test1234 | dcld tx validator disable-node --from=$account --yes")
475+
result=$(docker exec "$container" /bin/sh -c "echo test1234 | ./dcld tx validator disable-node --from=$account --yes")
474476
check_response "$result" "\"code\": 0"
475477

476478
test_divider
477479

478480
echo "Enable node"
479481
# FIXME: use proper binary (not dcld but $DCLD_BIN)
480-
result=$(docker exec "$container" /bin/sh -c "echo test1234 | dcld tx validator enable-node --from=$account --yes")
482+
result=$(docker exec "$container" /bin/sh -c "echo test1234 | ./dcld tx validator enable-node --from=$account --yes")
481483
check_response "$result" "\"code\": 0"
482484

483485
test_divider
@@ -502,7 +504,7 @@ test_divider
502504

503505
echo "Enable node"
504506
# FIXME: use proper binary (not dcld but $DCLD_BIN)
505-
result=$(docker exec "$container" /bin/sh -c "echo test1234 | dcld tx validator enable-node --from=$account --yes")
507+
result=$(docker exec "$container" /bin/sh -c "echo test1234 | ./dcld tx validator enable-node --from=$account --yes")
506508
check_response "$result" "\"code\": 0"
507509

508510
test_divider

integration_tests/upgrade/02-test-upgrade-0.12-to-1.2.sh

100644100755
+5-9
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,7 @@ test_divider
276276

277277
echo "Get proposed node to disable"
278278
# FIXME: use proper binary (not dcld but $DCLD_BIN_OLD)
279-
result=$(docker exec "$container" /bin/sh -c "echo test1234 | dcld query validator proposed-disable-node --address="$address"")
279+
result=$(docker exec "$container" /bin/sh -c "echo test1234 | ./dcld query validator proposed-disable-node --address="$address"")
280280
check_response "$result" "\"address\": \"$validator_address\""
281281

282282
test_divider
@@ -721,15 +721,13 @@ test_divider
721721

722722
# VALIDATOR_NODE
723723
echo "Disable node"
724-
# FIXME: use proper binary (not dcld but $DCLD_BIN_OLD)
725-
result=$(docker exec "$container" /bin/sh -c "echo test1234 | dcld tx validator disable-node --from=$account --yes")
724+
result=$(docker exec "$container" /bin/sh -c "echo test1234 | ./dcld tx validator disable-node --from=$account --yes")
726725
check_response "$result" "\"code\": 0"
727726

728727
test_divider
729728

730729
echo "Enable node"
731-
# FIXME: use proper binary (not dcld but $DCLD_BIN_OLD)
732-
result=$(docker exec "$container" /bin/sh -c "echo test1234 | dcld tx validator enable-node --from=$account --yes")
730+
result=$(docker exec "$container" /bin/sh -c "echo test1234 | ./dcld tx validator enable-node --from=$account --yes")
733731
check_response "$result" "\"code\": 0"
734732

735733
test_divider
@@ -753,8 +751,7 @@ check_response "$result" "\"code\": 0"
753751
test_divider
754752

755753
echo "Enable node"
756-
# FIXME: use proper binary (not dcld but $DCLD_BIN_OLD)
757-
result=$(docker exec "$container" /bin/sh -c "echo test1234 | dcld tx validator enable-node --from=$account --yes")
754+
result=$(docker exec "$container" /bin/sh -c "echo test1234 | ./dcld tx validator enable-node --from=$account --yes")
758755
check_response "$result" "\"code\": 0"
759756

760757
test_divider
@@ -768,8 +765,7 @@ test_divider
768765
# Validator
769766

770767
echo "Get node"
771-
# FIXME: use proper binary (not dcld but $DCLD_BIN_OLD)
772-
result=$(docker exec "$container" /bin/sh -c "echo test1234 | dcld query validator all-nodes")
768+
result=$(docker exec "$container" /bin/sh -c "echo test1234 | ./dcld query validator all-nodes")
773769
check_response "$result" "\"owner\": \"$validator_address\""
774770

775771
echo "Upgrade from 0.12.0 to 1.2 passed"

0 commit comments

Comments
 (0)