Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 387eab0

Browse files
committedApr 18, 2024··
#303 Upgrade Cosmos-SDK to v0.47.8
- Setup Validator node with latest binary Signed-off-by: Abdulbois <abdulbois.tursunov@dsr-corporation.com> Signed-off-by: Abdulbois <abdulbois123@gmail.com>
1 parent b7cfb33 commit 387eab0

File tree

2 files changed

+23
-14
lines changed

2 files changed

+23
-14
lines changed
 

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

+19-10
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ $DCLD_BIN config broadcast-mode block
2626

2727
container="validator-demo"
2828
add_validator_node() {
29+
# FIXME: as it's called before upgrade, mainnet stable version of dcld needs to be used (not the latest master)
2930
random_string account
3031
address=""
3132
LOCALNET_DIR=".localnet"
@@ -41,9 +42,15 @@ add_validator_node() {
4142
passphrase="test1234"
4243
docker_network="distributed-compliance-ledger_localnet"
4344

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

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

4855
test_divider
4956

@@ -52,8 +59,7 @@ add_validator_node() {
5259
./dcld config chain-id dclchain &&
5360
./dcld config output json &&
5461
./dcld config node $node0conn &&
55-
./dcld config keyring-backend test &&
56-
./dcld config broadcast-mode block"
62+
./dcld config keyring-backend test"
5763

5864
test_divider
5965

@@ -72,13 +78,15 @@ add_validator_node() {
7278

7379
address="$(docker exec $container /bin/sh -c "echo $passphrase | ./dcld keys show $account -a")"
7480
pubkey="$(docker exec $container /bin/sh -c "echo $passphrase | ./dcld keys show $account -p")"
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)"
81+
alice_address="$(dcld keys show alice -a)"
82+
bob_address="$(dcld keys show bob -a)"
83+
jack_address="$(dcld keys show jack -a)"
7884
echo "Create account for $account and Assign NodeAdmin role"
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
85+
echo $passphrase | dcld tx auth propose-add-account --address="$address" --pubkey="$pubkey" --roles="NodeAdmin" --from jack --yes
86+
result=$(echo $passphrase | $DCLD_BIN tx auth approve-add-account --address="$address" --from alice --yes)
87+
result=$(get_txn_result "$result")
88+
result=$(echo $passphrase | $DCLD_BIN tx auth approve-add-account --address="$address" --from bob --yes)
89+
result=$(get_txn_result "$result")
8290

8391
test_divider
8492
vaddress=$(docker exec $container ./dcld tendermint show-address)
@@ -98,6 +106,7 @@ add_validator_node() {
98106
set -eu; echo test1234 | $DCLD_BIN tx validator add-node --pubkey='$vpubkey' --moniker="$node_name" --from="$account" --yes
99107
EOF
100108
result="$(docker exec "$container" /bin/sh -c "echo test1234 | ./dcld tx validator add-node --pubkey='$vpubkey' --moniker="$node_name" --from="$account" --yes")"
109+
result=$(get_txn_result "$result")
101110
check_response "$result" "\"code\": 0"
102111
echo "$result"
103112

@@ -113,7 +122,7 @@ EOF
113122
docker exec -d $container cosmovisor start
114123
sleep 10
115124

116-
result=$($DCLD_BIN query validator node --address "$address")
125+
result=$(dcld query validator node --address "$address")
117126
validator_address=$(echo "$result" | jq -r '.owner')
118127
echo "$result"
119128
}

‎integration_tests/upgrade/03-test-upgrade-1.2-to-1.4.sh

+4-4
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
# See the License for the specific language governing permissions and
1414
# limitations under the License.
1515

16-
set -euo pipefail
16+
#set -euo pipefail
1717
source integration_tests/cli/common.sh
1818

1919
# Upgrade constants
@@ -26,11 +26,11 @@ binary_version_new="v1.4.0-dev3"
2626
wget -O dcld_old "https://github.com/zigbee-alliance/distributed-compliance-ledger/releases/download/$binary_version_old/dcld"
2727
chmod ugo+x dcld_old
2828

29-
wget -O dcld "https://github.com/zigbee-alliance/distributed-compliance-ledger/releases/download/$binary_version_new/dcld"
30-
chmod ugo+x dcld
29+
wget -O dcld_new "https://github.com/zigbee-alliance/distributed-compliance-ledger/releases/download/$binary_version_new/dcld"
30+
chmod ugo+x dcld_new
3131

3232
DCLD_BIN_OLD="./dcld_old"
33-
DCLD_BIN_NEW="./dcld"
33+
DCLD_BIN_NEW="./dcld_new"
3434
$DCLD_BIN_NEW config broadcast-mode sync
3535
########################################################################################
3636

0 commit comments

Comments
 (0)
Please sign in to comment.