Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8d0a1f589b
|
||
|
|
24a71b6c7f
|
@@ -2,6 +2,7 @@
|
|||||||
from chainlib.interface import ChainInterface
|
from chainlib.interface import ChainInterface
|
||||||
from chainlib.eth.block import (
|
from chainlib.eth.block import (
|
||||||
block_by_number,
|
block_by_number,
|
||||||
|
block_latest,
|
||||||
Block,
|
Block,
|
||||||
)
|
)
|
||||||
from chainlib.eth.tx import (
|
from chainlib.eth.tx import (
|
||||||
@@ -16,3 +17,4 @@ class EthChainInterface(ChainInterface):
|
|||||||
self._block_from_src = Block.from_src
|
self._block_from_src = Block.from_src
|
||||||
self._tx_receipt = receipt
|
self._tx_receipt = receipt
|
||||||
self._src_normalize = Tx.src_normalize
|
self._src_normalize = Tx.src_normalize
|
||||||
|
self._block_latest = block_latest
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ import signal
|
|||||||
# external imports
|
# external imports
|
||||||
import chainlib.eth.cli
|
import chainlib.eth.cli
|
||||||
import chaind.cli
|
import chaind.cli
|
||||||
|
import chainqueue.cli
|
||||||
from chaind.session import SessionController
|
from chaind.session import SessionController
|
||||||
from chaind.setup import Environment
|
from chaind.setup import Environment
|
||||||
from chaind.error import (
|
from chaind.error import (
|
||||||
@@ -44,14 +45,18 @@ env = Environment(domain='eth', env=os.environ)
|
|||||||
arg_flags = chainlib.eth.cli.argflag_std_read
|
arg_flags = chainlib.eth.cli.argflag_std_read
|
||||||
argparser = chainlib.eth.cli.ArgumentParser(arg_flags)
|
argparser = chainlib.eth.cli.ArgumentParser(arg_flags)
|
||||||
|
|
||||||
|
queue_arg_flags = 0
|
||||||
|
chainqueue.cli.process_flags(argparser, queue_arg_flags)
|
||||||
|
|
||||||
local_arg_flags = chaind.cli.argflag_local_base | chaind.cli.ChaindFlag.DISPATCH | chaind.cli.ChaindFlag.SOCKET
|
local_arg_flags = chaind.cli.argflag_local_base | chaind.cli.ChaindFlag.DISPATCH | chaind.cli.ChaindFlag.SOCKET
|
||||||
chaind.cli.process_flags(argparser, local_arg_flags)
|
chaind.cli.process_flags(argparser, local_arg_flags)
|
||||||
|
|
||||||
args = argparser.parse_args()
|
args = argparser.parse_args()
|
||||||
|
|
||||||
base_config_dir = [chaind.cli.config_dir]
|
base_config_dir = [chainqueue.cli.config_dir, chaind.cli.config_dir]
|
||||||
config = chainlib.eth.cli.Config.from_args(args, arg_flags, base_config_dir=base_config_dir)
|
config = chainlib.eth.cli.Config.from_args(args, arg_flags, base_config_dir=base_config_dir)
|
||||||
config = chaind.cli.process_config(config, args, local_arg_flags)
|
config = chaind.cli.process_config(config, args, local_arg_flags)
|
||||||
|
config = chainqueue.cli.process_config(config, args, queue_arg_flags)
|
||||||
config.add('eth', 'CHAIND_ENGINE', False)
|
config.add('eth', 'CHAIND_ENGINE', False)
|
||||||
config.add('queue', 'CHAIND_COMPONENT', False)
|
config.add('queue', 'CHAIND_COMPONENT', False)
|
||||||
logg.debug('config loaded:\n{}'.format(config))
|
logg.debug('config loaded:\n{}'.format(config))
|
||||||
@@ -82,7 +87,7 @@ token_cache_store = CacheTokenTx(chain_spec, normalizer=tx_normalizer)
|
|||||||
dispatcher = EthDispatcher(conn)
|
dispatcher = EthDispatcher(conn)
|
||||||
queue_adapter = ChaindFsAdapter(
|
queue_adapter = ChaindFsAdapter(
|
||||||
settings.get('CHAIN_SPEC'),
|
settings.get('CHAIN_SPEC'),
|
||||||
settings.get('SESSION_DATA_DIR'),
|
settings.dir_for('queue'),
|
||||||
EthCacheTx,
|
EthCacheTx,
|
||||||
dispatcher,
|
dispatcher,
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ import socket
|
|||||||
|
|
||||||
# external imports
|
# external imports
|
||||||
import chainlib.eth.cli
|
import chainlib.eth.cli
|
||||||
|
import chainqueue.cli
|
||||||
import chaind.cli
|
import chaind.cli
|
||||||
from chaind.setup import Environment
|
from chaind.setup import Environment
|
||||||
from chainlib.eth.gas import price
|
from chainlib.eth.gas import price
|
||||||
@@ -34,15 +35,18 @@ arg_flags = chainlib.eth.cli.argflag_std_write
|
|||||||
argparser = chainlib.eth.cli.ArgumentParser(arg_flags, arg_long={'-s': '--send-rpc'})
|
argparser = chainlib.eth.cli.ArgumentParser(arg_flags, arg_long={'-s': '--send-rpc'})
|
||||||
argparser.add_positional('source', required=False, type=str, help='Transaction source file')
|
argparser.add_positional('source', required=False, type=str, help='Transaction source file')
|
||||||
|
|
||||||
local_arg_flags = chaind.cli.argflag_local_socket_client
|
local_arg_flags = chaind.cli.argflag_local_socket_client | chaind.cli.ChaindFlag.TOKEN
|
||||||
chaind.cli.process_flags(argparser, local_arg_flags)
|
chaind.cli.process_flags(argparser, local_arg_flags)
|
||||||
|
|
||||||
|
chainqueue.cli.process_flags(argparser, 0)
|
||||||
|
|
||||||
args = argparser.parse_args()
|
args = argparser.parse_args()
|
||||||
|
|
||||||
env = Environment(domain='eth', env=os.environ)
|
env = Environment(domain='eth', env=os.environ)
|
||||||
|
|
||||||
base_config_dir = [chaind.cli.config_dir]
|
base_config_dir = [chaind.cli.config_dir, chainqueue.cli.config_dir]
|
||||||
config = chainlib.eth.cli.Config.from_args(args, arg_flags, base_config_dir=base_config_dir)
|
config = chainlib.eth.cli.Config.from_args(args, arg_flags, base_config_dir=base_config_dir)
|
||||||
|
config = chainqueue.cli.process_config(config, args, 0)
|
||||||
config = chaind.cli.process_config(config, args, local_arg_flags)
|
config = chaind.cli.process_config(config, args, local_arg_flags)
|
||||||
config.add(args.source, '_SOURCE', False)
|
config.add(args.source, '_SOURCE', False)
|
||||||
config.add('eth', 'CHAIND_ENGINE', False)
|
config.add('eth', 'CHAIND_ENGINE', False)
|
||||||
@@ -105,9 +109,9 @@ class SocketSender:
|
|||||||
|
|
||||||
def main():
|
def main():
|
||||||
token_resolver = None
|
token_resolver = None
|
||||||
if config.get('TOKEN_MODULE') != None:
|
if settings.get('TOKEN_MODULE') != None:
|
||||||
import importlib
|
import importlib
|
||||||
m = importlib.import_module(config.get('TOKEN_MODULE'))
|
m = importlib.import_module(settings.get('TOKEN_MODULE'))
|
||||||
m = m.TokenResolver
|
m = m.TokenResolver
|
||||||
else:
|
else:
|
||||||
from chaind.eth.token.gas import GasTokenResolver
|
from chaind.eth.token.gas import GasTokenResolver
|
||||||
|
|||||||
@@ -57,6 +57,7 @@ settings.process(config)
|
|||||||
|
|
||||||
logg.debug('settings:\n{}'.format(settings))
|
logg.debug('settings:\n{}'.format(settings))
|
||||||
|
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
queue_adapter = ChaindFsAdapter(
|
queue_adapter = ChaindFsAdapter(
|
||||||
settings.get('CHAIN_SPEC'),
|
settings.get('CHAIN_SPEC'),
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ class BaseTokenResolver:
|
|||||||
|
|
||||||
|
|
||||||
def get_values(self, gas_value, value, executable_address=None):
|
def get_values(self, gas_value, value, executable_address=None):
|
||||||
nonce = self.nonce_oracle.next_nonce()
|
nonce = self.nonce_oracle.get_nonce()
|
||||||
|
|
||||||
if executable_address == None:
|
if executable_address == None:
|
||||||
return (value, 0, nonce)
|
return (value, 0, nonce)
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
chaind~=0.1.0
|
chaind~=0.1.1
|
||||||
hexathon~=0.1.5
|
hexathon~=0.1.5
|
||||||
chainlib-eth~=0.1.0
|
chainlib-eth~=0.1.1
|
||||||
pyxdg~=0.27
|
pyxdg~=0.27
|
||||||
shep~=0.2.3
|
shep~=0.2.3
|
||||||
funga-eth~=0.6.0
|
funga-eth~=0.6.0
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
[metadata]
|
[metadata]
|
||||||
name = chaind-eth
|
name = chaind-eth
|
||||||
version = 0.1.0
|
version = 0.1.4
|
||||||
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
|
||||||
@@ -31,6 +31,7 @@ packages =
|
|||||||
chaind.eth
|
chaind.eth
|
||||||
chaind.eth.runnable
|
chaind.eth.runnable
|
||||||
chaind.eth.cli
|
chaind.eth.cli
|
||||||
|
chaind.eth.token
|
||||||
|
|
||||||
[options.entry_points]
|
[options.entry_points]
|
||||||
console_scripts =
|
console_scripts =
|
||||||
|
|||||||
Reference in New Issue
Block a user