daemon.py: erigon fixes
This commit is contained in:
parent
5ef346bf99
commit
5ca832a9a5
2 changed files with 12 additions and 1 deletions
|
|
@ -117,12 +117,17 @@ class erigon_daemon(geth_daemon):
|
|||
version_pat = r'erigon/(\d+)\.(\d+)\.(\d+)'
|
||||
exec_fn = 'erigon'
|
||||
private_ports = _nw(9090,9091,9092) # testnet and regtest are non-standard
|
||||
torrent_ports = _nw(42069,42070,None) # testnet is non-standard
|
||||
datadirs = {
|
||||
'linux': [g.home_dir,'.local','share','erigon'],
|
||||
'win': [os.getenv('LOCALAPPDATA'),'Erigon'] # FIXME
|
||||
}
|
||||
|
||||
def init_subclass(self):
|
||||
|
||||
if self.network == 'regtest':
|
||||
self.force_kill = True
|
||||
|
||||
self.coind_args = list_gen(
|
||||
['--verbosity=0'],
|
||||
[f'--port={self.p2p_port}', self.p2p_port],
|
||||
|
|
@ -130,9 +135,11 @@ class erigon_daemon(geth_daemon):
|
|||
[f'--private.api.addr=127.0.0.1:{self.private_port}'],
|
||||
[f'--datadir={self.datadir}', self.non_dfl_datadir],
|
||||
['--chain=goerli', self.network=='testnet'],
|
||||
[f'--torrent.port={self.torrent_ports.testnet}', self.network=='testnet'],
|
||||
['--chain=dev', self.network=='regtest'],
|
||||
['--mine', self.network=='regtest'],
|
||||
)
|
||||
|
||||
self.rpc_d = erigon_rpcdaemon(
|
||||
proto = self.proto,
|
||||
rpc_port = self.rpc_port,
|
||||
|
|
|
|||
|
|
@ -38,6 +38,7 @@ class Daemon(Lockable):
|
|||
debug = False
|
||||
wait = True
|
||||
use_pidfile = True
|
||||
force_kill = False
|
||||
pids = ()
|
||||
use_threads = False
|
||||
cfg_file = None
|
||||
|
|
@ -148,7 +149,10 @@ class Daemon(Lockable):
|
|||
|
||||
@property
|
||||
def stop_cmd(self):
|
||||
return ['kill','-Wf',self.pid] if self.platform == 'win' else ['kill',self.pid]
|
||||
return (
|
||||
['kill','-Wf',self.pid] if self.platform == 'win' else
|
||||
['kill','-9',self.pid] if self.force_kill else
|
||||
['kill',self.pid] )
|
||||
|
||||
def cmd(self,action,*args,**kwargs):
|
||||
return getattr(self,action)(*args,**kwargs)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue