@@ -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)
88you need to run a vm with enough CPU/RAM/DISK, accessible via ssh using only private key auth
99
1010a special user 'chain' will be used for deployment
@@ -18,6 +18,8 @@ ssh $REMOTE_HOST
1818mkdir ~ /app
1919# .push will hold home directory with /config and /data
2020mkdir ~ /.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
109111export HDIR=" test-push-chain-0"
@@ -153,8 +155,6 @@ export pn1_id=a1ba93b69fb0ff339909fcd502d404d6e4b9c422
153155export pn1_url=" $pn1_id @pn1.dev.push.org:26656"
154156python3 toml_edit.py $HDIR_CONFIG /config.toml " p2p.persistent_peers" " $pn1_url "
155157
156-
157-
158158# ### upload binary
159159scp " ../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
166166now ssh into the REMOTE HOST! to generate private key & apply configs on REMOTE HOST!!!
167+
168+ New node
167169``` sh
168170export VALIDATOR_NAME=pn3
169171export REMOTE_HOST=" $VALIDATOR_NAME .dev.push.org"
@@ -196,12 +198,59 @@ chmod u+x ~/.push/scripts/*.sh
196198# check that node is syncing
197199tail -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
0 commit comments