mirror of
https://github.com/yzernik/squeaknode.git
synced 2026-08-18 13:09:08 +02:00
Use network config from config file to set paramas (#182)
This commit is contained in:
parent
5976623f74
commit
80713c94ea
3 changed files with 14 additions and 11 deletions
|
|
@ -1,5 +1,7 @@
|
|||
[DEFAULT]
|
||||
[squeaknode]
|
||||
network=simnet
|
||||
price=1000
|
||||
max_squeaks_per_address_per_hour=5
|
||||
|
||||
[lnd]
|
||||
host=lnd
|
||||
|
|
@ -19,10 +21,6 @@ rpc_pass=devpass
|
|||
rpc_host=0.0.0.0
|
||||
rpc_port=8774
|
||||
|
||||
[squeaknode]
|
||||
price=1000
|
||||
max_squeaks_per_address_per_hour=5
|
||||
|
||||
[admin]
|
||||
rpc_host=0.0.0.0
|
||||
rpc_port=8994
|
||||
|
|
|
|||
|
|
@ -20,8 +20,8 @@ from tests.util import load_lightning_client
|
|||
|
||||
@pytest.fixture(autouse=True)
|
||||
def select_mainnet_params():
|
||||
# Set the network to mainnet.
|
||||
SelectParams("mainnet")
|
||||
# Set the network to simnet
|
||||
SelectParams("simnet")
|
||||
|
||||
@pytest.fixture
|
||||
def server_stub():
|
||||
|
|
|
|||
|
|
@ -51,6 +51,10 @@ def load_admin_rpc_server(config, handler) -> SqueakAdminServerServicer:
|
|||
)
|
||||
|
||||
|
||||
def load_network(config):
|
||||
return config["squeaknode"]["network"]
|
||||
|
||||
|
||||
def load_price(config):
|
||||
return int(config["squeaknode"]["price"])
|
||||
|
||||
|
|
@ -134,10 +138,6 @@ def main():
|
|||
|
||||
|
||||
def run_server(config):
|
||||
logger.info("network: " + config["DEFAULT"]["network"])
|
||||
# SelectParams(config['DEFAULT']['network'])
|
||||
SelectParams("mainnet")
|
||||
|
||||
# load the db params
|
||||
db_params = load_db_params(config)
|
||||
logger.info("db params: " + str(db_params))
|
||||
|
|
@ -148,6 +148,11 @@ def run_server(config):
|
|||
postgres_db.get_version()
|
||||
postgres_db.init()
|
||||
|
||||
# load the price
|
||||
network = load_network(config)
|
||||
logger.info("network: " + network)
|
||||
SelectParams(network)
|
||||
|
||||
# load the price
|
||||
price = load_price(config)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue