Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Split-up and refactor settings #442

Closed
zeeshanlakhani opened this issue Nov 16, 2023 · 1 comment
Closed

Split-up and refactor settings #442

zeeshanlakhani opened this issue Nov 16, 2023 · 1 comment
Assignees
Labels
dx Developer experience applications and improvements networking Features, functionality involving networking

Comments

@zeeshanlakhani
Copy link
Contributor

Summary

We have a lot of them! Let's clean this up.

@zeeshanlakhani zeeshanlakhani added dx Developer experience applications and improvements networking Features, functionality involving networking labels Nov 16, 2023
@bgins bgins self-assigned this Nov 21, 2023
bgins added a commit that referenced this issue Nov 28, 2023
# Description

This PR implements the following changes:

- [x] Break up `[node.network]` settings into smaller groups
- [x] Move `[monitoring]` settings to `[node.monitoring]`
- [x] Add `defaults.toml` with complete settings matching the defaults
- [x] Reduce the settings passed to consumers to the minimum necessary
- [x] Update test fixtures using the new settings
- [x] Update and add comments

A complete version of the updated settings will look something like:

```toml
[node]
gc_interval = 1800
shutdown_timeout = 20

[node.database]
url = "homestar.db"
max_pool_size = 100

[node.monitoring]
process_collector_interval = 5000
console_subscriber_port = 6669

[node.network]
events_buffer_len = 1024
poll_cache_interval = 1000

[node.network.ipfs]
host = "127.0.0.1"
port = 5001

[node.network.libp2p]
listen_address = "/ip4/0.0.0.0/tcp/0"
node_addresses = []
announce_addresses = []
transport_connection_timeout = 60
max_connected_peers = 32
max_announce_addresses = 10

[node.network.libp2p.mdns]
enable = true
enable_ipv6 = false
query_interval = 300
ttl = 540

[node.network.libp2p.rendezvous]
enable_client = true
enable_server = false
registration_ttl = 7200
discovery_interval = 600

[node.network.libp2p.pubsub]
enable = false
duplication_cache_time = 1
heartbeat = 60
idle_timeout = 86400
max_transmit_size = 10485760
mesh_n_low = 1
mesh_n_high = 10
mesh_n = 2
mesh_outbound_min = 1

[node.network.libp2p.dht]
p2p_provider_timeout = 30
receipt_quorum = 2
workflow_quorum = 3

[node.network.keypair_config]
random = { }

[node.network.metrics]
port = 4000

[node.network.rpc]
host = "::1"
port = 3030
max_connections = 10
server_timeout = 120

[node.network.webserver]
host = "127.0.0.1"
port = 1337
timeout = 120
websocket_capacity = 2048
websocket_receiver_timeout = 30000

```

## Link to issue

Closes #442 

## Type of change

- [x] Refactor (non-breaking change that updates existing functionality)
- [ ] This change requires a documentation update. (It does. Will do.)
- [x] Comments have been added/updated.

## Test plan (required)

All existing tests should pass with the updated fixtures.
@bgins
Copy link
Contributor

bgins commented Nov 28, 2023

Closed by #451.

@bgins bgins closed this as completed Nov 28, 2023
zeeshanlakhani pushed a commit that referenced this issue Nov 29, 2023
# Description

This PR implements the following changes:

- [x] Break up `[node.network]` settings into smaller groups
- [x] Move `[monitoring]` settings to `[node.monitoring]`
- [x] Add `defaults.toml` with complete settings matching the defaults
- [x] Reduce the settings passed to consumers to the minimum necessary
- [x] Update test fixtures using the new settings
- [x] Update and add comments

A complete version of the updated settings will look something like:

```toml
[node]
gc_interval = 1800
shutdown_timeout = 20

[node.database]
url = "homestar.db"
max_pool_size = 100

[node.monitoring]
process_collector_interval = 5000
console_subscriber_port = 6669

[node.network]
events_buffer_len = 1024
poll_cache_interval = 1000

[node.network.ipfs]
host = "127.0.0.1"
port = 5001

[node.network.libp2p]
listen_address = "/ip4/0.0.0.0/tcp/0"
node_addresses = []
announce_addresses = []
transport_connection_timeout = 60
max_connected_peers = 32
max_announce_addresses = 10

[node.network.libp2p.mdns]
enable = true
enable_ipv6 = false
query_interval = 300
ttl = 540

[node.network.libp2p.rendezvous]
enable_client = true
enable_server = false
registration_ttl = 7200
discovery_interval = 600

[node.network.libp2p.pubsub]
enable = false
duplication_cache_time = 1
heartbeat = 60
idle_timeout = 86400
max_transmit_size = 10485760
mesh_n_low = 1
mesh_n_high = 10
mesh_n = 2
mesh_outbound_min = 1

[node.network.libp2p.dht]
p2p_provider_timeout = 30
receipt_quorum = 2
workflow_quorum = 3

[node.network.keypair_config]
random = { }

[node.network.metrics]
port = 4000

[node.network.rpc]
host = "::1"
port = 3030
max_connections = 10
server_timeout = 120

[node.network.webserver]
host = "127.0.0.1"
port = 1337
timeout = 120
websocket_capacity = 2048
websocket_receiver_timeout = 30000

```

## Link to issue

Closes #442 

## Type of change

- [x] Refactor (non-breaking change that updates existing functionality)
- [ ] This change requires a documentation update. (It does. Will do.)
- [x] Comments have been added/updated.

## Test plan (required)

All existing tests should pass with the updated fixtures.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dx Developer experience applications and improvements networking Features, functionality involving networking
Projects
None yet
Development

No branches or pull requests

2 participants