Upgrade chainsyncer
This commit is contained in:
parent
744c7b6840
commit
1124bd2d26
@ -21,6 +21,7 @@ import cic_eth
|
||||
from cic_eth.eth import RpcClient
|
||||
from cic_eth.db import SessionBase
|
||||
from cic_eth.db.enum import StatusEnum
|
||||
from cic_eth.db.enum import StatusBits
|
||||
from cic_eth.db.enum import LockEnum
|
||||
from cic_eth.db import dsn_from_config
|
||||
from cic_eth.queue.tx import get_upcoming_tx
|
||||
@ -129,12 +130,13 @@ class DispatchSyncer:
|
||||
)
|
||||
s_check.link(s_send)
|
||||
t = s_check.apply_async()
|
||||
logg.info('processed {}'.format(k))
|
||||
|
||||
|
||||
def loop(self, w3, interval):
|
||||
while run:
|
||||
txs = {}
|
||||
typ = StatusEnum.READYSEND
|
||||
typ = StatusBits.QUEUED
|
||||
utxs = get_upcoming_tx(typ, chain_id=self.chain_id)
|
||||
for k in utxs.keys():
|
||||
txs[k] = utxs[k]
|
||||
|
@ -36,8 +36,8 @@ default_abi_dir = '/usr/share/local/cic/solidity/abi'
|
||||
default_config_dir = os.path.join('/usr/local/etc/cic-eth')
|
||||
|
||||
argparser = argparse.ArgumentParser()
|
||||
argparser.add_argument('-p', '--provider', dest='p', default='http://localhost:8545', type=str, help='Web3 provider url (http only)')
|
||||
argparser.add_argument('-r', '--registry-address', type=str, help='CIC registry address')
|
||||
argparser.add_argument('-p', '--provider', dest='p', type=str, help='Web3 provider url (http only)')
|
||||
argparser.add_argument('-r', '--registry-address', dest='r', type=str, help='CIC registry address')
|
||||
argparser.add_argument('-f', '--format', dest='f', default='terminal', type=str, help='Output format')
|
||||
argparser.add_argument('-c', type=str, default=default_config_dir, help='config root to use')
|
||||
argparser.add_argument('-i', '--chain-spec', dest='i', type=str, help='chain spec')
|
||||
@ -61,8 +61,10 @@ config.process()
|
||||
args_override = {
|
||||
'ETH_PROVIDER': getattr(args, 'p'),
|
||||
'CIC_CHAIN_SPEC': getattr(args, 'i'),
|
||||
'CIC_REGISTRY_ADDRESS': getattr(args, 'r'),
|
||||
}
|
||||
# override args
|
||||
config.dict_override(args_override, 'cli args')
|
||||
config.censor('PASSWORD', 'DATABASE')
|
||||
config.censor('PASSWORD', 'SSL')
|
||||
logg.debug('config loaded from {}:\n{}'.format(config_dir, config))
|
||||
@ -148,7 +150,6 @@ def render_lock(o, **kwargs):
|
||||
|
||||
# TODO: move each command to submodule
|
||||
def main():
|
||||
logg.debug('len {}'.format(len(args.query)))
|
||||
txs = []
|
||||
renderer = render_tx
|
||||
if len(args.query) > 66:
|
||||
|
@ -100,7 +100,7 @@ class MinedSyncer(Syncer):
|
||||
logg.debug('got blocks {}'.format(e))
|
||||
for block in e:
|
||||
block_number = self.process(c.w3, block.hex())
|
||||
logg.info('processed block {} {}'.format(block_number, block.hex()))
|
||||
logg.debug('processed block {} {}'.format(block_number, block.hex()))
|
||||
self.bc_cache.disconnect()
|
||||
if len(e) > 0:
|
||||
time.sleep(self.yield_delay)
|
||||
|
@ -20,5 +20,5 @@ moolb~=0.1.1b2
|
||||
eth-address-index~=0.1.0a8
|
||||
chainlib~=0.0.1a17
|
||||
hexathon~=0.0.1a3
|
||||
chainsyncer~=0.0.1a16
|
||||
chainsyncer~=0.0.1a17
|
||||
cic-base==0.1.1a3
|
||||
|
@ -107,7 +107,7 @@ RUN cd cic-bancor/python && \
|
||||
|
||||
|
||||
RUN apt-get install -y cargo
|
||||
ARG cic_base_version=0.1.1a3
|
||||
ARG cic_base_version=0.1.1a4
|
||||
RUN pip install --extra-index-url $pip_extra_index_url cic-base[full_graph]==$cic_base_version
|
||||
|
||||
ARG cic_registry_version=0.5.3a21
|
||||
|
@ -1,2 +1,2 @@
|
||||
cic-base[full]==0.1.1a1
|
||||
cic-base[full]==0.1.1a4
|
||||
cic-eth==0.10.0a31
|
||||
|
@ -43,5 +43,5 @@ cryptocurrency-cli-tools==0.0.4
|
||||
giftable-erc20-token==0.0.7b12
|
||||
hexathon==0.0.1a3
|
||||
chainlib==0.0.1a17
|
||||
chainsyncer==0.0.1a15
|
||||
chainsyncer==0.0.1a17
|
||||
cic-registry==0.5.3.a21
|
||||
|
@ -298,7 +298,7 @@ services:
|
||||
CELERY_BROKER_URL: ${CELERY_BROKER_URL:-redis://redis}
|
||||
CELERY_RESULT_URL: ${CELERY_RESULT_URL:-redis://redis}
|
||||
TASKS_TRANSFER_CALLBACKS: $TASKS_TRANSFER_CALLBACKS
|
||||
DATABASE_DEBUG: ${DATABASE_DEBUG:-true}
|
||||
DATABASE_DEBUG: ${DATABASE_DEBUG:-false}
|
||||
|
||||
depends_on:
|
||||
- eth
|
||||
@ -314,7 +314,7 @@ services:
|
||||
- -c
|
||||
- |
|
||||
if [[ -f /tmp/cic/config/.env ]]; then source /tmp/cic/config/.env; fi
|
||||
./start_dispatcher.sh -q cic-eth -v
|
||||
./start_dispatcher.sh -q cic-eth -vv
|
||||
# command: "/root/start_dispatcher.sh -q cic-eth -vv"
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user