From 42539888f598c602e65d2a5fd2b305e43c589c55 Mon Sep 17 00:00:00 2001 From: root Date: Sat, 29 Aug 2020 12:24:24 +0100 Subject: [PATCH] Added support for asynq contract (but commented out) --- networks/ux/scripts/asynq-deploy.sh | 59 +++++++++++++++++++++++++++++ networks/ux/scripts/bootstrap.sh | 10 +++++ 2 files changed, 69 insertions(+) create mode 100644 networks/ux/scripts/asynq-deploy.sh diff --git a/networks/ux/scripts/asynq-deploy.sh b/networks/ux/scripts/asynq-deploy.sh new file mode 100644 index 0000000..0006c21 --- /dev/null +++ b/networks/ux/scripts/asynq-deploy.sh @@ -0,0 +1,59 @@ +#!/bin/bash + +WALLET="http://ux-wallet:8901" +HOST="http://127.0.0.1:8888" + +DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" + +for action in $@ +do + case $action in + clone) + + echo "Clone asynq contract repository" + git clone https://github.com/CryptoMechanics/asynq-contract $DIR/../contracts/asynq + docker exec ux-main bash -c "mkdir /root/contracts/asynq/build" + + ;; + build) + + echo "Build asynq using EOSIO.CDT v1.7.0" + docker exec ux-main bash -c "cd /root/contracts/asynq/build && cmake .. && make" + + ;; + deploy) + echo "Deploy asynq contract" + docker exec -it ux-main cleos --url $HOST --wallet-url $WALLET set contract asynqverify1 /root/contracts/asynq/build/asynq/ asynq.wasm asynq.abi -p asynqverify1@active + + ;; + addtestdata) + echo "Add testing data for asynq contract" + docker exec -it ux-main cleos --url $HOST --wallet-url $WALLET push action eosio.info adduserver '{"kyc_account":"asynqverify1", "user":"bp1", "verification_key":"passv"}' -p asynqverify1@active + docker exec -it ux-main cleos --url $HOST --wallet-url $WALLET push action eosio.info deluserver '{"kyc_account":"asynqverify1", "user":"bp1", "verification_key":"passv"}' -p asynqverify1@active + docker exec -it ux-main cleos --url $HOST --wallet-url $WALLET push action eosio.info adduserver '{"kyc_account":"asynqverify1", "user":"bp1", "verification_key":"passv"}' -p asynqverify1@active + docker exec -it ux-main cleos --url $HOST --wallet-url $WALLET push action eosio.info adduserver '{"kyc_account":"asynqverify1", "user":"bp1", "verification_key":"utbiv"}' -p asynqverify1@active + docker exec -it ux-main cleos --url $HOST --wallet-url $WALLET push action eosio.info adduserver '{"kyc_account":"asynqverify1", "user":"bp2", "verification_key":"passv"}' -p asynqverify1@active + docker exec -it ux-main cleos --url $HOST --wallet-url $WALLET push action eosio.info adduserver '{"kyc_account":"asynqverify1", "user":"bp2", "verification_key":"utbiv"}' -p asynqverify1@active + docker exec -it ux-main cleos --url $HOST --wallet-url $WALLET push action eosio.info adduserver '{"kyc_account":"asynqverify1", "user":"bp3", "verification_key":"passv"}' -p asynqverify1@active + docker exec -it ux-main cleos --url $HOST --wallet-url $WALLET push action eosio.info adduserver '{"kyc_account":"asynqverify1", "user":"bp4", "verification_key":"drliv"}' -p asynqverify1@active + docker exec -it ux-main cleos --url $HOST --wallet-url $WALLET push action eosio.info adduserver '{"kyc_account":"asynqverify1", "user":"bp4", "verification_key":"utbiv"}' -p asynqverify1@active + docker exec -it ux-main cleos --url $HOST --wallet-url $WALLET push action eosio.info adduserver '{"kyc_account":"asynqverify1", "user":"bp5", "verification_key":"drliv"}' -p asynqverify1@active + docker exec -it ux-main cleos --url $HOST --wallet-url $WALLET push action eosio.info adduserver '{"kyc_account":"asynqverify1", "user":"bp5", "verification_key":"utbiv"}' -p asynqverify1@active + + ;; + reindex) + echo "Reindex testing existing data for asynq contract" + docker exec -it ux-main cleos --url $HOST --wallet-url $WALLET push action asynqverify1 reindexlock '{"aggregation": "aggtest"}' -p asynqverify1@active + docker exec -it ux-main cleos --url $HOST --wallet-url $WALLET push action asynqverify1 reindex '{"aggregation": "aggtest", "batch_size": 100}' -p asynqverify1@active + + ;; + printaggregations) + echo "Print Aggregations" + docker exec -it ux-main cleos --url $HOST --wallet-url $WALLET get table asynqverify1 aggtest aggregations + + ;; + *) + echo "AsynqDeploy: Action was not understood" + ;; + esac +done diff --git a/networks/ux/scripts/bootstrap.sh b/networks/ux/scripts/bootstrap.sh index 5d30ce4..54f3b75 100755 --- a/networks/ux/scripts/bootstrap.sh +++ b/networks/ux/scripts/bootstrap.sh @@ -311,6 +311,7 @@ docker exec -it $CONTAINER cleos --url http://127.0.0.1:8888 --wallet-url http:/ echo "" echo "Creating asynqverify1 account" docker exec -it $CONTAINER cleos --url http://127.0.0.1:8888 --wallet-url http://ux-wallet:8901 --verbose system newaccount eosio asynqverify1 EOS7dzAsko6EUpVCwPAM8C4YUMUEHiLSen5c5Q85rvyT1nQJfGmSt EOS7dzAsko6EUpVCwPAM8C4YUMUEHiLSen5c5Q85rvyT1nQJfGmSt --stake-net "5900000.0000 UTX" --stake-cpu "30000000.0000 UTX" --buy-ram "167771.0000 UTXRAM" --transfer # eosio stakes full 35,900,000 UTX + 167,771.9049 UTXRAM to asynqverify1 for initial issuance + account creation +#docker exec -it $CONTAINER cleos --url http://127.0.0.1:8888 --wallet-url http://ux-wallet:8901 --verbose system newaccount eosio asynqverify1 EOS6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV EOS6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV --stake-net "5900000.0000 UTX" --stake-cpu "30000000.0000 UTX" --buy-ram "167771.0000 UTXRAM" --transfer # eosio stakes full 35,900,000 UTX + 167,771.9049 UTXRAM to asynqverify1 for initial issuance + account creation echo "add KYC account testuser1" docker exec -it ux-main cleos --url http://127.0.0.1:8888 --wallet-url http://ux-wallet:8901 push action eosio.info addkycacc '{"account":"asynqverify1"}' -p eosio@active @@ -571,3 +572,12 @@ docker exec -it ux-main cleos --url http://127.0.0.1:8888 --wallet-url http://ux # docker exec -it $CONTAINER cleos --url http://127.0.0.1:8888 --wallet-url http://ux-wallet:8901 push action eosio voteproducer '{"voter":"whale", "proxy":"", "producers":["bp1","bp2","bp3","bp4","bp5","bpa","bpb","bpc","bpd","bpe","bpf","bpg","bph","bpi","bpj","bpk","bpl","bpm","bpn","bpo","bpp"]}' -p whale@active ########### // + +########### clone/build/deploy asynq contract +# bash $DIR/asynq-deploy.sh clone build deploy + +########### asynq contract tests +# echo "" +# echo "Test asynq contract" +# bash $DIR/asynq-deploy.sh addtestdata printaggregations reindex printaggregations +########### //