Improve squeaknode entrypoint command (#583)

* Improve squeaknode entrypoint command

* Fix pargser in main module
This commit is contained in:
Jonathan Zernik 2021-01-08 14:17:43 -08:00 committed by GitHub
parent cef4eeca03
commit c39dbb44f1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 16 additions and 15 deletions

View file

@ -46,7 +46,7 @@ If you don't already have a bitcoin node or lightning node, you can follow the i
- Start the squeak server:
```
$ runsqueaknode --config config.ini run-server
$ squeaknode --config config.ini
```
- Go to http://localhost:12994/ and use the username/password in **config.ini** to log in.

View file

@ -13,7 +13,7 @@
$ source venv/bin/activate
$ pip install -r requirements.txt
$ python setup.py install
$ SQUEAKNODE_WEBADMIN_ENABLED=TRUE SQUEAKNODE_WEBADMIN_LOGIN_DISABLED=TRUE SQUEAKNODE_WEBADMIN_ALLOW_CORS=TRUE SQUEAKNODE_NETWORK=testnet runsqueaknode --config config.ini run-server
$ SQUEAKNODE_WEBADMIN_ENABLED=TRUE SQUEAKNODE_WEBADMIN_LOGIN_DISABLED=TRUE SQUEAKNODE_WEBADMIN_ALLOW_CORS=TRUE SQUEAKNODE_NETWORK=testnet squeaknode --config config.ini
```
- Start the frontend in development mode:
```

View file

@ -102,7 +102,7 @@ setup(
extras_require={"test": ["pytest", "coverage"]},
entry_points={
'console_scripts': [
'runsqueaknode = squeaknode.main:main',
'squeaknode = squeaknode.main:main',
],
},
cmdclass={

View file

@ -177,13 +177,16 @@ def parse_args():
default="info",
help="Logging level",
)
subparsers = parser.add_subparsers(help="sub-command help")
# subparsers = parser.add_subparsers(help="sub-command help")
# create the parser for the "run-server" command
parser_run_server = subparsers.add_parser(
"run-server", help="run-server help")
parser_run_server.set_defaults(func=run_server)
# # create the parser for the "run-server" command
# parser_run_server = subparsers.add_parser(
# "run-server", help="run-server help")
# parser_run_server.set_defaults(func=run_server)
# return parser.parse_args()
parser.set_defaults(func=run_node)
return parser.parse_args()
@ -215,7 +218,7 @@ def main():
args.func(config)
def run_server(config):
def run_node(config):
# load the network
network = config.core.network
SelectParams(network)

View file

@ -13,12 +13,10 @@ sleep 10
# Start using the run server command
if [ -f config.ini ]; then
exec runsqueaknode \
exec squeaknode \
--config config.ini \
--log-level INFO \
run-server
--log-level INFO
else
exec runsqueaknode \
--log-level INFO \
run-server
exec squeaknode \
--log-level INFO
fi