make --daemon-id a coin-specific cfg file option
This commit is contained in:
parent
e972e4f93e
commit
886f8e3029
7 changed files with 14 additions and 1 deletions
|
|
@ -292,6 +292,7 @@ class Config(Lockable):
|
|||
'autosign',
|
||||
'color',
|
||||
'daemon_data_dir',
|
||||
'daemon_id', # also coin-specific
|
||||
'debug',
|
||||
'fee_adjust',
|
||||
'force_256_color',
|
||||
|
|
|
|||
|
|
@ -367,7 +367,11 @@ class CoinDaemon(Daemon):
|
|||
daemon_ids = cls.get_daemon_ids(cfg, coin)
|
||||
if not daemon_ids:
|
||||
die(1, f'No configured daemons for coin {coin}!')
|
||||
daemon_id = daemon_id or cfg.daemon_id or daemon_ids[0]
|
||||
daemon_id = (
|
||||
daemon_id
|
||||
or getattr(cfg, f'{coin.lower()}_daemon_id', None)
|
||||
or cfg.daemon_id
|
||||
or daemon_ids[0])
|
||||
|
||||
if daemon_id not in daemon_ids:
|
||||
die(1, f'{daemon_id!r}: invalid daemon_id - valid choices: {fmt_list(daemon_ids)}')
|
||||
|
|
|
|||
|
|
@ -77,6 +77,10 @@
|
|||
# setups with unusually large Monero wallets:
|
||||
# macos_autosign_ramdisk_size 10
|
||||
|
||||
# Specify the daemon ID. This option also has coin-specific variants (see
|
||||
# below):
|
||||
# daemon_id bitcoin_core
|
||||
|
||||
# Ignore coin daemon version. This option also has coin-specific variants
|
||||
# (see below):
|
||||
# ignore_daemon_version false
|
||||
|
|
|
|||
|
|
@ -337,6 +337,7 @@ class UserOpts(Opts):
|
|||
rr For descriptions, refer to the non-prefixed versions of these options above
|
||||
rr Prefixed options override their non-prefixed counterparts
|
||||
rr OPTION SUPPORTED PREFIXES
|
||||
Rr --PREFIX-daemon-id btc ltc bch eth etc
|
||||
rr --PREFIX-ignore-daemon-version btc ltc bch eth etc xmr
|
||||
br --PREFIX-tw-name btc ltc bch
|
||||
Rr --PREFIX-rpc-host btc ltc bch eth etc
|
||||
|
|
|
|||
|
|
@ -55,6 +55,7 @@ class mainnet(CoinProtocol.Secp256k1): # chainparams.cpp
|
|||
max_op_return_data_len = 80
|
||||
|
||||
coin_cfg_opts = (
|
||||
'daemon_id',
|
||||
'ignore_daemon_version',
|
||||
'rpc_host',
|
||||
'rpc_port',
|
||||
|
|
|
|||
|
|
@ -55,6 +55,7 @@ class mainnet(CoinProtocol.DummyWIF, CoinProtocol.Secp256k1):
|
|||
}
|
||||
|
||||
coin_cfg_opts = (
|
||||
'daemon_id',
|
||||
'ignore_daemon_version',
|
||||
'rpc_host',
|
||||
'rpc_port',
|
||||
|
|
|
|||
|
|
@ -212,6 +212,7 @@ class CoinProtocol(MMGenObject):
|
|||
rpc_user = ''
|
||||
rpc_password = ''
|
||||
tw_name = ''
|
||||
daemon_id = ''
|
||||
|
||||
@classmethod
|
||||
def get_opt_clsval(cls, cfg, opt):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue