Seed script rehabilitated with chainlib

This commit is contained in:
nolash 2021-03-25 10:34:53 +01:00
parent 5bf30afb07
commit 72eb61b1c2
Signed by untrusted user who does not match committer: lash
GPG Key ID: 21D2E7BB88C2A746
4 changed files with 14 additions and 12 deletions

View File

@ -1,9 +1,9 @@
cic-base~=0.1.2a20
cic-base~=0.1.2a21
web3==5.12.2
celery==4.4.7
crypto-dev-signer~=0.4.14a8
confini~=0.3.6rc3
cic-eth-registry~=0.5.4a3
cic-eth-registry~=0.5.4a4
#cic-bancor~=0.0.6
redis==3.5.3
alembic==1.4.2
@ -17,7 +17,7 @@ uWSGI==2.0.19.1
semver==2.13.0
websocket-client==0.57.0
moolb~=0.1.1b2
eth-address-index~=0.1.1a3
eth-address-index~=0.1.1a4
chainlib~=0.0.1a32
hexathon~=0.0.1a5
chainsyncer~=0.0.1a20

View File

@ -57,8 +57,8 @@ WORKDIR /home/grassroots
USER grassroots
ARG pip_extra_index_url=https://pip.grassrootseconomics.net:8433
ARG cic_base_version=0.1.2a19
ARG cic_eth_version=0.10.1a5+build.8675b1a2
ARG cic_base_version=0.1.2a20
ARG cic_eth_version=0.10.1a5+build.5bf30afb
ARG cic_contracts_version=0.0.2a2
RUN pip install --user --extra-index-url $pip_extra_index_url cic-base[full_graph]==$cic_base_version \
cic-eth==$cic_eth_version \

View File

@ -12,6 +12,7 @@ source ${CIC_DATA_DIR}/.env_all
DEV_PIP_EXTRA_INDEX_URL=${DEV_PIP_EXTRA_INDEX_URL:-https://pip.grassrootseconomics.net:8433}
DEV_DATABASE_NAME_CIC_ETH=${DEV_DATABASE_NAME_CIC_ETH:-"cic-eth"}
CIC_DATA_DIR=${CIC_DATA_DIR:-/tmp/cic}
ETH_PASSPHRASE=''
# Debug flag
DEV_ETH_ACCOUNT_CONTRACT_DEPLOYER=0xEb3907eCad74a0013c259D5874AE7f22DcBcC95C
@ -26,11 +27,12 @@ env_out_file=${CIC_DATA_DIR}/.env_seed
init_level_file=${CIC_DATA_DIR}/.init
truncate $env_out_file -s 0
#pip install --extra-index-url https://pip.grassrootseconomics.net:8433 chainlib==0.0.1a22
set -e
set -a
#pip install --extra-index-url https://pip.grassrootseconomics.net:8433 chainlib==0.0.1a22
pip install --extra-index-url https://pip.grassrootseconomics.net:8433 eth-address-index==0.1.1a4 chainlib==0.0.1a33
# get required addresses from registries
DEV_TOKEN_INDEX_ADDRESS=`eth-contract-registry-list -i $CIC_CHAIN_SPEC -p $ETH_PROVIDER -r $CIC_REGISTRY_ADDRESS -f brief TokenRegistry`
DEV_RESERVE_ADDRESS=`eth-token-index-list -i $CIC_CHAIN_SPEC -p $ETH_PROVIDER -a $DEV_TOKEN_INDEX_ADDRESS -f brief SRF`
@ -63,13 +65,13 @@ cic-eth-tag -i $CIC_CHAIN_SPEC ACCOUNTS_INDEX_WRITER $DEV_ETH_ACCOUNT_ACCOUNTS_I
# Transfer gas to custodial gas provider adddress
>&2 echo gift gas to gas gifter
>&2 eth-gas -y $keystore_file -i $CIC_CHAIN_SPEC -p $ETH_PROVIDER -w $debug $DEV_ETH_ACCOUNT_GAS_GIFTER $gas_amount
>&2 eth-gas --send -y $keystore_file -i $CIC_CHAIN_SPEC -p $ETH_PROVIDER -w $debug $DEV_ETH_ACCOUNT_GAS_GIFTER $gas_amount
>&2 echo gift gas to sarafu token owner
>&2 eth-gas -y $keystore_file -i $CIC_CHAIN_SPEC -p $ETH_PROVIDER -w $debug $DEV_ETH_ACCOUNT_SARAFU_GIFTER $gas_amount
>&2 eth-gas --send -y $keystore_file -i $CIC_CHAIN_SPEC -p $ETH_PROVIDER -w $debug $DEV_ETH_ACCOUNT_SARAFU_GIFTER $gas_amount
>&2 echo gift gas to account index owner
>&2 eth-gas -y $keystore_file -i $CIC_CHAIN_SPEC -p $ETH_PROVIDER -w $debug $DEV_ETH_ACCOUNT_ACCOUNTS_INDEX_WRITER $gas_amount
>&2 eth-gas --send -y $keystore_file -i $CIC_CHAIN_SPEC -p $ETH_PROVIDER -w $debug $DEV_ETH_ACCOUNT_ACCOUNTS_INDEX_WRITER $gas_amount
# Send token to token creator
@ -86,7 +88,7 @@ export DEV_ETH_SARAFU_TOKEN_ADDRESS=$DEV_ETH_RESERVE_ADDRESS
# Transfer tokens to gifter address
>&2 echo "transfer sarafu tokens to token gifter address"
>&2 eth-transfer -y $keystore_file -i $CIC_CHAIN_SPEC -p $ETH_PROVIDER --token-address $DEV_ETH_SARAFU_TOKEN_ADDRESS --abi-dir $abi_dir -w $debug $DEV_ETH_ACCOUNT_SARAFU_GIFTER ${token_amount:0:-1}
>&2 eth-transfer -y $keystore_file -i $CIC_CHAIN_SPEC -p $ETH_PROVIDER --token-address $DEV_RESERVE_ADDRESS -w $debug $DEV_ETH_ACCOUNT_SARAFU_GIFTER ${token_amount:0:-1}
#echo -n 0 > $init_level_file

View File

@ -101,7 +101,7 @@ services:
CELERY_BROKER_URL: ${CELERY_BROKER_URL:-redis://redis:6379}
CELERY_RESULT_URL: ${CELERY_RESULT_URL:-redis://redis:6379}
DEV_PIP_EXTRA_INDEX_URL: ${DEV_PIP_EXTRA_INDEX_URL:-https://pip.grassrootseconomics.net:8433}
RUN_MASK: 2 #0: noop 1: contract migrations 2: seed data
RUN_MASK: 3 #0: noop 1: contract migrations 2: seed data
command: ["./run_job.sh"]
#command: ["./reset.sh"]
depends_on: