chaind-eth

Queue server for ethereum
Log | Files | Refs | README | LICENSE

commit 58d801aa863512674a9a8fe9b7a39d7197ed4687
parent c1f236769f4b6ada68b860eccb6e567a4ee5a531
Author: lash <dev@holbrook.no>
Date:   Tue, 26 Apr 2022 10:10:04 +0000

Remove stale code, correct systemd syncer args

Diffstat:
MMANIFEST.in | 2+-
Mchaind/eth/runnable/syncer.py | 3++-
Dchainqueue/adapters/eth.py | 44--------------------------------------------
Merc20_requirements.txt | 2+-
Mrequirements.txt | 2+-
Msetup.cfg | 11+++++------
Msetup.py | 10++++++++++
Msystemd/chaind-eth-sync@.service | 2+-
Mtest_requirements.txt | 1+
9 files changed, 22 insertions(+), 55 deletions(-)

diff --git a/MANIFEST.in b/MANIFEST.in @@ -1 +1 @@ -include *requirements.txt LICENSE chaind_eth/data/config/* chaind_eth/data/config/syncer/* +include *requirements.txt LICENSE chaind/eth/data/config/* chaind/eth/data/config/syncer/* diff --git a/chaind/eth/runnable/syncer.py b/chaind/eth/runnable/syncer.py @@ -105,7 +105,8 @@ def main(): fltr = StateFilter(queue_adapter) sync_store = SyncFsStore(config.get('SESSION_RUNTIME_DIR'), session_id=config.get('SESSION_ID')) sync_store.register(fltr) - sync_store.start() + + logg.debug('session block ofset {}'.format(session_block_offset)) chain_interface = EthChainInterface() drv = ChainInterfaceDriver(sync_store, chain_interface, offset=session_block_offset, target=block_limit) diff --git a/chainqueue/adapters/eth.py b/chainqueue/adapters/eth.py @@ -1,44 +0,0 @@ -# standard imports -import logging - -# external imports -from chainlib.eth.constant import ZERO_ADDRESS -from chainlib.eth.tx import ( - unpack, - raw, - ) -from hexathon import ( - add_0x, - strip_0x, - ) - -# local imports -from chainqueue.adapters.sessionindex import SessionIndexAdapter - -logg = logging.getLogger(__name__) - - -class EthAdapter(SessionIndexAdapter): - - - def translate(self, bytecode, chain_spec): - logg.debug('bytecode {}'.format(bytecode)) - tx = unpack(bytecode, chain_spec) - tx['source_token'] = ZERO_ADDRESS - tx['destination_token'] = ZERO_ADDRESS - tx['from_value'] = tx['value'] - tx['to_value'] = tx['value'] - return tx - - - def dispatch(self, chain_spec, rpc, tx_hash, signed_tx, session=None): - o = raw(signed_tx) - r = self.backend.dispatch(chain_spec, rpc, tx_hash, o) - return r - - -# def cache(self, chain_spec): -# session = self.backend.create_session() -# r = self.backend.create(chain_spec, tx['nonce'], tx['from'], tx['hash'], add_0x(bytecode.hex()), session=session) -# session.close() - diff --git a/erc20_requirements.txt b/erc20_requirements.txt @@ -1 +1 @@ -eth-erc20~=0.2.1 +eth-erc20~=0.3.0 diff --git a/requirements.txt b/requirements.txt @@ -2,5 +2,5 @@ chaind~=0.1.0 hexathon~=0.1.5 chainlib-eth~=0.1.0 pyxdg~=0.27 -shep~=0.1.1 +shep~=0.2.3 funga-eth~=0.6.0 diff --git a/setup.cfg b/setup.cfg @@ -4,7 +4,7 @@ version = 0.1.0 description = Queue server for ethereum author = Louis Holbrook author_email = dev@holbrook.no -url = https://gitlab.com/chaintools/chainqueue +url = https://gitlab.com/chaintool/chaind-eth keywords = cic cryptocurrency @@ -25,17 +25,16 @@ licence_files = LICENSE [options] -python_requires = >= 3.6 +python_requires = >= 3.7 include_package_data = True packages = chaind.eth chaind.eth.runnable chaind.eth.cli -# chainqueue.adapters [options.entry_points] console_scripts = - chaind-eth-tasker = chaind_eth.runnable.tasker:main - chaind-eth-syncer = chaind_eth.runnable.syncer:main - chaind-eth-send = chaind_eth.runnable.send:main + chaind-eth-tasker = chaind.eth.runnable.tasker:main + chaind-eth-syncer = chaind.eth.runnable.syncer:main + chaind-eth-send = chaind.eth.runnable.send:main #chaind-eth-resend = chaind_eth.runnable.resend:main diff --git a/setup.py b/setup.py @@ -21,6 +21,16 @@ while True: test_requirements.append(l.rstrip()) f.close() +erc20_requirements = [] +f = open('erc20_requirements.txt', 'r') +while True: + l = f.readline() + if l == '': + break + test_requirements.append(l.rstrip()) +f.close() + + postgres_requirements = [ 'psycopg2==2.8.6', ] + requirements diff --git a/systemd/chaind-eth-sync@.service b/systemd/chaind-eth-sync@.service @@ -4,5 +4,5 @@ Description=Ethereum chaind syncer [Service] Environment="SESSION_ID=%i" Environment="SESSION_RUNTIME_DIR=/run/user/%U/chaind/eth" -ExecStart=%h/.local/bin/chaind-eth-syncer -v --session-id %i --skip-history +ExecStart=%h/.local/bin/chaind-eth-syncer -v --session-id %i --head Restart=on-failure diff --git a/test_requirements.txt b/test_requirements.txt @@ -2,3 +2,4 @@ eth_tester==0.5.0b3 py-evm==0.3.0a20 rlp==2.0.1 coverage==5.5 +jsonrpc_std~=0.1.0