diff --git a/boot.sh b/boot.sh index 4272e93..f622e7a 100644 --- a/boot.sh +++ b/boot.sh @@ -2,7 +2,6 @@ export RPC_PROVIDER=${RPC_PROVIDER:-http://localhost:8545} export CHAIN_SPEC=${CHAIN_SPEC:-evm:celo:1337:celo} export KEY_FILE=${KEY_FILE:-keyfile.json} export RPC_DIALECT=${RPC_DIALECT:-chainlib_eth_celo} -export WRITER_KEY_FILE=${WRITER_KEY_FILE:-$KEY_FILE} export TOKEN_NAME="Testtoken" export TOKEN_SYMBOL=TST @@ -21,7 +20,15 @@ set +e t=$(mktemp -d) # get the writer keyfile address -writer=$(eth-keyfile -d $WRITER_KEY_FILE) +publisher=$(eth-keyfile -d $KEY_FILE) +if [ -z "$publisher" ]; then + exit 1 +fi +writer=${WRITER_ADDRESS:-$publisher} +writer=$(eth-checksum $writer) +>&2 echo publisher: $publisher +>&2 echo writer: $writer +>&2 echo datadir: $t # publish a voucher token token=$(erc20-demurrage-token-publish --name $TOKEN_NAME --symbol $TOKEN_SYMBOL --decimals $TOKEN_DECIMALS --demurrage-level $TOKEN_DEMURRAGE --redistribution-period $TOKEN_PERIOD --sink-address $TOKEN_SINK_ADDRESS -y $KEY_FILE --fee-limit 5000000 -s -w $log | tee $t/token.txt) @@ -59,4 +66,15 @@ eth-encode -y $KEY_FILE --mode tx --signature addWriter a:$writer -e $(eth-check eth-encode -y $KEY_FILE --mode tx --signature addWriter a:$writer -e $(eth-checksum $token) --fee-limit 100000 -s -w $log eth-encode -y $KEY_FILE --mode tx --signature addWriter a:$writer -e $(eth-checksum $index) --fee-limit 100000 -s -w $log +# publish contract registry +contracts=$(eth-contract-registry-publish -y $KEY_FILE --fee-limit 2000000 -s -w $log --identifier TrainingVoucher --identifier AccountIndex --identifier TokenIndex --identifier GasFaucet | tee $t/contracts.txt) +contracts=$(eth-checksum $contracts) + +eth-contract-registry-set -y $KEY_FILE --fee-limit 100000 -s -w $log -e $contracts -a $(eth-checksum $token) TrainingVoucher +eth-contract-registry-set -y $KEY_FILE --fee-limit 100000 -s -w $log -e $contracts -a $(eth-checksum $accounts) AccountIndex +eth-contract-registry-set -y $KEY_FILE --fee-limit 100000 -s -w $log -e $contracts -a $(eth-checksum $index) TokenIndex +eth-contract-registry-set -y $KEY_FILE --fee-limit 100000 -s -w $log -e $contracts -a $(eth-checksum $gasfaucet) GasFaucet + set -e + +echo $contracts diff --git a/requirements.txt b/requirements.txt index 472b28e..3a19cd0 100644 --- a/requirements.txt +++ b/requirements.txt @@ -2,5 +2,6 @@ eth-accounts-index==0.3.4 eth-faucet==0.1.1 eth-token-index==0.4.0 eth-address-index==0.6.0 -erc20-transfer-authorization==0.4.1 -erc20-demurrage-token==0.3.3 +#erc20-transfer-authorization==0.4.1 +erc20-demurrage-token==0.3.4 +eth-contract-registry==0.9.0