Skip to content

Commit 184966b

Browse files
committed
scripts v2.5
1 parent 4fad5b3 commit 184966b

File tree

2 files changed

+69
-8
lines changed

2 files changed

+69
-8
lines changed

deploy/readme.md

Lines changed: 57 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ TBD, mostly the same steps as in [Deploy validator 1] except the final [deploy]
44

55
# Remote test net (1..N nodes)
66

7-
## VM Preconditions
7+
## VM Preconditions (WIP)
88
you need to run a vm with enough CPU/RAM/DISK, accessible via ssh using only private key auth
99

1010
a special user 'chain' will be used for deployment
@@ -18,6 +18,8 @@ ssh $REMOTE_HOST
1818
mkdir ~/app
1919
# .push will hold home directory with /config and /data
2020
mkdir ~/.push
21+
# add to path
22+
echo 'export PATH="$HOME/app:$HOME/.push/config/scripts:$PATH"' >> ~/.bashrc
2123

2224
# open firewall ports (MANUAL STEP) :
2325
# 26656 for p2p,
@@ -30,7 +32,7 @@ telnet $REMOTE_HOST 26656
3032
```
3133

3234

33-
## Build validator1 configs (!required only once)
35+
## Build validator1 configs (!required only once) (WIP)
3436
- Generates validator1 config data to /test-push-chain-0: genesis.json, config.toml, app.toml, client.toml
3537
- Generates validator1 private keys to /test-push-chain-0: node_key.json, priv_validator_key.json
3638
- Generates binary build to /release: push_linux_amd64.tar.gz
@@ -103,7 +105,7 @@ echo "-----"
103105

104106
```
105107

106-
## Deploy validator1 configs & binary (!required only once)
108+
## Deploy validator1 configs & binary (!required only once) (WIP)
107109
```shell
108110
# HDIR contains private keys, since we generated them at prev steps
109111
export HDIR="test-push-chain-0"
@@ -153,8 +155,6 @@ export pn1_id=a1ba93b69fb0ff339909fcd502d404d6e4b9c422
153155
export pn1_url="$pn1_id@pn1.dev.push.org:26656"
154156
python3 toml_edit.py $HDIR_CONFIG/config.toml "p2p.persistent_peers" "$pn1_url"
155157

156-
157-
158158
#### upload binary
159159
scp "../release/push_linux_amd64.tar.gz" "$REMOTE_HOST:~/push_linux_amd64.tar.gz"
160160
#### zip configs
@@ -164,6 +164,8 @@ scp ".push.tar.gz" "$REMOTE_HOST:~/push-home.tar.gz"
164164
```
165165

166166
now ssh into the REMOTE HOST! to generate private key & apply configs on REMOTE HOST!!!
167+
168+
New node
167169
```sh
168170
export VALIDATOR_NAME=pn3
169171
export REMOTE_HOST="$VALIDATOR_NAME.dev.push.org"
@@ -196,12 +198,59 @@ chmod u+x ~/.push/scripts/*.sh
196198
# check that node is syncing
197199
tail -n 100 ~/app/chain.log
198200
# wait for full node sync (manually or via this script)
199-
~/.push/scripts/waitFulSync.sh
201+
~/.push/scripts/waitFulдSync.sh
200202

201203
# TODO
202204
# upgrade node to validator
203-
# 1 faucet sends tokens to the wallet
205+
206+
# 0 create register-validator.json (edit required vars)
207+
export VALIDATOR_PUBKEY=$(pushchaind comet show-validator)
208+
export ONE_PUSH=000000npush
209+
export VALIDATOR_NAME=\"pn3\"
210+
cat <<EOF > register-validator.json
211+
{
212+
"pubkey": $VALIDATOR_PUBKEY,
213+
"amount": "10000$ONE_PUSH",
214+
"moniker": $VALIDATOR_NAME,
215+
"website": "example.com",
216+
"security": "swein2@gmail.com",
217+
"details": "a test validator",
218+
"commission-rate": "0.1",
219+
"commission-max-rate": "0.2",
220+
"commission-max-change-rate": "0.01",
221+
"min-self-delegation": "1"
222+
}
223+
EOF
224+
echo "validator_pubkey is $validator_pubkey"
225+
echo "json cmd is "
226+
cat register-validator.json
227+
```
228+
229+
Faucet machine
230+
```bash
231+
# do it from DEV machine with faucet key (or import user2 key to the validator host)
232+
233+
# 1 create a wallet, sends tokens to the wallet if needed
234+
# user3 = validator owner wallet
235+
pushchaind keys add user3 --keyring-backend test
236+
237+
# here push1tjxdmycqua5j8f8y3j9ac5hn6cjhx2pgsaj6vs is the node wallet (from command above)
238+
# here push1j55s4vpvmncruakqhj2k2fywnc9mvsuhcap28q is the faucet wallet (you need it's priv key)
239+
# we transfer 20k PUSH
240+
pushchaind tx bank send push1j55s4vpvmncruakqhj2k2fywnc9mvsuhcap28q push1tjxdmycqua5j8f8y3j9ac5hn6cjhx2pgsaj6vs 20000000000npush --fees 50000npush --chain-id test-push-chain --keyring-backend test
241+
# check to have 20k PUSH
242+
pushchaind query bank balances push1tjxdmycqua5j8f8y3j9ac5hn6cjhx2pgsaj6vs --chain-id test-push-chain --keyring-backend test
204243
# 2 register validator with stake
205-
# 3 restart vm
244+
# pn1.dev.push.org - is the existing public node with api
245+
pushchaind tx staking create-validator register-validator.json --chain-id test-push-chain --fees 50000npush --from user2 --node=tcp://pn1.dev.push.org:26657
246+
```
247+
New node
248+
```
249+
# 3 restart the chain process
250+
ssh $REMOTE_HOST
251+
# stop if running
252+
~/.push/scripts/stop.sh
253+
# start
254+
~/.push/scripts/start.sh
206255
```
207256

deploy/register-validator.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"pubkey": {"@type":"/cosmos.crypto.ed25519.PubKey","key":"+kT/DgjyLHmjrMbxD9et52UFZ/0KizTM5N0BrHy+Gqs="},
3+
"amount": "10000000000npush",
4+
"moniker": "pn3",
5+
"website": "example.com",
6+
"security": "swein2@gmail.com",
7+
"details": "a test validator",
8+
"commission-rate": "0.1",
9+
"commission-max-rate": "0.2",
10+
"commission-max-change-rate": "0.01",
11+
"min-self-delegation": "1"
12+
}

0 commit comments

Comments
 (0)