Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added support for asynq contract (but commented out) #2

Open
wants to merge 1 commit into
base: gnome
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
59 changes: 59 additions & 0 deletions networks/ux/scripts/asynq-deploy.sh
Original file line number Diff line number Diff line change
@@ -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
10 changes: 10 additions & 0 deletions networks/ux/scripts/bootstrap.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
########### //