Add custom config for autoconnect peer interval (#1759)

This commit is contained in:
Jonathan Zernik 2021-11-04 20:46:22 -07:00 committed by GitHub
parent 7916ef1bee
commit c6de020428
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 1 deletions

View file

@ -19,6 +19,7 @@ node.squeak_retention_s | int | [0,...] | yes | 604800 | SQUEAKNODE_NODE_SQUEAK_
node.squeak_deletion_interval_s | int | [0,...] | yes | 10 | SQUEAKNODE_NODE_SQUEAK_DELETION_INTERVAL_S | The amount of time in seconds to wait in between deleting old squeaks.
node.offer_deletion_interval_s | int | [0,...] | yes | 10 | SQUEAKNODE_NODE_OFFER_DELETION_INTERVAL_S | The amount of time in seconds to wait in between deleting old offers.
node.interest_block_interval | int | [0,...] | yes | 2016 | SQUEAKNODE_NODE_INTEREST_BLOCK_INTERVAL | The number of blocks (starting from the most recent and descending) that this node will attempt to find squeaks with matching block height.
node.peer_autoconnect_interval_s | int | [0,...] | yes | 10 | SQUEAKNODE_NODE_PEER_AUTOCONNECT_INTERVAL_S | The amount of time in seconds to wait in between trying to connect autoconnect peers.
bitcoin.rpc_host | string | | yes | "localhost" | SQUEAKNODE_BITCOIN_RPC_HOST | The host of the bitcoin node to connect.
bitcoin.rpc_port | int | | yes | 18334 | SQUEAKNODE_BITCOIN_RPC_HOST | The port of the bitcoin node to connect.
bitcoin.rpc_user | string | | yes | "" | SQUEAKNODE_BITCOIN_RPC_USER | The username to use for authentication on the bitcoin node.

View file

@ -62,6 +62,7 @@ DEFAULT_INTEREST_BLOCK_INTERVAL = 2016
DEFAULT_SENT_OFFER_RETENTION_S = 86400
DEFAULT_RECEIVED_OFFER_RETENTION_S = 86400
DEFAULT_OFFER_DELETION_INTERVAL_S = 10
DEFAULT_PEER_AUTOCONNECT_INTERVAL_S = 10
DEFAULT_SUBSCRIBE_INVOICES_RETRY_S = 10
DEFAULT_SQUEAK_RETENTION_S = 604800
DEFAULT_SQUEAK_DELETION_INTERVAL_S = 10
@ -151,6 +152,8 @@ class NodeConfig(Config):
cast=int, required=False, default=DEFAULT_OFFER_DELETION_INTERVAL_S)
interest_block_interval = key(
cast=int, required=False, default=DEFAULT_INTEREST_BLOCK_INTERVAL)
peer_autoconnect_interval_s = key(
cast=int, required=False, default=DEFAULT_PEER_AUTOCONNECT_INTERVAL_S)
@section('db')

View file

@ -229,7 +229,7 @@ class SqueakNode:
def initialize_peer_connection_worker(self):
self.peer_connection_worker = PeerConnectionWorker(
self.squeak_controller,
10,
self.config.node.peer_autoconnect_interval_s,
)
def initialize_squeak_deletion_worker(self):