Skip to content

Commit 9b03ca6

Browse files
committed
initial setup
1 parent 9c0341d commit 9b03ca6

File tree

4 files changed

+34
-17
lines changed

4 files changed

+34
-17
lines changed

build-testnet-configuration.sh

100644100755
Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
# RUN THIS LINE BY LINE; COMMENTING OUT EVERYTHING ELSE !!!
22

3-
43
# OPTIONAL STEP: create keys (write down the memo words)(you need this only once per environment)
5-
appd keys add user1
6-
appd keys add user2
4+
pushchaind keys add user1
5+
pushchaind keys add user2
76

8-
## make 3 folders with all configs and genesis files and validator keys
7+
## make 3 folders with all configs and genesis files and validator keys for
8+
# a testnetwork (tn) of 3 nodes: pushnode1(.tn/pn1), .tn/pn2, .tn/pn3
99
pushchaind init pn1 --home ~/.tn/pn1 --chain-id test-push-chain
1010
pushchaind init pn2 --home ~/.tn/pn2 --chain-id test-push-chain
1111
pushchaind init pn3 --home ~/.tn/pn3 --chain-id test-push-chain
@@ -45,23 +45,23 @@ cp ~/.tn/pn1/config/app.toml ~/.tn/pn3/config/app.toml
4545

4646

4747
# build config/config.toml
48-
export pn1id=$(pushchaind tendermint show-node-id --home ~/.tn/pn1)
49-
export pn1url="$pn1id@pn1.dev.push.org:26657"
48+
export pn1_id=$(pushchaind tendermint show-node-id --home ~/.tn/pn1)
49+
export pn1_url="$pn1_id@pn1.dev.push.org:26656"
5050

51-
export pn2id=$(pushchaind tendermint show-node-id --home ~/.tn/pn2)
52-
export pn2url="$pn2id@pn2.dev.push.org:26657"
51+
export pn2_id=$(pushchaind tendermint show-node-id --home ~/.tn/pn2)
52+
export pn2_url="$pn2_id@pn2.dev.push.org:26656"
5353

54-
export pn3id=$(pushchaind tendermint show-node-id --home ~/.tn/pn3)
55-
export pn3url="$pn3id@pn3.dev.push.org:26657"
54+
export pn3_id=$(pushchaind tendermint show-node-id --home ~/.tn/pn3)
55+
export pn3_url="$pn3_id@pn3.dev.push.org:26656"
5656

57-
export pn1_peers="\"$pn2url, $pn3url\""
57+
export pn1_peers="\"$pn2_url, $pn3_url\""
5858
sed -i '' "s/persistent_peers = \"\"/persistent_peers = $pn1_peers/g" ~/.tn/pn1/config/config.toml
5959
grep -i persistent_peers ~/.tn/pn1/config/config.toml
6060

61-
export pn2_peers="\"$pn1url, $pn3url\""
61+
export pn2_peers="\"$pn1_url, $pn3_url\""
6262
sed -i '' "s/persistent_peers = \"\"/persistent_peers = $pn2_peers/g" ~/.tn/pn2/config/config.toml
6363
grep -i persistent_peers ~/.tn/pn2/config/config.toml
6464

65-
export pn3_peers="\"$pn1url, $pn2url\""
65+
export pn3_peers="\"$pn1_url, $pn2_url\""
6666
sed -i '' "s/persistent_peers = \"\"/persistent_peers = $pn3_peers/g" ~/.tn/pn3/config/config.toml
6767
grep -i "persistent_peers =" ~/.tn/pn3/config/config.toml

deploy-code.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/bin/bash
22
FILE="release/push_linux_amd64.tar.gz"
3-
REMOTE_HOST="pn1.dev.push.org"
3+
REMOTE_HOST="pn2.dev.push.org"
44
DEST_EXEC_DIR="/home/igx/app"
55

66

deploy-config.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
#!/bin/bash
2-
SRC_HOME_DIR="/Users/igx/.tn/pn1"
3-
REMOTE_HOST="pn1.dev.push.org"
2+
SRC_HOME_DIR="/Users/igx/.tn/pn2"
3+
REMOTE_HOST="pn2.dev.push.org"
44

55
# DO NOT EDIT THIS UNLESS NEEDED
66
DEST_HOME_DIR="/home/igx/.push"
7-
ARCHIVE_FILE="home.tar.gz" # Per instruction, although typically tar.gz is used.
7+
ARCHIVE_FILE="config.tar.gz"
88
REMOTE_ARCHIVE="/tmp/${ARCHIVE_FILE}"
99

1010
echo "Creating archive $ARCHIVE_FILE from $SRC_HOME_DIR..."

deploy-user2-key.sh

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#!/bin/bash
2+
SRC_HOME_DIR="/Users/igx/.tn/pn2"
3+
REMOTE_HOST="pn2.dev.push.org"
4+
REMOTE_DIR="/home/igx/.push/"
5+
KEY_FILE="user2_key.json"
6+
7+
# DO NOT EDIT THIS UNLESS NEEDED
8+
9+
echo "Exporting key..."
10+
pushchaind keys export user2 --output json > $KEY_FILE
11+
12+
echo "Uploading $KEY_FILE to $REMOTE_HOST:$REMOTE_DIR..."
13+
scp "$KEY_FILE" "$REMOTE_HOST:$REMOTE_DIR$KEY_FILE"
14+
if [ $? -ne 0 ]; then
15+
echo "Error: SCP of $KEY_FILE failed."
16+
exit 1
17+
fi

0 commit comments

Comments
 (0)