From 2bbadbd7de34770823fac59beb79a4651809aa24 Mon Sep 17 00:00:00 2001 From: Jonathan Zernik Date: Sat, 23 Oct 2021 20:45:14 -0500 Subject: [PATCH] Rename rpc config section (#1716) --- docs/CONFIGURATION.md | 8 ++++---- itests/config.ini | 6 +++--- squeaknode/config/config.py | 12 ++++++------ squeaknode/node/squeak_node.py | 6 +++--- 4 files changed, 16 insertions(+), 16 deletions(-) diff --git a/docs/CONFIGURATION.md b/docs/CONFIGURATION.md index 1b102355..ce68ccff 100644 --- a/docs/CONFIGURATION.md +++ b/docs/CONFIGURATION.md @@ -35,9 +35,9 @@ lnd.macaroon_path | string | | yes | "" | SQUEAKNODE_LND_MACAROON_PATH | The pat tor.proxy_ip | string | | yes | "" | SQUEAKNODE_TOR_PROXY_IP | The ip address or host of the SOCKS5 Tor proxy, if one is used. tor.proxy_port | int | | yes | 0 | SQUEAKNODE_TOR_PROXY_PORT | The port of the SOCKS5 Tor proxy, is one is used. db.connection_string | string | | yes | "" | SQUEAKNODE_DB_CONNECTION_STRING | The connection string to use to connect to a SQL database. If none is specified, a sqlite database will be used on the local file system. -admin.rpc_enabled | boolean | [true, false] | yes | true | SQUEAKNODE_ADMIN_RPC_ENABLED | Accept RPC commands or not. -admin.rpc_host | string | | yes | "0.0.0.0" | SQUEAKNODE_ADMIN_RPC_HOST | Host to listen for admin rpc connections. -admin.rpc_port | int | | yes | 8994 | SQUEAKNODE_ADMIN_RPC_PORT | Port to listen for admin rpc connections. +rpc.enabled | boolean | [true, false] | yes | false | SQUEAKNODE_RPC_ENABLED | Accept RPC commands or not. +rpc.host | string | | yes | "0.0.0.0" | SQUEAKNODE_RPC_HOST | Host to listen for rpc connections. +rpc.port | int | | yes | 8994 | SQUEAKNODE_RPC_PORT | Port to listen for rpc connections. webadmin.enabled | boolean | [true, false] | yes | false | SQUEAKNODE_WEBADMIN_ENABLED | Run a web admin server or not. webadmin.host | string | | yes | "0.0.0.0" | SQUEAKNODE_WEBADMIN_HOST | Host to user for serving admin web server. webadmin.port | int | | yes | 12994 | SQUEAKNODE_WEBADMIN_PORT | Port to user for serving admin web server. @@ -46,7 +46,7 @@ webadmin.password | string | | yes | "" | SQUEAKNODE_WEBADMIN_PASSWORD | Passwor webadmin.use_ssl | boolean | | yes | false | SQUEAKNODE_WEBADMIN_USE_SSL | Use SSL for admin web server or not. webadmin.login_disabled | boolean | | yes | false | SQUEAKNODE_WEBADMIN_LOGIN_DISABLED | Disable requiring login for web server or not. webadmin.allow_cors | boolean | | yes | false | SQUEAKNODE_WEBADMIN_ALLOW_CORS | Allow CORS requests to admin web server or not. -server.enabled | boolean | | yes | false | SQUEAKNODE_SERVER_ENABLED | If true, then accept inbound connections from other peers. +server.enabled | boolean | | yes | true | SQUEAKNODE_SERVER_ENABLED | If true, then accept inbound connections from other peers. server.host | string | | yes | "0.0.0.0" | SQUEAKNODE_SERVER_HOST | Host to user for accepting inbound peer connections. server.port | int | | yes | 8555/18555 | SQUEAKNODE_SERVER_PORT | Port to user for accepting inbound peer connections. server.external_address | string | | yes | "" | SQUEAKNODE_SERVER_EXTERNAL_ADDRESS | The address that other nodes should use to open a connection to this node. diff --git a/itests/config.ini b/itests/config.ini index 27384328..8d2fb80a 100644 --- a/itests/config.ini +++ b/itests/config.ini @@ -1,7 +1,7 @@ [node] network=simnet price_msat=1000000 -max_squeaks_per_address_per_block=5 +max_squeaks_per_address_in_block_range=50 [lnd] host=lnd @@ -21,5 +21,5 @@ host=db user=postgres password=postgres -[admin] -rpc_enabled=true +[rpc] +enabled=true diff --git a/squeaknode/config/config.py b/squeaknode/config/config.py index aab141c8..fd7e72cc 100644 --- a/squeaknode/config/config.py +++ b/squeaknode/config/config.py @@ -103,11 +103,11 @@ class ServerConfig(Config): external_address = key(cast=str, required=False, default="") -@section('admin') -class AdminConfig(Config): - rpc_enabled = key(cast=bool, required=False, default=True) - rpc_host = key(cast=str, required=False, default=DEFAULT_ADMIN_RPC_HOST) - rpc_port = key(cast=int, required=False, default=DEFAULT_ADMIN_RPC_PORT) +@section('rpc') +class RpcConfig(Config): + enabled = key(cast=bool, required=False, default=False) + host = key(cast=str, required=False, default=DEFAULT_ADMIN_RPC_HOST) + port = key(cast=int, required=False, default=DEFAULT_ADMIN_RPC_PORT) @section('webadmin') @@ -162,7 +162,7 @@ class SqueaknodeConfig(Config): lnd = group_key(LndConfig) tor = group_key(TorConfig) server = group_key(ServerConfig) - admin = group_key(AdminConfig) + rpc = group_key(RpcConfig) webadmin = group_key(WebadminConfig) node = group_key(NodeConfig) db = group_key(DbConfig) diff --git a/squeaknode/node/squeak_node.py b/squeaknode/node/squeak_node.py index 9c2e46e0..371e65a9 100644 --- a/squeaknode/node/squeak_node.py +++ b/squeaknode/node/squeak_node.py @@ -78,7 +78,7 @@ class SqueakNode: self._initialize() self.network_manager.start(self.squeak_controller) - if self.config.admin.rpc_enabled: + if self.config.rpc.enabled: self.admin_rpc_server.start() if self.config.webadmin.enabled: self.admin_web_server.start() @@ -173,8 +173,8 @@ class SqueakNode: def initialize_admin_rpc_server(self): self.admin_rpc_server = SqueakAdminServerServicer( - self.config.admin.rpc_host, - self.config.admin.rpc_port, + self.config.rpc.host, + self.config.rpc.port, self.admin_handler, )