From 00e824e71eff1253b90632ce513ef0cc205c52e5 Mon Sep 17 00:00:00 2001 From: Karoly Albert Szabo Date: Thu, 7 Mar 2019 18:47:16 +0100 Subject: [PATCH 1/9] make faucet richer once, no money twice Signed-off-by: Karoly Albert Szabo --- .aws/faucet.sh | 22 +++++++++++++++------- .aws/first.sh | 2 +- CHANGELOG.md | 1 - PENDING.md | 5 ++--- 4 files changed, 18 insertions(+), 12 deletions(-) diff --git a/.aws/faucet.sh b/.aws/faucet.sh index d8f0d7e909..cfacd1145c 100644 --- a/.aws/faucet.sh +++ b/.aws/faucet.sh @@ -1,8 +1,8 @@ #!/bin/bash AMOUNTS=10000000stake -AMOUNTP=5photino -AMOUNTC=1cococoin +AMOUNTP=5000000photino +AMOUNTC=123123cococoin ACCOUNT=$1 PASSWORD=$2 @@ -19,14 +19,22 @@ do DESTINATION=$(echo $row | awk '{print $4}') if [[ ${#DESTINATION} -eq 45 ]]; then - # work only on stuff that have the right length - ADDRESS=$(./gaiacli keys show ${ACCOUNT} --home . --address) - echo ${PASSWORD} | ./gaiacli tx send ${DESTINATION} ${AMOUNTS} --home . --from ${ADDRESS} --chain-id=${NETWORK} - echo ${PASSWORD} | ./gaiacli tx send ${DESTINATION} ${AMOUNTP} --home . --from ${ADDRESS} --chain-id=${NETWORK} - echo ${PASSWORD} | ./gaiacli tx send ${DESTINATION} ${AMOUNTC} --home . --from ${ADDRESS} --chain-id=${NETWORK} + ACCOUNT_INFO=$(./gaiacli query account ${DESTINATION} --chain-id ${NETWORK} --trust-node --home .) + dt=$(date '+%d/%m/%Y %H:%M:%S'); + if [[ ${ACCOUNT_INFO} == *"auth/Account"* ]]; then + echo "$dt - $DESTINATION already funded, bye greedy b****rd!" + else + # work only on stuff that have the right length + ADDRESS=$(./gaiacli keys show ${ACCOUNT} --home . --address) + echo ${PASSWORD} | ./gaiacli tx send ${DESTINATION} ${AMOUNTS} --home . --from ${ADDRESS} --chain-id=${NETWORK} + echo ${PASSWORD} | ./gaiacli tx send ${DESTINATION} ${AMOUNTP} --home . --from ${ADDRESS} --chain-id=${NETWORK} + echo ${PASSWORD} | ./gaiacli tx send ${DESTINATION} ${AMOUNTC} --home . --from ${ADDRESS} --chain-id=${NETWORK} + echo "$dt - $DESTINATION funded, enjoy!" + fi fi # Remove this address from the ones that needs money aws s3 rm s3://cosmos-gaia/addresses/${DESTINATION} done fi + sleep 10s done diff --git a/.aws/first.sh b/.aws/first.sh index 7a8445e37e..f35c17f5c9 100644 --- a/.aws/first.sh +++ b/.aws/first.sh @@ -15,7 +15,7 @@ NODEID=$(./gaiad tendermint show-node-id --home .) # Create our main account and add it to the genesis with a lot of money echo ${PASSWORD} | ./gaiacli keys add ${ACCOUNT} --home . > account_address.log -./gaiad add-genesis-account $(./gaiacli keys show ${ACCOUNT} --home . --address) 100000000000000000stake,999000000000photino,123123123123cococoin --home . +./gaiad add-genesis-account $(./gaiacli keys show ${ACCOUNT} --home . --address) 1000000000000000000000stake,100000000000000000000photino,123123123123123123cococoin --home . echo ${PASSWORD} | ./gaiad gentx --name ${ACCOUNT} --home . --home-client . ./gaiad collect-gentxs --home . diff --git a/CHANGELOG.md b/CHANGELOG.md index a088b9a071..aa6de304da 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,7 +7,6 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. ## [Unreleased] - ## [1.0.0-beta.15] - 2019-03-07 ### Changed diff --git a/PENDING.md b/PENDING.md index 682d9822e3..2257bd6569 100644 --- a/PENDING.md +++ b/PENDING.md @@ -1,5 +1,3 @@ -## [Unreleased] - ### Added - [\#2104](https://github.com/cosmos/voyager/issues/2104) fix transaction times @fedekunze @@ -7,4 +5,5 @@ ### Changed - [#\2202](https://github.com/cosmos/voyager/pull/2202) Fix circle configuration for publishing @sabau -- [\#1805](https://github.com/cosmos/voyager/issues/1805) support all transaction types @fedekunze \ No newline at end of file +- [\#1805](https://github.com/cosmos/voyager/issues/1805) support all transaction types @fedekunze +- [\#2210](https://github.com/cosmos/voyager/pull/2210) Enrich faucet @sabau \ No newline at end of file From 56dd171ca31770553aff756ac2fbc16f23162631 Mon Sep 17 00:00:00 2001 From: Karoly Albert Szabo Date: Thu, 7 Mar 2019 19:40:57 +0100 Subject: [PATCH 2/9] disable cococoins as block height is blocker, basic logging for few commands Signed-off-by: Karoly Albert Szabo --- .aws/faucet.sh | 9 ++++++--- .aws/first.sh | 2 +- .aws/others.sh | 2 +- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/.aws/faucet.sh b/.aws/faucet.sh index cfacd1145c..f704a639af 100644 --- a/.aws/faucet.sh +++ b/.aws/faucet.sh @@ -2,7 +2,7 @@ AMOUNTS=10000000stake AMOUNTP=5000000photino -AMOUNTC=123123cococoin +# AMOUNTC=123123cococoin ACCOUNT=$1 PASSWORD=$2 @@ -21,14 +21,17 @@ do then ACCOUNT_INFO=$(./gaiacli query account ${DESTINATION} --chain-id ${NETWORK} --trust-node --home .) dt=$(date '+%d/%m/%Y %H:%M:%S'); - if [[ ${ACCOUNT_INFO} == *"auth/Account"* ]]; then + if [[ ${ACCOUNT_INFO} == *"stake"* ]]; then echo "$dt - $DESTINATION already funded, bye greedy b****rd!" else # work only on stuff that have the right length ADDRESS=$(./gaiacli keys show ${ACCOUNT} --home . --address) + echo "stakes $AMOUNTS at $DESTINATION" echo ${PASSWORD} | ./gaiacli tx send ${DESTINATION} ${AMOUNTS} --home . --from ${ADDRESS} --chain-id=${NETWORK} + sleep 5s # TODO: should be smarter, check if block was created or not + echo "photino $AMOUNTP at $DESTINATION" echo ${PASSWORD} | ./gaiacli tx send ${DESTINATION} ${AMOUNTP} --home . --from ${ADDRESS} --chain-id=${NETWORK} - echo ${PASSWORD} | ./gaiacli tx send ${DESTINATION} ${AMOUNTC} --home . --from ${ADDRESS} --chain-id=${NETWORK} + # echo ${PASSWORD} | ./gaiacli tx send ${DESTINATION} ${AMOUNTC} --home . --from ${ADDRESS} --chain-id=${NETWORK} echo "$dt - $DESTINATION funded, enjoy!" fi fi diff --git a/.aws/first.sh b/.aws/first.sh index f35c17f5c9..c7572804e6 100644 --- a/.aws/first.sh +++ b/.aws/first.sh @@ -26,6 +26,6 @@ aws s3 cp config/genesis.json s3://cosmos-gaia/genesis.json # boot proper nodes in reachable detached sessions screen -dmS gaia ./gaiad start --home . screen -dmS rest ./gaiacli rest-server --laddr tcp://0.0.0.0:${API_PORT} --home . --node http://localhost:${PORT} --chain-id ${NETWORK} --trust-node true -screen -dmS faucet ./faucet.sh ${ACCOUNT} ${PASSWORD} ${NETWORK} +screen -dmSL faucet ./faucet.sh ${ACCOUNT} ${PASSWORD} ${NETWORK} echo ${NODEID} diff --git a/.aws/others.sh b/.aws/others.sh index 8b9b93b2ab..18773141f3 100644 --- a/.aws/others.sh +++ b/.aws/others.sh @@ -24,7 +24,7 @@ aws s3 cp s3://cosmos-gaia/genesis.json config/genesis.json NODEID=$(./gaiad tendermint show-node-id --home .) # boot referring to the remote node -screen -dmS gaia ./gaiad start --home . --p2p.persistent_peers="$MAINNODEID@$MAINNODEIP:$((PORT))" +screen -dmSL gaia ./gaiad start --home . --p2p.persistent_peers="$MAINNODEID@$MAINNODEIP:$((PORT))" # get the key to make my node validator PUBKEY=$(./gaiad tendermint show-validator --home .) From ef8189ffb2fd458bd7f40991bee2e0dd2b724ac4 Mon Sep 17 00:00:00 2001 From: Fabian Date: Mon, 11 Mar 2019 18:07:07 +0100 Subject: [PATCH 3/9] Update .aws/faucet.sh Co-Authored-By: sabau --- .aws/faucet.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.aws/faucet.sh b/.aws/faucet.sh index f704a639af..aeef78fbca 100644 --- a/.aws/faucet.sh +++ b/.aws/faucet.sh @@ -22,7 +22,7 @@ do ACCOUNT_INFO=$(./gaiacli query account ${DESTINATION} --chain-id ${NETWORK} --trust-node --home .) dt=$(date '+%d/%m/%Y %H:%M:%S'); if [[ ${ACCOUNT_INFO} == *"stake"* ]]; then - echo "$dt - $DESTINATION already funded, bye greedy b****rd!" + echo "$dt - $DESTINATION already funded, accounts are only funded once" else # work only on stuff that have the right length ADDRESS=$(./gaiacli keys show ${ACCOUNT} --home . --address) From 0448ab49a8ea7c738f341fdb20ffaa7a4b687bbe Mon Sep 17 00:00:00 2001 From: Karoly Albert Szabo Date: Mon, 11 Mar 2019 19:33:28 +0100 Subject: [PATCH 4/9] iupdarte main node ID Signed-off-by: Karoly Albert Szabo --- .aws/others.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.aws/others.sh b/.aws/others.sh index 18773141f3..4b878cae99 100644 --- a/.aws/others.sh +++ b/.aws/others.sh @@ -4,7 +4,7 @@ PASSWORD=1234567890 ACCOUNT=operator_account PORT=26656 # TODO: hardcoded temporary, this will become a parameter coming from the first ECS instance -MAINNODEID=a93accb0af3dfda1f40063bd45857c4808ba2d9b +MAINNODEID=03bd1fd646a9684eb53d40fd342529b5dd9accbf MAINNODEIP=172.31.35.89 MAINACCOUNT=main_account NETWORK=testnet From 6119f568309c6b9a3777da98b30b6addc522cc52 Mon Sep 17 00:00:00 2001 From: Karoly Albert Szabo Date: Mon, 11 Mar 2019 19:41:37 +0100 Subject: [PATCH 5/9] fix condition for exit loop Signed-off-by: Karoly Albert Szabo --- .aws/others.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.aws/others.sh b/.aws/others.sh index 4b878cae99..a05973146f 100644 --- a/.aws/others.sh +++ b/.aws/others.sh @@ -40,7 +40,7 @@ while ${poor} do # query my account to check if I'm still poor ACCOUNT_INFO=$(./gaiacli query account ${ADDRESS} --chain-id ${NETWORK} --trust-node --home .) - if [[ ${ACCOUNT_INFO} == *"auth/Account"* ]]; then + if [[ ${ACCOUNT_INFO} == *"steak"* ]]; then echo "Address funded, thanks main node!" poor=false fi From 0d7149209aaecb9d939f75275f270421221d2f75 Mon Sep 17 00:00:00 2001 From: Karoly Albert Szabo Date: Mon, 11 Mar 2019 19:58:17 +0100 Subject: [PATCH 6/9] new --yes can be avoided Signed-off-by: Karoly Albert Szabo --- .aws/faucet.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.aws/faucet.sh b/.aws/faucet.sh index aeef78fbca..3c9f978cc0 100644 --- a/.aws/faucet.sh +++ b/.aws/faucet.sh @@ -27,10 +27,10 @@ do # work only on stuff that have the right length ADDRESS=$(./gaiacli keys show ${ACCOUNT} --home . --address) echo "stakes $AMOUNTS at $DESTINATION" - echo ${PASSWORD} | ./gaiacli tx send ${DESTINATION} ${AMOUNTS} --home . --from ${ADDRESS} --chain-id=${NETWORK} + echo ${PASSWORD} | ./gaiacli tx send ${DESTINATION} ${AMOUNTS} --home . --from ${ADDRESS} --chain-id=${NETWORK} --yes sleep 5s # TODO: should be smarter, check if block was created or not echo "photino $AMOUNTP at $DESTINATION" - echo ${PASSWORD} | ./gaiacli tx send ${DESTINATION} ${AMOUNTP} --home . --from ${ADDRESS} --chain-id=${NETWORK} + echo ${PASSWORD} | ./gaiacli tx send ${DESTINATION} ${AMOUNTP} --home . --from ${ADDRESS} --chain-id=${NETWORK} --yes # echo ${PASSWORD} | ./gaiacli tx send ${DESTINATION} ${AMOUNTC} --home . --from ${ADDRESS} --chain-id=${NETWORK} echo "$dt - $DESTINATION funded, enjoy!" fi From 15741989b5abea1e4f3d96486fbc440f0d28c219 Mon Sep 17 00:00:00 2001 From: Karoly Albert Szabo Date: Tue, 12 Mar 2019 11:44:25 +0100 Subject: [PATCH 7/9] new --yes can be avoided Signed-off-by: Karoly Albert Szabo --- .aws/others.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.aws/others.sh b/.aws/others.sh index a05973146f..88069d53c0 100644 --- a/.aws/others.sh +++ b/.aws/others.sh @@ -47,4 +47,4 @@ do sleep 3s done -echo ${PASSWORD} | ./gaiacli tx staking create-validator --home . --from ${ACCOUNT} --amount=${VALIDATOR_AMOUNT} --pubkey=${PUBKEY} --address-delegator=${ADDRESS} --moniker=${ACCOUNT} --chain-id=${NETWORK} --commission-max-change-rate=0 --commission-max-rate=0 --commission-rate=0 --min-self-delegation=1 +echo ${PASSWORD} | ./gaiacli tx staking create-validator --home . --from ${ACCOUNT} --amount=${VALIDATOR_AMOUNT} --pubkey=${PUBKEY} --address-delegator=${ADDRESS} --moniker=${ACCOUNT} --chain-id=${NETWORK} --commission-max-change-rate=0 --commission-max-rate=0 --commission-rate=0 --min-self-delegation=1 --yes From bdea42228612b084bf5b7c91a801c82db88c349f Mon Sep 17 00:00:00 2001 From: Karoly Albert Szabo Date: Tue, 12 Mar 2019 11:48:41 +0100 Subject: [PATCH 8/9] remove unused flag Signed-off-by: Karoly Albert Szabo --- .aws/others.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.aws/others.sh b/.aws/others.sh index 88069d53c0..8f722f29d2 100644 --- a/.aws/others.sh +++ b/.aws/others.sh @@ -47,4 +47,4 @@ do sleep 3s done -echo ${PASSWORD} | ./gaiacli tx staking create-validator --home . --from ${ACCOUNT} --amount=${VALIDATOR_AMOUNT} --pubkey=${PUBKEY} --address-delegator=${ADDRESS} --moniker=${ACCOUNT} --chain-id=${NETWORK} --commission-max-change-rate=0 --commission-max-rate=0 --commission-rate=0 --min-self-delegation=1 --yes +echo ${PASSWORD} | ./gaiacli tx staking create-validator --home . --from ${ACCOUNT} --amount=${VALIDATOR_AMOUNT} --pubkey=${PUBKEY} --moniker=${ACCOUNT} --chain-id=${NETWORK} --commission-max-change-rate=0 --commission-max-rate=0 --commission-rate=0 --min-self-delegation=1 --yes From 3f61ae7da13b6963fbb9ed124f0191ba47cdab7e Mon Sep 17 00:00:00 2001 From: Karoly Albert Szabo Date: Tue, 12 Mar 2019 17:40:54 +0100 Subject: [PATCH 9/9] add PENDING Signed-off-by: Karoly Albert Szabo --- PENDING.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/PENDING.md b/PENDING.md index 8b13789179..acee682151 100644 --- a/PENDING.md +++ b/PENDING.md @@ -1 +1,3 @@ +### Changed +- [#\2210](https://github.com/cosmos/voyager/pull/2210) Faucet give money only to non-existent addresses @sabau