mirror of
https://github.com/alexgo-io/stacks-puppet-node.git
synced 2026-04-14 12:06:42 +08:00
add -b/--bind
This commit is contained in:
@@ -250,6 +250,14 @@ def run_cli(argv=None, config_path=CONFIG_PATH):
|
||||
'env': 'BLOCKSTACK_API_SESSION',
|
||||
'help': 'API session token to use',
|
||||
},
|
||||
'api_bind': {
|
||||
'short': '-b',
|
||||
'long': '--bind',
|
||||
'has_arg': True,
|
||||
're-exec': False,
|
||||
'env': 'BLOCKSTACK_API_BIND',
|
||||
'help': 'Address or hostname to bind the API server',
|
||||
},
|
||||
'dry_run': {
|
||||
'short': '-n',
|
||||
'long': '--dry_run',
|
||||
|
||||
@@ -3840,8 +3840,12 @@ def make_local_api_server(api_pass, portnum, wallet_keys, api_bind=None, config_
|
||||
"""
|
||||
conf = blockstack_config.get_config(config_path)
|
||||
assert conf
|
||||
|
||||
api_bind = conf.get('api_endpoint_bind', 'localhost') if api_bind is None else api_bind
|
||||
|
||||
# arg --> envar --> config
|
||||
if api_bind is None:
|
||||
api_bind = os.environ.get("BLOCKSTACK_API_BIND", None)
|
||||
if api_bind is None:
|
||||
api_bind = conf.get('api_endpoint_bind', 'localhost') if api_bind is None else api_bind
|
||||
|
||||
srv = BlockstackAPIEndpoint(api_pass, wallet_keys, host=api_bind, port=portnum, config_path=config_path)
|
||||
return srv
|
||||
|
||||
Reference in New Issue
Block a user