Remove stale code, correct systemd syncer args

This commit is contained in:
lash 2022-04-26 10:10:04 +00:00
parent c1f236769f
commit 58d801aa86
Signed by: lash
GPG Key ID: 21D2E7BB88C2A746
9 changed files with 22 additions and 55 deletions

View File

@ -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/*

View File

@ -105,7 +105,8 @@ def main():
fltr = StateFilter(queue_adapter) fltr = StateFilter(queue_adapter)
sync_store = SyncFsStore(config.get('SESSION_RUNTIME_DIR'), session_id=config.get('SESSION_ID')) sync_store = SyncFsStore(config.get('SESSION_RUNTIME_DIR'), session_id=config.get('SESSION_ID'))
sync_store.register(fltr) sync_store.register(fltr)
sync_store.start()
logg.debug('session block ofset {}'.format(session_block_offset))
chain_interface = EthChainInterface() chain_interface = EthChainInterface()
drv = ChainInterfaceDriver(sync_store, chain_interface, offset=session_block_offset, target=block_limit) drv = ChainInterfaceDriver(sync_store, chain_interface, offset=session_block_offset, target=block_limit)

View File

@ -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()

View File

@ -1 +1 @@
eth-erc20~=0.2.1 eth-erc20~=0.3.0

View File

@ -2,5 +2,5 @@ chaind~=0.1.0
hexathon~=0.1.5 hexathon~=0.1.5
chainlib-eth~=0.1.0 chainlib-eth~=0.1.0
pyxdg~=0.27 pyxdg~=0.27
shep~=0.1.1 shep~=0.2.3
funga-eth~=0.6.0 funga-eth~=0.6.0

View File

@ -4,7 +4,7 @@ version = 0.1.0
description = Queue server for ethereum description = Queue server for ethereum
author = Louis Holbrook author = Louis Holbrook
author_email = dev@holbrook.no author_email = dev@holbrook.no
url = https://gitlab.com/chaintools/chainqueue url = https://gitlab.com/chaintool/chaind-eth
keywords = keywords =
cic cic
cryptocurrency cryptocurrency
@ -25,17 +25,16 @@ licence_files =
LICENSE LICENSE
[options] [options]
python_requires = >= 3.6 python_requires = >= 3.7
include_package_data = True include_package_data = True
packages = packages =
chaind.eth chaind.eth
chaind.eth.runnable chaind.eth.runnable
chaind.eth.cli chaind.eth.cli
# chainqueue.adapters
[options.entry_points] [options.entry_points]
console_scripts = console_scripts =
chaind-eth-tasker = chaind_eth.runnable.tasker:main chaind-eth-tasker = chaind.eth.runnable.tasker:main
chaind-eth-syncer = chaind_eth.runnable.syncer:main chaind-eth-syncer = chaind.eth.runnable.syncer:main
chaind-eth-send = chaind_eth.runnable.send:main chaind-eth-send = chaind.eth.runnable.send:main
#chaind-eth-resend = chaind_eth.runnable.resend:main #chaind-eth-resend = chaind_eth.runnable.resend:main

View File

@ -21,6 +21,16 @@ while True:
test_requirements.append(l.rstrip()) test_requirements.append(l.rstrip())
f.close() 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 = [ postgres_requirements = [
'psycopg2==2.8.6', 'psycopg2==2.8.6',
] + requirements ] + requirements

View File

@ -4,5 +4,5 @@ Description=Ethereum chaind syncer
[Service] [Service]
Environment="SESSION_ID=%i" Environment="SESSION_ID=%i"
Environment="SESSION_RUNTIME_DIR=/run/user/%U/chaind/eth" 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 Restart=on-failure

View File

@ -2,3 +2,4 @@ eth_tester==0.5.0b3
py-evm==0.3.0a20 py-evm==0.3.0a20
rlp==2.0.1 rlp==2.0.1
coverage==5.5 coverage==5.5
jsonrpc_std~=0.1.0