From a49978cc36b490c8434ffed125f6d7f742402b58 Mon Sep 17 00:00:00 2001 From: Louis Holbrook Date: Tue, 24 Aug 2021 21:07:36 +0000 Subject: [PATCH] cic-eth data seeding rehab --- apps/cic-cache/docker/Dockerfile | 3 ++- apps/cic-cache/docker/Dockerfile_ci | 3 ++- apps/cic-cache/requirements.txt | 4 ++-- apps/cic-eth/admin_requirements.txt | 4 ++-- apps/cic-eth/cic_eth/version.py | 2 +- apps/cic-eth/docker/Dockerfile | 3 +++ apps/cic-eth/docker/Dockerfile_ci | 2 ++ apps/cic-eth/requirements.txt | 2 +- apps/cic-eth/services_requirements.txt | 12 +++++------ apps/cic-eth/test_requirements.txt | 2 +- apps/cic-eth/tools_requirements.txt | 2 +- apps/contract-migration/docker/Dockerfile_ci | 5 +++-- .../override_requirements.txt | 2 +- apps/contract-migration/requirements.txt | 20 +++++++++---------- apps/data-seeding/cic_eth/import_balance.py | 6 ++---- apps/data-seeding/eth/import_balance.py | 1 - apps/data-seeding/requirements.txt | 14 ++++++------- 17 files changed, 46 insertions(+), 41 deletions(-) diff --git a/apps/cic-cache/docker/Dockerfile b/apps/cic-cache/docker/Dockerfile index 2aa7e311..368e08c9 100644 --- a/apps/cic-cache/docker/Dockerfile +++ b/apps/cic-cache/docker/Dockerfile @@ -10,9 +10,10 @@ COPY requirements.txt . ARG EXTRA_INDEX_URL="https://pip.grassrootseconomics.net:8433" ARG GITLAB_PYTHON_REGISTRY="https://gitlab.com/api/v4/projects/27624814/packages/pypi/simple" +ARG EXTRA_PIP_ARGS="" RUN --mount=type=cache,mode=0755,target=/root/.cache/pip \ pip install --index-url https://pypi.org/simple \ - --extra-index-url $GITLAB_PYTHON_REGISTRY --extra-index-url $EXTRA_INDEX_URL \ + --extra-index-url $GITLAB_PYTHON_REGISTRY --extra-index-url $EXTRA_INDEX_URL $EXTRA_PIP_ARGS \ -r requirements.txt COPY . . diff --git a/apps/cic-cache/docker/Dockerfile_ci b/apps/cic-cache/docker/Dockerfile_ci index 9f49cac0..67ab3c71 100644 --- a/apps/cic-cache/docker/Dockerfile_ci +++ b/apps/cic-cache/docker/Dockerfile_ci @@ -10,8 +10,9 @@ COPY requirements.txt . ARG EXTRA_INDEX_URL="https://pip.grassrootseconomics.net:8433" ARG GITLAB_PYTHON_REGISTRY="https://gitlab.com/api/v4/projects/27624814/packages/pypi/simple" +ARG EXTRA_PIP_ARGS="" RUN pip install --index-url https://pypi.org/simple \ - --extra-index-url $GITLAB_PYTHON_REGISTRY --extra-index-url $EXTRA_INDEX_URL \ + --extra-index-url $GITLAB_PYTHON_REGISTRY --extra-index-url $EXTRA_INDEX_URL $EXTRA_PIP_ARGS \ -r requirements.txt COPY . . diff --git a/apps/cic-cache/requirements.txt b/apps/cic-cache/requirements.txt index 029b8a61..dd85ce29 100644 --- a/apps/cic-cache/requirements.txt +++ b/apps/cic-cache/requirements.txt @@ -10,6 +10,6 @@ celery==4.4.7 redis==3.5.3 chainsyncer[sql]>=0.0.6a1,<0.1.0 erc20-faucet>=0.3.2a1, <0.4.0 -chainlib-eth==0.0.9a2 -chainlib==0.0.9a2 +chainlib-eth>=0.0.9a3,<0.1.0 +chainlib>=0.0.9a2,<0.1.0 eth-address-index>=0.2.3a1,<0.3.0 diff --git a/apps/cic-eth/admin_requirements.txt b/apps/cic-eth/admin_requirements.txt index a82a8a28..241c2f63 100644 --- a/apps/cic-eth/admin_requirements.txt +++ b/apps/cic-eth/admin_requirements.txt @@ -1,5 +1,5 @@ SQLAlchemy==1.3.20 -cic-eth-registry>=0.6.1a1,<0.7.0 +cic-eth-registry>=0.6.1a2,<0.7.0 hexathon~=0.0.1a8 chainqueue>=0.0.3a2,<0.1.0 -eth-erc20>=0.1.2a1,<0.2.0 +eth-erc20>=0.1.2a2,<0.2.0 diff --git a/apps/cic-eth/cic_eth/version.py b/apps/cic-eth/cic_eth/version.py index be200e50..69c53f54 100644 --- a/apps/cic-eth/cic_eth/version.py +++ b/apps/cic-eth/cic_eth/version.py @@ -10,7 +10,7 @@ version = ( 0, 12, 4, - 'alpha.3', + 'alpha.4', ) version_object = semver.VersionInfo( diff --git a/apps/cic-eth/docker/Dockerfile b/apps/cic-eth/docker/Dockerfile index e627361c..bbb0fbbe 100644 --- a/apps/cic-eth/docker/Dockerfile +++ b/apps/cic-eth/docker/Dockerfile @@ -8,6 +8,7 @@ FROM registry.gitlab.com/grassrootseconomics/cic-base-images:python-3.8.6-dev-55 ARG EXTRA_INDEX_URL="https://pip.grassrootseconomics.net:8433" ARG GITLAB_PYTHON_REGISTRY="https://gitlab.com/api/v4/projects/27624814/packages/pypi/simple" +ARG EXTRA_PIP_ARGS="" #RUN --mount=type=cache,mode=0755,target=/root/.cache/pip \ # pip install --index-url https://pypi.org/simple \ # --force-reinstall \ @@ -18,6 +19,7 @@ RUN --mount=type=cache,mode=0755,target=/root/.cache/pip \ pip install --index-url https://pypi.org/simple \ --extra-index-url $GITLAB_PYTHON_REGISTRY \ --extra-index-url $EXTRA_INDEX_URL \ + $EXTRA_PIP_ARGS \ -r requirements.txt \ -r services_requirements.txt \ -r admin_requirements.txt @@ -31,6 +33,7 @@ RUN --mount=type=cache,mode=0755,target=/root/.cache/pip \ pip install --index-url https://pypi.org/simple \ --extra-index-url $GITLAB_PYTHON_REGISTRY \ --extra-index-url $EXTRA_INDEX_URL \ + $EXTRA_PIP_ARGS \ cic-eth-aux-erc20-demurrage-token~=0.0.2a6 COPY docker/entrypoints/* ./ diff --git a/apps/cic-eth/docker/Dockerfile_ci b/apps/cic-eth/docker/Dockerfile_ci index 89efdcc6..e7bcc831 100644 --- a/apps/cic-eth/docker/Dockerfile_ci +++ b/apps/cic-eth/docker/Dockerfile_ci @@ -9,6 +9,7 @@ WORKDIR /usr/src/cic-eth ARG EXTRA_INDEX_URL="https://pip.grassrootseconomics.net:8433" ARG GITLAB_PYTHON_REGISTRY="https://gitlab.com/api/v4/projects/27624814/packages/pypi/simple" +ARG EXTRA_PIP_ARGS="" #RUN --mount=type=cache,mode=0755,target=/root/.cache/pip \ # pip install --index-url https://pypi.org/simple \ # --force-reinstall \ @@ -18,6 +19,7 @@ COPY *requirements.txt . RUN pip install --index-url https://pypi.org/simple \ --extra-index-url $GITLAB_PYTHON_REGISTRY \ --extra-index-url $EXTRA_INDEX_URL \ + $EXTRA_PIP_ARGS \ -r requirements.txt \ -r services_requirements.txt \ -r admin_requirements.txt diff --git a/apps/cic-eth/requirements.txt b/apps/cic-eth/requirements.txt index c0b271cb..d3bda3d4 100644 --- a/apps/cic-eth/requirements.txt +++ b/apps/cic-eth/requirements.txt @@ -1,3 +1,3 @@ celery==4.4.7 -chainlib-eth>=0.0.9a2,<0.1.0 +chainlib-eth>=0.0.9a3,<0.1.0 semver==2.13.0 diff --git a/apps/cic-eth/services_requirements.txt b/apps/cic-eth/services_requirements.txt index b6727fad..fd5fe9dd 100644 --- a/apps/cic-eth/services_requirements.txt +++ b/apps/cic-eth/services_requirements.txt @@ -6,10 +6,10 @@ redis==3.5.3 hexathon~=0.0.1a8 pycryptodome==3.10.1 liveness~=0.0.1a7 -eth-address-index>=0.2.3a1,<0.3.0 -eth-accounts-index>=0.1.2a1,<0.2.0 -cic-eth-registry>=0.6.1a1,<0.7.0 -erc20-faucet>=0.3.2a1,<0.4.0 -erc20-transfer-authorization>=0.3.5a1,<0.4.0 -sarafu-faucet>=0.0.7a1,<0.1.0 +eth-address-index>=0.2.3a4,<0.3.0 +eth-accounts-index>=0.1.2a3,<0.2.0 +cic-eth-registry>=0.6.1a2,<0.7.0 +erc20-faucet>=0.3.2a2,<0.4.0 +erc20-transfer-authorization>=0.3.5a2,<0.4.0 +sarafu-faucet>=0.0.7a2,<0.1.0 moolb~=0.1.1b2 diff --git a/apps/cic-eth/test_requirements.txt b/apps/cic-eth/test_requirements.txt index b9fbab61..67462190 100644 --- a/apps/cic-eth/test_requirements.txt +++ b/apps/cic-eth/test_requirements.txt @@ -6,4 +6,4 @@ pytest-redis==2.0.0 redis==3.5.3 eth-tester==0.5.0b3 py-evm==0.3.0a20 -eth-erc20~=0.1.2a1 +eth-erc20~=0.1.2a2 diff --git a/apps/cic-eth/tools_requirements.txt b/apps/cic-eth/tools_requirements.txt index 0e0c7631..303dfce4 100644 --- a/apps/cic-eth/tools_requirements.txt +++ b/apps/cic-eth/tools_requirements.txt @@ -1,6 +1,6 @@ crypto-dev-signer>=0.4.15a1,<=0.4.15 chainqueue>=0.0.3a1,<0.1.0 -cic-eth-registry>=0.6.1a1,<0.7.0 +cic-eth-registry>=0.6.1a2,<0.7.0 redis==3.5.3 hexathon~=0.0.1a8 pycryptodome==3.10.1 diff --git a/apps/contract-migration/docker/Dockerfile_ci b/apps/contract-migration/docker/Dockerfile_ci index e533a29b..3f56d720 100644 --- a/apps/contract-migration/docker/Dockerfile_ci +++ b/apps/contract-migration/docker/Dockerfile_ci @@ -23,15 +23,16 @@ COPY override_requirements.txt . ARG pip_index_url=https://pypi.org/simple ARG EXTRA_INDEX_URL="https://pip.grassrootseconomics.net:8433" -ARG EXTRA_PIP_ARGS="" ARG GITLAB_PYTHON_REGISTRY="https://gitlab.com/api/v4/projects/27624814/packages/pypi/simple" +ARG EXTRA_PIP_ARGS="" ARG pip_trusted_host=pypi.org RUN pip install --index-url https://pypi.org/simple \ pip install --index-url https://pypi.org/simple \ --pre \ --force-reinstall \ + --pre \ --trusted-host $pip_trusted_host \ - --extra-index-url $GITLAB_PYTHON_REGISTRY --extra-index-url $EXTRA_INDEX_URL $EXTRA_PIP_ARGS\ + --extra-index-url $GITLAB_PYTHON_REGISTRY --extra-index-url $EXTRA_INDEX_URL $EXTRA_PIP_ARGS \ -r requirements.txt RUN pip install --index-url https://pypi.org/simple \ diff --git a/apps/contract-migration/override_requirements.txt b/apps/contract-migration/override_requirements.txt index 86b09e17..27979c8d 100644 --- a/apps/contract-migration/override_requirements.txt +++ b/apps/contract-migration/override_requirements.txt @@ -1,4 +1,4 @@ -eth-contract-registry==0.6.3a2 +#eth-contract-registry==0.6.3a2 #erc20-demurrage-token==0.0.2a3 #eth-address-index==0.1.1a12 diff --git a/apps/contract-migration/requirements.txt b/apps/contract-migration/requirements.txt index 36fca8da..51c7efcc 100644 --- a/apps/contract-migration/requirements.txt +++ b/apps/contract-migration/requirements.txt @@ -1,10 +1,10 @@ -cic-eth[tools]==0.12.4a3 -chainlib-eth>=0.0.9a2,<0.1.0 -eth-erc20>=0.1.2a1,<0.2.0 -erc20-demurrage-token>=0.0.5a1,<0.1.0 -eth-accounts-index>=0.1.2a1,<0.2.0 -eth-address-index>=0.2.3a3,<0.3.0 -cic-eth-registry>=0.6.1a1,<0.7.0 -erc20-faucet>=0.3.2a1,<0.4.0 -erc20-transfer-authorization>=0.3.5a1,<0.4.0 -sarafu-faucet>=0.0.7a1,<0.1.0 +cic-eth[tools]==0.12.4a4 +chainlib-eth>=0.0.9a3,<0.1.0 +eth-erc20>=0.1.2a2,<0.2.0 +erc20-demurrage-token>=0.0.5a2,<0.1.0 +eth-accounts-index>=0.1.2a2,<0.2.0 +eth-address-index>=0.2.3a4,<0.3.0 +cic-eth-registry>=0.6.1a2,<0.7.0 +erc20-transfer-authorization>=0.3.5a2,<0.4.0 +erc20-faucet>=0.3.2a2,<0.4.0 +sarafu-faucet>=0.0.7a2,<0.1.0 diff --git a/apps/data-seeding/cic_eth/import_balance.py b/apps/data-seeding/cic_eth/import_balance.py index 7f7c840c..0a25380e 100644 --- a/apps/data-seeding/cic_eth/import_balance.py +++ b/apps/data-seeding/cic_eth/import_balance.py @@ -38,7 +38,7 @@ from crypto_dev_signer.eth.signer import ReferenceSigner as EIP155Signer from crypto_dev_signer.keystore.dict import DictKeystore from cic_types.models.person import Person from eth_erc20 import ERC20 -from cic_base.eth.syncer import chain_interface +from cic_eth.cli.chain import chain_interface from eth_accounts_index import AccountsIndex from eth_contract_registry import Registry from eth_token_index import TokenUniqueSymbolIndex @@ -215,8 +215,6 @@ def main(): logg.critical('lookup failed for token {}: {}'.format(token_symbol, e)) sys.exit(1) logg.info('found token address {}'.format(token_address)) - - sys.exit(0) syncer_backend = MemBackend(chain_str, 0) @@ -248,7 +246,7 @@ def main(): syncer_backend.set(block_offset, 0) syncer = HeadSyncer(syncer_backend, chain_interface, block_callback=progress_callback) - handler = Handler(conn, chain_spec, user_dir, balances, sarafu_token_address, signer, gas_oracle, nonce_oracle) + handler = Handler(conn, chain_spec, user_dir, balances, token_address, signer, gas_oracle, nonce_oracle) syncer.add_filter(handler) syncer.loop(1, conn) diff --git a/apps/data-seeding/eth/import_balance.py b/apps/data-seeding/eth/import_balance.py index 62374503..55a08c7e 100644 --- a/apps/data-seeding/eth/import_balance.py +++ b/apps/data-seeding/eth/import_balance.py @@ -37,7 +37,6 @@ from crypto_dev_signer.eth.signer import ReferenceSigner as EIP155Signer from crypto_dev_signer.keystore.dict import DictKeystore from cic_types.models.person import Person from eth_erc20 import ERC20 -#from cic_base.eth.syncer import chain_interface from cic_eth.cli.chain import chain_interface from eth_accounts_index import AccountsIndex from eth_contract_registry import Registry diff --git a/apps/data-seeding/requirements.txt b/apps/data-seeding/requirements.txt index c6efb4b8..b4aad2ee 100644 --- a/apps/data-seeding/requirements.txt +++ b/apps/data-seeding/requirements.txt @@ -1,13 +1,13 @@ sarafu-faucet~=0.0.7a1 -cic-eth[tools]~=0.12.4a2 +cic-eth[tools]~=0.12.4a4 cic-types~=0.1.0a14 crypto-dev-signer>=0.4.15a1,<=0.4.15 faker==4.17.1 chainsyncer~=0.0.6a1 -chainlib-eth~=0.0.9a2 -eth-address-index~=0.2.3a1 -eth-contract-registry~=0.6.3a1 -eth-accounts-index~=0.1.2a1 -eth-erc20~=0.1.2a1 -erc20-faucet~=0.3.2a1 +chainlib-eth~=0.0.9a3 +eth-address-index~=0.2.3a4 +eth-contract-registry~=0.6.3a3 +eth-accounts-index~=0.1.2a2 +eth-erc20~=0.1.2a2 +erc20-faucet~=0.3.2a2 psycopg2==2.8.6