Compare commits

..

2 Commits

Author SHA1 Message Date
nolash
c3ca86fcf4 Add missing files 2021-04-15 15:43:54 +02:00
nolash
e1d4ddae39 Actually add some changes 2021-04-15 14:45:47 +02:00
12 changed files with 37 additions and 34 deletions

View File

@@ -26,7 +26,7 @@ from chainlib.eth.block import (
from hexathon import ( from hexathon import (
strip_0x, strip_0x,
) )
from chainsyncer.backend.sql import SQLBackend from chainsyncer.backend import SyncerBackend
from chainsyncer.driver import ( from chainsyncer.driver import (
HeadSyncer, HeadSyncer,
HistorySyncer, HistorySyncer,
@@ -71,13 +71,13 @@ def main():
syncers = [] syncers = []
#if SQLBackend.first(chain_spec): #if SyncerBackend.first(chain_spec):
# backend = SQLBackend.initial(chain_spec, block_offset) # backend = SyncerBackend.initial(chain_spec, block_offset)
syncer_backends = SQLBackend.resume(chain_spec, block_offset) syncer_backends = SyncerBackend.resume(chain_spec, block_offset)
if len(syncer_backends) == 0: if len(syncer_backends) == 0:
logg.info('found no backends to resume') logg.info('found no backends to resume')
syncers.append(SQLBackend.initial(chain_spec, block_offset)) syncers.append(SyncerBackend.initial(chain_spec, block_offset))
else: else:
for syncer_backend in syncer_backends: for syncer_backend in syncer_backends:
logg.info('resuming sync session {}'.format(syncer_backend)) logg.info('resuming sync session {}'.format(syncer_backend))
@@ -85,7 +85,7 @@ def main():
for syncer_backend in syncer_backends: for syncer_backend in syncer_backends:
syncers.append(HistorySyncer(syncer_backend)) syncers.append(HistorySyncer(syncer_backend))
syncer_backend = SQLBackend.live(chain_spec, block_offset+1) syncer_backend = SyncerBackend.live(chain_spec, block_offset+1)
syncers.append(HeadSyncer(syncer_backend)) syncers.append(HeadSyncer(syncer_backend))
trusted_addresses_src = config.get('CIC_TRUST_ADDRESS') trusted_addresses_src = config.get('CIC_TRUST_ADDRESS')

View File

@@ -1,4 +1,4 @@
cic-base~=0.1.2a77 cic-base~=0.1.2a76
alembic==1.4.2 alembic==1.4.2
confini~=0.3.6rc3 confini~=0.3.6rc3
uwsgi==2.0.19.1 uwsgi==2.0.19.1
@@ -9,4 +9,4 @@ semver==2.13.0
psycopg2==2.8.6 psycopg2==2.8.6
celery==4.4.7 celery==4.4.7
redis==3.5.3 redis==3.5.3
chainsyncer[sql]~=0.0.2a2 chainsyncer[sql]~=0.0.2a1

View File

@@ -15,6 +15,7 @@ from cic_eth_registry import CICRegistry
from chainlib.chain import ChainSpec from chainlib.chain import ChainSpec
from chainlib.eth.tx import unpack from chainlib.eth.tx import unpack
from chainlib.connection import RPCConnection from chainlib.connection import RPCConnection
from chainsyncer.error import SyncDone
from hexathon import strip_0x from hexathon import strip_0x
from chainqueue.db.enum import ( from chainqueue.db.enum import (
StatusEnum, StatusEnum,
@@ -152,7 +153,10 @@ class DispatchSyncer:
def main(): def main():
syncer = DispatchSyncer(chain_spec) syncer = DispatchSyncer(chain_spec)
conn = RPCConnection.connect(chain_spec, 'default') conn = RPCConnection.connect(chain_spec, 'default')
syncer.loop(conn, float(config.get('DISPATCHER_LOOP_INTERVAL'))) try:
syncer.loop(conn, float(config.get('DISPATCHER_LOOP_INTERVAL')))
except SyncDone as e:
sys.stderr.write("dispatcher done at block {}\n".format(e))
sys.exit(0) sys.exit(0)

View File

@@ -26,7 +26,7 @@ from chainlib.eth.block import (
from hexathon import ( from hexathon import (
strip_0x, strip_0x,
) )
from chainsyncer.backend.sql import SQLBackend from chainsyncer.backend import SyncerBackend
from chainsyncer.driver import ( from chainsyncer.driver import (
HeadSyncer, HeadSyncer,
HistorySyncer, HistorySyncer,
@@ -88,18 +88,18 @@ def main():
syncers = [] syncers = []
#if SQLBackend.first(chain_spec): #if SyncerBackend.first(chain_spec):
# backend = SQLBackend.initial(chain_spec, block_offset) # backend = SyncerBackend.initial(chain_spec, block_offset)
syncer_backends = SQLBackend.resume(chain_spec, block_offset) syncer_backends = SyncerBackend.resume(chain_spec, block_offset)
if len(syncer_backends) == 0: if len(syncer_backends) == 0:
logg.info('found no backends to resume') logg.info('found no backends to resume')
syncer_backends.append(SQLBackend.initial(chain_spec, block_offset)) syncer_backends.append(SyncerBackend.initial(chain_spec, block_offset))
else: else:
for syncer_backend in syncer_backends: for syncer_backend in syncer_backends:
logg.info('resuming sync session {}'.format(syncer_backend)) logg.info('resuming sync session {}'.format(syncer_backend))
syncer_backends.append(SQLBackend.live(chain_spec, block_offset+1)) syncer_backends.append(SyncerBackend.live(chain_spec, block_offset+1))
for syncer_backend in syncer_backends: for syncer_backend in syncer_backends:
try: try:

View File

@@ -4,7 +4,7 @@ import datetime
# external imports # external imports
from chainsyncer.driver import HeadSyncer from chainsyncer.driver import HeadSyncer
from chainsyncer.backend.memory import MemBackend from chainsyncer.backend import MemBackend
from chainsyncer.error import NoBlockForYou from chainsyncer.error import NoBlockForYou
from chainlib.eth.block import ( from chainlib.eth.block import (
block_by_number, block_by_number,

View File

@@ -29,8 +29,7 @@ RUN /usr/local/bin/python -m pip install --upgrade pip
# python merge_requirements.py | tee merged_requirements.txt # python merge_requirements.py | tee merged_requirements.txt
#RUN cd cic-base && \ #RUN cd cic-base && \
# pip install $pip_extra_index_url_flag -r ./merged_requirements.txt # pip install $pip_extra_index_url_flag -r ./merged_requirements.txt
RUN pip install $pip_extra_index_url_flag cic-base[full_graph]==0.1.2a76 RUN pip install $pip_extra_index_url_flag cic-base[full_graph]==0.1.2a62
RUN pip install $pip_extra_index_url_flag chainsyncer~=0.0.2a2
COPY cic-eth/scripts/ scripts/ COPY cic-eth/scripts/ scripts/
COPY cic-eth/setup.cfg cic-eth/setup.py ./ COPY cic-eth/setup.cfg cic-eth/setup.py ./

View File

@@ -18,7 +18,7 @@ moolb~=0.1.1b2
eth-address-index~=0.1.1a7 eth-address-index~=0.1.1a7
chainlib~=0.0.2a5 chainlib~=0.0.2a5
hexathon~=0.0.1a7 hexathon~=0.0.1a7
chainsyncer[sql]~=0.0.2a2 chainsyncer[sql]~=0.0.2a1
chainqueue~=0.0.1a7 chainqueue~=0.0.1a7
pysha3==1.0.2 pysha3==1.0.2
coincurve==15.0.0 coincurve==15.0.0

View File

@@ -57,9 +57,9 @@ WORKDIR /home/grassroots
USER grassroots USER grassroots
ARG pip_extra_index_url=https://pip.grassrootseconomics.net:8433 ARG pip_extra_index_url=https://pip.grassrootseconomics.net:8433
ARG cic_base_version=0.1.2a77 ARG cic_base_version=0.1.2a67
ARG cic_eth_version=0.11.0b6 ARG cic_eth_version=0.11.0b1
ARG sarafu_faucet_version=0.0.2a28 ARG sarafu_faucet_version=0.0.2a19
ARG cic_contracts_version=0.0.2a2 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 \ RUN pip install --user --extra-index-url $pip_extra_index_url cic-base[full_graph]==$cic_base_version \
cic-eth==$cic_eth_version \ cic-eth==$cic_eth_version \

View File

@@ -17,7 +17,7 @@ from hexathon import (
strip_0x, strip_0x,
add_0x, add_0x,
) )
from chainsyncer.backend.memory import MemBackend from chainsyncer.backend import MemBackend
from chainsyncer.driver import HeadSyncer from chainsyncer.driver import HeadSyncer
from chainlib.eth.connection import EthHTTPConnection from chainlib.eth.connection import EthHTTPConnection
from chainlib.eth.block import ( from chainlib.eth.block import (
@@ -25,13 +25,13 @@ from chainlib.eth.block import (
block_by_number, block_by_number,
Block, Block,
) )
from chainlib.hash import keccak256_string_to_hex from chainlib.eth.hash import keccak256_string_to_hex
from chainlib.eth.address import to_checksum_address from chainlib.eth.address import to_checksum_address
from chainlib.eth.erc20 import ERC20 from chainlib.eth.erc20 import ERC20
from chainlib.eth.gas import OverrideGasOracle from chainlib.eth.gas import OverrideGasOracle
from chainlib.eth.nonce import RPCNonceOracle from chainlib.eth.nonce import RPCNonceOracle
from chainlib.eth.tx import TxFactory from chainlib.eth.tx import TxFactory
from chainlib.jsonrpc import jsonrpc_template from chainlib.eth.rpc import jsonrpc_template
from chainlib.eth.error import EthException from chainlib.eth.error import EthException
from chainlib.chain import ChainSpec from chainlib.chain import ChainSpec
from crypto_dev_signer.eth.signer import ReferenceSigner as EIP155Signer from crypto_dev_signer.eth.signer import ReferenceSigner as EIP155Signer

View File

@@ -17,7 +17,7 @@ from hexathon import (
strip_0x, strip_0x,
add_0x, add_0x,
) )
from chainsyncer.backend.memory import MemBackend from chainsyncer.backend import MemBackend
from chainsyncer.driver import HeadSyncer from chainsyncer.driver import HeadSyncer
from chainlib.eth.connection import EthHTTPConnection from chainlib.eth.connection import EthHTTPConnection
from chainlib.eth.block import ( from chainlib.eth.block import (
@@ -25,13 +25,13 @@ from chainlib.eth.block import (
block_by_number, block_by_number,
Block, Block,
) )
from chainlib.hash import keccak256_string_to_hex from chainlib.eth.hash import keccak256_string_to_hex
from chainlib.eth.address import to_checksum_address from chainlib.eth.address import to_checksum_address
from chainlib.eth.erc20 import ERC20 from chainlib.eth.erc20 import ERC20
from chainlib.eth.gas import OverrideGasOracle from chainlib.eth.gas import OverrideGasOracle
from chainlib.eth.nonce import RPCNonceOracle from chainlib.eth.nonce import RPCNonceOracle
from chainlib.eth.tx import TxFactory from chainlib.eth.tx import TxFactory
from chainlib.jsonrpc import jsonrpc_template from chainlib.eth.rpc import jsonrpc_template
from chainlib.eth.error import EthException from chainlib.eth.error import EthException
from chainlib.chain import ChainSpec from chainlib.chain import ChainSpec
from crypto_dev_signer.eth.signer import ReferenceSigner as EIP155Signer from crypto_dev_signer.eth.signer import ReferenceSigner as EIP155Signer

View File

@@ -1,5 +1,5 @@
cic-base[full_graph]==0.1.2a77 cic-base[full_graph]==0.1.2a67
sarafu-faucet==0.0.2a28 sarafu-faucet==0.0.2a20
cic-eth==0.11.0b6 cic-eth==0.11.0b3
cic-types==0.1.0a10 cic-types==0.1.0a10
crypto-dev-signer==0.4.14b2 crypto-dev-signer==0.4.14b1

View File

@@ -32,7 +32,7 @@ from chainlib.eth.block import (
block_by_number, block_by_number,
Block, Block,
) )
from chainlib.hash import keccak256_string_to_hex from chainlib.eth.hash import keccak256_string_to_hex
from chainlib.eth.address import to_checksum_address from chainlib.eth.address import to_checksum_address
from chainlib.eth.erc20 import ERC20 from chainlib.eth.erc20 import ERC20
from chainlib.eth.gas import ( from chainlib.eth.gas import (
@@ -40,7 +40,7 @@ from chainlib.eth.gas import (
balance, balance,
) )
from chainlib.eth.tx import TxFactory from chainlib.eth.tx import TxFactory
from chainlib.jsonrpc import jsonrpc_template from chainlib.eth.rpc import jsonrpc_template
from chainlib.eth.error import EthException from chainlib.eth.error import EthException
from cic_types.models.person import ( from cic_types.models.person import (
Person, Person,