From 69d00f9a5add47f1ab5a326a0f835c01d550b78c Mon Sep 17 00:00:00 2001 From: nolash Date: Fri, 23 Jul 2021 09:18:11 +0200 Subject: [PATCH] Remove cic-base from cic-cache-tracker, replace with chainlib cli --- apps/cic-cache/MANIFEST.in | 1 + apps/cic-cache/cic_cache/cli/__init__.py | 15 +++++ apps/cic-cache/cic_cache/cli/arg.py | 20 ++++++ apps/cic-cache/cic_cache/cli/base.py | 31 +++++++++ apps/cic-cache/cic_cache/cli/celery.py | 24 +++++++ apps/cic-cache/cic_cache/cli/chain.py | 21 +++++++ apps/cic-cache/cic_cache/cli/config.py | 63 +++++++++++++++++++ apps/cic-cache/cic_cache/cli/registry.py | 33 ++++++++++ apps/cic-cache/cic_cache/cli/rpc.py | 43 +++++++++++++ .../cic_cache/data/config/celery.ini | 5 ++ apps/cic-cache/cic_cache/data/config/cic.ini | 4 ++ .../cic_cache/data/config/database.ini | 10 +++ .../cic_cache/data/config/signer.ini | 2 + .../cic_cache/data/config/syncer.ini | 4 ++ .../versions/6604de4203e2_add_chain_syncer.py | 2 +- .../cic_cache/runnable/daemons/tracker.py | 54 ++++++++-------- apps/cic-cache/config/bancor.ini | 2 - apps/cic-cache/config/cic.ini | 1 - apps/cic-cache/config/docker/bancor.ini | 3 - apps/cic-cache/config/docker/cic.ini | 1 - apps/cic-cache/config/docker/eth.ini | 2 - apps/cic-cache/config/docker/syncer.ini | 3 +- apps/cic-cache/config/eth.ini | 2 - apps/cic-cache/config/syncer.ini | 3 - apps/cic-cache/requirements.txt | 10 +-- apps/cic-cache/setup.cfg | 2 + apps/cic-eth/MANIFEST.in | 2 +- apps/cic-eth/setup.cfg | 2 + apps/data-seeding/requirements.txt | 22 +++---- docker-compose.yml | 7 ++- 30 files changed, 333 insertions(+), 61 deletions(-) create mode 100644 apps/cic-cache/MANIFEST.in create mode 100644 apps/cic-cache/cic_cache/cli/__init__.py create mode 100644 apps/cic-cache/cic_cache/cli/arg.py create mode 100644 apps/cic-cache/cic_cache/cli/base.py create mode 100644 apps/cic-cache/cic_cache/cli/celery.py create mode 100644 apps/cic-cache/cic_cache/cli/chain.py create mode 100644 apps/cic-cache/cic_cache/cli/config.py create mode 100644 apps/cic-cache/cic_cache/cli/registry.py create mode 100644 apps/cic-cache/cic_cache/cli/rpc.py create mode 100644 apps/cic-cache/cic_cache/data/config/celery.ini create mode 100644 apps/cic-cache/cic_cache/data/config/cic.ini create mode 100644 apps/cic-cache/cic_cache/data/config/database.ini create mode 100644 apps/cic-cache/cic_cache/data/config/signer.ini create mode 100644 apps/cic-cache/cic_cache/data/config/syncer.ini delete mode 100644 apps/cic-cache/config/bancor.ini delete mode 100644 apps/cic-cache/config/docker/bancor.ini delete mode 100644 apps/cic-cache/config/docker/eth.ini delete mode 100644 apps/cic-cache/config/eth.ini delete mode 100644 apps/cic-cache/config/syncer.ini diff --git a/apps/cic-cache/MANIFEST.in b/apps/cic-cache/MANIFEST.in new file mode 100644 index 00000000..2630c39c --- /dev/null +++ b/apps/cic-cache/MANIFEST.in @@ -0,0 +1 @@ +include *requirements.txt cic_cache/data/config/* diff --git a/apps/cic-cache/cic_cache/cli/__init__.py b/apps/cic-cache/cic_cache/cli/__init__.py new file mode 100644 index 00000000..4952837d --- /dev/null +++ b/apps/cic-cache/cic_cache/cli/__init__.py @@ -0,0 +1,15 @@ +# local imports +from .base import * +from .chain import ( + EthChainInterface, + chain_interface, + ) +from .rpc import RPC +from .arg import ArgumentParser +from .config import Config +from .celery import CeleryApp +from .registry import ( + connect_registry, + connect_token_registry, + connect_declarator, + ) diff --git a/apps/cic-cache/cic_cache/cli/arg.py b/apps/cic-cache/cic_cache/cli/arg.py new file mode 100644 index 00000000..43428cb1 --- /dev/null +++ b/apps/cic-cache/cic_cache/cli/arg.py @@ -0,0 +1,20 @@ +# external imports +from chainlib.eth.cli import ArgumentParser as BaseArgumentParser + +# local imports +from .base import ( + CICFlag, + Flag, + ) + + +class ArgumentParser(BaseArgumentParser): + + def process_local_flags(self, local_arg_flags): + if local_arg_flags & CICFlag.CELERY: + self.add_argument('-q', '--celery-queue', dest='celery_queue', type=str, default='cic-eth', help='Task queue') + if local_arg_flags & CICFlag.SYNCER: + self.add_argument('--offset', type=int, default=0, help='Start block height for initial history sync') + self.add_argument('--no-history', action='store_true', dest='no_history', help='Skip initial history sync') + if local_arg_flags & CICFlag.CHAIN: + self.add_argument('-r', '--registry-address', type=str, dest='registry_address', help='CIC registry contract address') diff --git a/apps/cic-cache/cic_cache/cli/base.py b/apps/cic-cache/cic_cache/cli/base.py new file mode 100644 index 00000000..84e4ab8d --- /dev/null +++ b/apps/cic-cache/cic_cache/cli/base.py @@ -0,0 +1,31 @@ +# standard imports +import enum + +# external imports +from chainlib.eth.cli import ( + argflag_std_read, + argflag_std_write, + argflag_std_base, + Flag, + ) + +class CICFlag(enum.IntEnum): + + # celery - nibble 1 + CELERY = 1 + + # redis - nibble 2 +# REDIS = 16 +# REDIS_CALLBACK = 32 + + # chain - nibble 3 + CHAIN = 256 + + # sync - nibble 4 + SYNCER = 4096 + + +argflag_local_task = CICFlag.CELERY +#argflag_local_taskcallback = argflag_local_task | CICFlag.REDIS | CICFlag.REDIS_CALLBACK +argflag_local_chain = CICFlag.CHAIN +argflag_local_sync = CICFlag.SYNCER | CICFlag.CHAIN diff --git a/apps/cic-cache/cic_cache/cli/celery.py b/apps/cic-cache/cic_cache/cli/celery.py new file mode 100644 index 00000000..16180d4a --- /dev/null +++ b/apps/cic-cache/cic_cache/cli/celery.py @@ -0,0 +1,24 @@ +# standard imports +import logging + +# external imports +import celery + +logg = logging.getLogger(__name__) + + +class CeleryApp: + + @classmethod + def from_config(cls, config): + backend_url = config.get('CELERY_RESULT_URL') + broker_url = config.get('CELERY_BROKER_URL') + celery_app = None + if backend_url != None: + celery_app = celery.Celery(broker=broker_url, backend=backend_url) + logg.info('creating celery app on {} with backend on {}'.format(broker_url, backend_url)) + else: + celery_app = celery.Celery(broker=broker_url) + logg.info('creating celery app without results backend on {}'.format(broker_url)) + + return celery_app diff --git a/apps/cic-cache/cic_cache/cli/chain.py b/apps/cic-cache/cic_cache/cli/chain.py new file mode 100644 index 00000000..100139e7 --- /dev/null +++ b/apps/cic-cache/cic_cache/cli/chain.py @@ -0,0 +1,21 @@ +# external imports +from chainlib.eth.block import ( + block_by_number, + Block, + ) +from chainlib.eth.tx import ( + receipt, + Tx, + ) +from chainlib.interface import ChainInterface + + +class EthChainInterface(ChainInterface): + + def __init__(self): + self._tx_receipt = receipt + self._block_by_number = block_by_number + self._block_from_src = Block.from_src + self._src_normalize = Tx.src_normalize + +chain_interface = EthChainInterface() diff --git a/apps/cic-cache/cic_cache/cli/config.py b/apps/cic-cache/cic_cache/cli/config.py new file mode 100644 index 00000000..c21d46dc --- /dev/null +++ b/apps/cic-cache/cic_cache/cli/config.py @@ -0,0 +1,63 @@ +# standard imports +import os +import logging + +# external imports +from chainlib.eth.cli import ( + Config as BaseConfig, + Flag, + ) + +# local imports +from .base import CICFlag + +script_dir = os.path.dirname(os.path.realpath(__file__)) + +logg = logging.getLogger(__name__) + + +class Config(BaseConfig): + + local_base_config_dir = os.path.join(script_dir, '..', 'data', 'config') + + @classmethod + def from_args(cls, args, arg_flags, local_arg_flags, extra_args={}, default_config_dir=None, base_config_dir=None, default_fee_limit=None): + expanded_base_config_dir = [cls.local_base_config_dir] + if base_config_dir != None: + if isinstance(base_config_dir, str): + base_config_dir = [base_config_dir] + for d in base_config_dir: + expanded_base_config_dir.append(d) + config = BaseConfig.from_args(args, arg_flags, extra_args=extra_args, default_config_dir=default_config_dir, base_config_dir=expanded_base_config_dir, load_callback=None) + + local_args_override = {} +# if local_arg_flags & CICFlag.REDIS: +# local_args_override['REDIS_HOST'] = getattr(args, 'redis_host') +# local_args_override['REDIS_PORT'] = getattr(args, 'redis_port') +# local_args_override['REDIS_DB'] = getattr(args, 'redis_db') +# local_args_override['REDIS_TIMEOUT'] = getattr(args, 'redis_timeout') + + if local_arg_flags & CICFlag.CHAIN: + local_args_override['CIC_REGISTRY_ADDRESS'] = getattr(args, 'registry_address') + + if local_arg_flags & CICFlag.CELERY: + local_args_override['CELERY_QUEUE'] = getattr(args, 'celery_queue') + + if local_arg_flags & CICFlag.SYNCER: + local_args_override['SYNCER_OFFSET'] = getattr(args, 'offset') + local_args_override['SYNCER_NO_HISTORY'] = getattr(args, 'no_history') + + config.dict_override(local_args_override, 'local cli args') + +# if local_arg_flags & CICFlag.REDIS_CALLBACK: +# config.add(getattr(args, 'redis_host_callback'), '_REDIS_HOST_CALLBACK') +# config.add(getattr(args, 'redis_port_callback'), '_REDIS_PORT_CALLBACK') + + if local_arg_flags & CICFlag.CELERY: + config.add(config.true('CELERY_DEBUG'), 'CELERY_DEBUG', exists_ok=True) + + logg.debug('config loaded:\n{}'.format(config)) + + return config + + diff --git a/apps/cic-cache/cic_cache/cli/registry.py b/apps/cic-cache/cic_cache/cli/registry.py new file mode 100644 index 00000000..1d3e0d31 --- /dev/null +++ b/apps/cic-cache/cic_cache/cli/registry.py @@ -0,0 +1,33 @@ +# standard imports +import logging + +# external imports +from cic_eth_registry import CICRegistry +from cic_eth_registry.lookup.declarator import AddressDeclaratorLookup +from cic_eth_registry.lookup.tokenindex import TokenIndexLookup +from chainlib.eth.constant import ZERO_ADDRESS + +logg = logging.getLogger() + + +def connect_token_registry(self, conn, chain_spec, sender_address=ZERO_ADDRESS): + registry = CICRegistry(chain_spec, conn) + token_registry_address = registry.by_name('TokenRegistry', sender_address=sender_address) + logg.debug('using token registry address {}'.format(token_registry_address)) + lookup = TokenIndexLookup(chain_spec, token_registry_address) + CICRegistry.add_lookup(lookup) + + +def connect_declarator(self, conn, chain_spec, trusted_addresses, sender_address=ZERO_ADDRESS): + registry = CICRegistry(chain_spec, conn) + declarator_address = registry.by_name('AddressDeclarator', sender_address=sender_address) + logg.debug('using declarator address {}'.format(declarator_address)) + lookup = AddressDeclaratorLookup(chain_spec, declarator_address, trusted_addresses) + CICRegistry.add_lookup(lookup) + + +def connect_registry(conn, chain_spec, registry_address, sender_address=ZERO_ADDRESS): + CICRegistry.address = registry_address + registry = CICRegistry(chain_spec, conn) + registry_address = registry.by_name('ContractRegistry', sender_address=sender_address) + return registry diff --git a/apps/cic-cache/cic_cache/cli/rpc.py b/apps/cic-cache/cic_cache/cli/rpc.py new file mode 100644 index 00000000..7f6500ae --- /dev/null +++ b/apps/cic-cache/cic_cache/cli/rpc.py @@ -0,0 +1,43 @@ +# standard imports +import logging + +# external imports +from chainlib.connection import ( + RPCConnection, + ConnType, + ) +from chainlib.eth.connection import EthUnixSignerConnection +from chainlib.chain import ChainSpec + +logg = logging.getLogger(__name__) + + +class RPC: + + def __init__(self, chain_spec, rpc_provider, signer_provider=None): + self.chain_spec = chain_spec + self.rpc_provider = rpc_provider + self.signer_provider = signer_provider + + + def get_default(self): + return RPCConnection.connect(self.chain_spec, 'default') + + + @staticmethod + def from_config(config): + chain_spec = ChainSpec.from_chain_str(config.get('CHAIN_SPEC')) + RPCConnection.register_location(config.get('RPC_HTTP_PROVIDER'), chain_spec, 'default') + if config.get('SIGNER_PROVIDER'): + RPCConnection.register_constructor(ConnType.UNIX, EthUnixSignerConnection, tag='signer') + RPCConnection.register_location(config.get('SIGNER_PROVIDER'), chain_spec, 'signer') + rpc = RPC(chain_spec, config.get('RPC_HTTP_PROVIDER'), signer_provider=config.get('SIGNER_PROVIDER')) + logg.info('set up rpc: {}'.format(rpc)) + return rpc + + + def __str__(self): + return 'RPC factory, chain {}, rpc {}, signer {}'.format(self.chain_spec, self.rpc_provider, self.signer_provider) + + + diff --git a/apps/cic-cache/cic_cache/data/config/celery.ini b/apps/cic-cache/cic_cache/data/config/celery.ini new file mode 100644 index 00000000..f2ad10ab --- /dev/null +++ b/apps/cic-cache/cic_cache/data/config/celery.ini @@ -0,0 +1,5 @@ +[celery] +broker_url = redis://localhost:6379 +result_url = +queue = cic-eth +debug = 0 diff --git a/apps/cic-cache/cic_cache/data/config/cic.ini b/apps/cic-cache/cic_cache/data/config/cic.ini new file mode 100644 index 00000000..b4275352 --- /dev/null +++ b/apps/cic-cache/cic_cache/data/config/cic.ini @@ -0,0 +1,4 @@ +[cic] +registry_address = +trust_address = +health_modules = cic_eth.check.db,cic_eth.check.redis,cic_eth.check.signer,cic_eth.check.gas diff --git a/apps/cic-cache/cic_cache/data/config/database.ini b/apps/cic-cache/cic_cache/data/config/database.ini new file mode 100644 index 00000000..e32e62f3 --- /dev/null +++ b/apps/cic-cache/cic_cache/data/config/database.ini @@ -0,0 +1,10 @@ +[database] +engine = +driver = +host = +port = +name = cic-cache +user = +password = +debug = 0 +pool_size = 0 diff --git a/apps/cic-cache/cic_cache/data/config/signer.ini b/apps/cic-cache/cic_cache/data/config/signer.ini new file mode 100644 index 00000000..21327bac --- /dev/null +++ b/apps/cic-cache/cic_cache/data/config/signer.ini @@ -0,0 +1,2 @@ +[signer] +provider = diff --git a/apps/cic-cache/cic_cache/data/config/syncer.ini b/apps/cic-cache/cic_cache/data/config/syncer.ini new file mode 100644 index 00000000..255dc00f --- /dev/null +++ b/apps/cic-cache/cic_cache/data/config/syncer.ini @@ -0,0 +1,4 @@ +[syncer] +loop_interval = 1 +offset = 0 +no_history = 0 diff --git a/apps/cic-cache/cic_cache/db/migrations/default/versions/6604de4203e2_add_chain_syncer.py b/apps/cic-cache/cic_cache/db/migrations/default/versions/6604de4203e2_add_chain_syncer.py index 55a5ecca..1b845ff6 100644 --- a/apps/cic-cache/cic_cache/db/migrations/default/versions/6604de4203e2_add_chain_syncer.py +++ b/apps/cic-cache/cic_cache/db/migrations/default/versions/6604de4203e2_add_chain_syncer.py @@ -7,7 +7,7 @@ Create Date: 2021-04-01 08:10:29.156243 """ from alembic import op import sqlalchemy as sa -from chainsyncer.db.migrations.sqlalchemy import ( +from chainsyncer.db.migrations.default.export import ( chainsyncer_upgrade, chainsyncer_downgrade, ) diff --git a/apps/cic-cache/cic_cache/runnable/daemons/tracker.py b/apps/cic-cache/cic_cache/runnable/daemons/tracker.py index 12c577b0..50876e5f 100644 --- a/apps/cic-cache/cic_cache/runnable/daemons/tracker.py +++ b/apps/cic-cache/cic_cache/runnable/daemons/tracker.py @@ -9,7 +9,6 @@ import re # external imports import sqlalchemy -from cic_base.eth.syncer import chain_interface from cic_eth_registry import CICRegistry from cic_eth_registry.error import UnknownContractError from chainlib.chain import ChainSpec @@ -27,6 +26,7 @@ from chainsyncer.driver.history import HistorySyncer from chainsyncer.db.models.base import SessionBase # local imports +import cic_cache.cli from cic_cache.db import ( dsn_from_config, add_tag, @@ -36,32 +36,36 @@ from cic_cache.runnable.daemons.filters import ( FaucetFilter, ) -script_dir = os.path.realpath(os.path.dirname(__file__)) +logging.basicConfig(level=logging.WARNING) +logg = logging.getLogger() -def add_block_args(argparser): - argparser.add_argument('--history-start', type=int, default=0, dest='history_start', help='Start block height for initial history sync') - argparser.add_argument('--no-history', action='store_true', dest='no_history', help='Skip initial history sync') - return argparser +# process args +arg_flags = cic_cache.cli.argflag_std_read +local_arg_flags = cic_cache.cli.argflag_local_sync +argparser = cic_cache.cli.ArgumentParser(arg_flags) +argparser.process_local_flags(local_arg_flags) +args = argparser.parse_args() +# process config +config = cic_cache.cli.Config.from_args(args, arg_flags, local_arg_flags) -logg = cic_base.log.create() -argparser = cic_base.argparse.create(script_dir, cic_base.argparse.full_template) -argparser = cic_base.argparse.add(argparser, add_block_args, 'block') -args = cic_base.argparse.parse(argparser, logg) -config = cic_base.config.create(args.c, args, args.env_prefix) - -config.add(args.history_start, 'SYNCER_HISTORY_START', True) -config.add(args.no_history, '_NO_HISTORY', True) - -cic_base.config.log(config) - +# connect to database dsn = dsn_from_config(config) - SessionBase.connect(dsn, debug=config.true('DATABASE_DEBUG')) -chain_spec = ChainSpec.from_chain_str(config.get('CIC_CHAIN_SPEC')) +# set up rpc +rpc = cic_cache.cli.RPC.from_config(config) +conn = rpc.get_default() -cic_base.rpc.setup(chain_spec, config.get('ETH_PROVIDER')) +# set up chain provisions +chain_spec = ChainSpec.from_chain_str(config.get('CHAIN_SPEC')) +registry = None +try: + registry = cic_cache.cli.connect_registry(conn, chain_spec, config.get('CIC_REGISTRY_ADDRESS')) +except UnknownContractError as e: + logg.exception('Registry contract connection failed for {}: {}'.format(config.get('CIC_REGISTRY_ADDRESS'), e)) + sys.exit(1) +logg.info('connected contract registry {}'.format(config.get('CIC_REGISTRY_ADDRESS'))) def register_filter_tags(filters, session): @@ -88,14 +92,12 @@ def main(): syncers = [] - #if SQLBackend.first(chain_spec): - # backend = SQLBackend.initial(chain_spec, block_offset) syncer_backends = SQLBackend.resume(chain_spec, block_offset) if len(syncer_backends) == 0: - initial_block_start = config.get('SYNCER_HISTORY_START') + initial_block_start = config.get('SYNCER_OFFSET') initial_block_offset = block_offset - if config.get('_NO_HISTORY'): + if config.get('SYNCER_NO_HISTORY'): initial_block_start = block_offset initial_block_offset += 1 syncer_backends.append(SQLBackend.initial(chain_spec, initial_block_offset, start_block_height=initial_block_start)) @@ -105,10 +107,10 @@ def main(): logg.info('resuming sync session {}'.format(syncer_backend)) for syncer_backend in syncer_backends: - syncers.append(HistorySyncer(syncer_backend, chain_interface)) + syncers.append(HistorySyncer(syncer_backend, cic_cache.cli.chain_interface)) syncer_backend = SQLBackend.live(chain_spec, block_offset+1) - syncers.append(HeadSyncer(syncer_backend, chain_interface)) + syncers.append(HeadSyncer(syncer_backend, cic_cache.cli.chain_interface)) trusted_addresses_src = config.get('CIC_TRUST_ADDRESS') if trusted_addresses_src == None: diff --git a/apps/cic-cache/config/bancor.ini b/apps/cic-cache/config/bancor.ini deleted file mode 100644 index c1591774..00000000 --- a/apps/cic-cache/config/bancor.ini +++ /dev/null @@ -1,2 +0,0 @@ -[bancor] -dir = diff --git a/apps/cic-cache/config/cic.ini b/apps/cic-cache/config/cic.ini index cbb3fb2e..48c32fad 100644 --- a/apps/cic-cache/config/cic.ini +++ b/apps/cic-cache/config/cic.ini @@ -1,4 +1,3 @@ [cic] registry_address = -chain_spec = trust_address = diff --git a/apps/cic-cache/config/docker/bancor.ini b/apps/cic-cache/config/docker/bancor.ini deleted file mode 100644 index 7e53c791..00000000 --- a/apps/cic-cache/config/docker/bancor.ini +++ /dev/null @@ -1,3 +0,0 @@ -[bancor] -registry_address = -dir = /usr/local/share/bancor diff --git a/apps/cic-cache/config/docker/cic.ini b/apps/cic-cache/config/docker/cic.ini index 1fd98612..af112724 100644 --- a/apps/cic-cache/config/docker/cic.ini +++ b/apps/cic-cache/config/docker/cic.ini @@ -1,4 +1,3 @@ [cic] -chain_spec = registry_address = trust_address = 0xEb3907eCad74a0013c259D5874AE7f22DcBcC95C diff --git a/apps/cic-cache/config/docker/eth.ini b/apps/cic-cache/config/docker/eth.ini deleted file mode 100644 index 321384f8..00000000 --- a/apps/cic-cache/config/docker/eth.ini +++ /dev/null @@ -1,2 +0,0 @@ -[eth] -provider = http://localhost:63545 diff --git a/apps/cic-cache/config/docker/syncer.ini b/apps/cic-cache/config/docker/syncer.ini index c811bccc..255dc00f 100644 --- a/apps/cic-cache/config/docker/syncer.ini +++ b/apps/cic-cache/config/docker/syncer.ini @@ -1,3 +1,4 @@ [syncer] loop_interval = 1 -history_start = 0 +offset = 0 +no_history = 0 diff --git a/apps/cic-cache/config/eth.ini b/apps/cic-cache/config/eth.ini deleted file mode 100644 index 98b831e5..00000000 --- a/apps/cic-cache/config/eth.ini +++ /dev/null @@ -1,2 +0,0 @@ -[eth] -provider = ws://localhost:8545 diff --git a/apps/cic-cache/config/syncer.ini b/apps/cic-cache/config/syncer.ini deleted file mode 100644 index f26739c7..00000000 --- a/apps/cic-cache/config/syncer.ini +++ /dev/null @@ -1,3 +0,0 @@ -[syncer] -loop_interval = 5 -history_start = 0 diff --git a/apps/cic-cache/requirements.txt b/apps/cic-cache/requirements.txt index fb83781f..a02f9735 100644 --- a/apps/cic-cache/requirements.txt +++ b/apps/cic-cache/requirements.txt @@ -1,12 +1,14 @@ alembic==1.4.2 -confini>=0.3.6rc3,<0.5.0 +confini>=0.3.6rc4,<0.5.0 uwsgi==2.0.19.1 moolb~=0.1.0 -cic-eth-registry~=0.5.6a2 +cic-eth-registry~=0.5.7a1 SQLAlchemy==1.3.20 semver==2.13.0 psycopg2==2.8.6 celery==4.4.7 redis==3.5.3 -chainsyncer[sql]~=0.0.3a5 -erc20-faucet~=0.2.2a2 +chainsyncer[sql]>=0.0.5a1,<0.1.0 +erc20-faucet~=0.2.3a1 +chainlib>=0.0.6a3,<0.1.0 +eth-address-index>=0.1.3a1,<0.2.0 diff --git a/apps/cic-cache/setup.cfg b/apps/cic-cache/setup.cfg index 4616a475..b6de6a9c 100644 --- a/apps/cic-cache/setup.cfg +++ b/apps/cic-cache/setup.cfg @@ -23,11 +23,13 @@ licence_files = [options] python_requires = >= 3.6 +include_package_data = True packages = cic_cache cic_cache.tasks cic_cache.db cic_cache.db.models + cic_cache.cli cic_cache.runnable cic_cache.runnable.daemons cic_cache.runnable.daemons.filters diff --git a/apps/cic-eth/MANIFEST.in b/apps/cic-eth/MANIFEST.in index 5a9554ac..52d3a6f4 100644 --- a/apps/cic-eth/MANIFEST.in +++ b/apps/cic-eth/MANIFEST.in @@ -1,2 +1,2 @@ -include *requirements.txt config/test/* +include *requirements.txt config/test/* cic_eth/data/config/* diff --git a/apps/cic-eth/setup.cfg b/apps/cic-eth/setup.cfg index a0354019..2b798095 100644 --- a/apps/cic-eth/setup.cfg +++ b/apps/cic-eth/setup.cfg @@ -24,8 +24,10 @@ licence_files = [options] python_requires = >= 3.6 +include_package_data = True packages = cic_eth + cic_eth.cli cic_eth.admin cic_eth.eth cic_eth.api diff --git a/apps/data-seeding/requirements.txt b/apps/data-seeding/requirements.txt index 10a752fd..112af66b 100644 --- a/apps/data-seeding/requirements.txt +++ b/apps/data-seeding/requirements.txt @@ -1,13 +1,13 @@ -sarafu-faucet==0.0.4a3 -cic-eth[tools]==0.12.1a1 -cic-types==0.1.0a13 -crypto-dev-signer==0.4.14b7 +sarafu-faucet==0.0.5a1 +cic-eth[tools]==0.12.2a3 +cic-types==0.1.0a14 +crypto-dev-signer==0.4.14rc1 faker==4.17.1 -chainsyncer~=0.0.3a3 -chainlib-eth~=0.0.5a1 -eth-address-index~=0.1.2a1 -eth-contract-registry~=0.5.6a1 -eth-accounts-index~=0.0.12a1 -eth-erc20~=0.0.10a3 -erc20-faucet~=0.2.2a1 +chainsyncer~=0.0.5a1 +chainlib-eth~=0.0.6a3 +eth-address-index~=0.1.3a1 +eth-contract-registry~=0.5.7a1 +eth-accounts-index~=0.0.13a1 +eth-erc20~=0.0.11a1 +erc20-faucet~=0.2.3a1 psycopg2==2.8.6 diff --git a/docker-compose.yml b/docker-compose.yml index ee77baee..205e0713 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -131,9 +131,11 @@ services: build: context: apps/cic-cache dockerfile: docker/Dockerfile + args: + EXTRA_INDEX_URL: ${EXTRA_INDEX_URL:-https://pip.grassrootseconomics.net:8433} environment: CIC_REGISTRY_ADDRESS: $CIC_REGISTRY_ADDRESS # supplied at contract-config after contract provisioning - ETH_PROVIDER: ${ETH_PROVIDER:-http://eth:8545} + RPC_HTTP_PROVIDER: ${ETH_PROVIDER:-http://eth:8545} DATABASE_USER: ${DATABASE_USER:-grassroots} DATABASE_PASSWORD: ${DATABASE_PASSWORD:-tralala} # this is is set at initdb see: postgres/initdb/create_db.sql DATABASE_HOST: ${DATABASE_HOST:-postgres} @@ -142,9 +144,8 @@ services: DATABASE_ENGINE: ${DATABASE_ENGINE:-postgres} DATABASE_DRIVER: ${DATABASE_DRIVER:-psycopg2} DATABASE_DEBUG: 1 - ETH_ABI_DIR: ${ETH_ABI_DIR:-/usr/local/share/cic/solidity/abi} CIC_TRUST_ADDRESS: ${DEV_ETH_ACCOUNT_CONTRACT_DEPLOYER:-0xEb3907eCad74a0013c259D5874AE7f22DcBcC95C} - CIC_CHAIN_SPEC: ${CIC_CHAIN_SPEC:-evm:bloxberg:8996} + CHAIN_SPEC: ${CIC_CHAIN_SPEC:-evm:bloxberg:8996} CELERY_BROKER_URL: redis://redis:6379 CELERY_RESULT_URL: redis://redis:6379 deploy: