From a7e9200c30b626e70b3bb8c37461a68e99454c4e Mon Sep 17 00:00:00 2001 From: Adam Shamblin Date: Sun, 18 Sep 2022 17:01:38 -0600 Subject: [PATCH 1/7] veilid6, begin commenting config w/ rustdoc --- veilid-core/src/veilid_config.rs | 89 ++++++++++++++++++++++++++++++++ 1 file changed, 89 insertions(+) diff --git a/veilid-core/src/veilid_config.rs b/veilid-core/src/veilid_config.rs index db9b469c..e8769776 100644 --- a/veilid-core/src/veilid_config.rs +++ b/veilid-core/src/veilid_config.rs @@ -6,6 +6,16 @@ use serde::*; pub type ConfigCallbackReturn = Result, VeilidAPIError>; pub type ConfigCallback = Arc ConfigCallbackReturn + Send + Sync>; +/// Enable and configure HTTPS access to the Veilid node +/// +/// ```yaml +/// https: +/// enabled: false +/// listen_address: ':5150' +/// path: 'app' +/// url: 'https://localhost:5150' +/// ``` +/// #[derive(Default, Debug, Clone, Serialize, Deserialize)] pub struct VeilidConfigHTTPS { pub enabled: bool, @@ -14,6 +24,16 @@ pub struct VeilidConfigHTTPS { pub url: Option, // Fixed URL is not optional for TLS-based protocols and is dynamically validated } +/// Enable and configure HTTP access to the Veilid node +/// +/// ```yaml +/// http: +/// enabled: false +/// listen_address: ':5150' +/// path: 'app" +/// url: 'https://localhost:5150' +/// ``` +/// #[derive(Default, Debug, Clone, Serialize, Deserialize)] pub struct VeilidConfigHTTP { pub enabled: bool, @@ -22,12 +42,28 @@ pub struct VeilidConfigHTTP { pub url: Option, } +/// Application configuration +/// +/// Configure web access to the Prograssive Web App (PWA) +/// +/// To be implemented... +/// #[derive(Default, Debug, Clone, Serialize, Deserialize)] pub struct VeilidConfigApplication { pub https: VeilidConfigHTTPS, pub http: VeilidConfigHTTP, } +/// Enable and configure UDP +/// +/// ```yaml +/// udp: +/// enabled: true +/// socket_pool_size: 0 +/// listen_address: ':5150' +/// public_address: '' +/// ``` +/// #[derive(Default, Debug, Clone, Serialize, Deserialize)] pub struct VeilidConfigUDP { pub enabled: bool, @@ -36,6 +72,16 @@ pub struct VeilidConfigUDP { pub public_address: Option, } +/// Enable and configure TCP +/// +/// ```yaml +/// tcp: +/// connect: true +/// listen: true +/// max_connections: 32 +/// listen_address: ':5150' +/// public_address: '' +/// #[derive(Default, Debug, Clone, Serialize, Deserialize)] pub struct VeilidConfigTCP { pub connect: bool, @@ -45,6 +91,17 @@ pub struct VeilidConfigTCP { pub public_address: Option, } +/// Enable and configure Web Sockets +/// +/// ```yaml +/// ws: +/// connect: true +/// listen: true +/// max_connections: 16 +/// listen_address: ':5150' +/// path: 'ws' +/// url: 'ws://localhost:5150/ws' +/// #[derive(Default, Debug, Clone, Serialize, Deserialize)] pub struct VeilidConfigWS { pub connect: bool, @@ -55,6 +112,17 @@ pub struct VeilidConfigWS { pub url: Option, } +/// Enable and configure Secure Web Sockets +/// +/// ```yaml +/// wss: +/// connect: true +/// listen: false +/// max_connections: 16 +/// listen_address: ':5150' +/// path: 'ws' +/// url: '' +/// #[derive(Default, Debug, Clone, Serialize, Deserialize)] pub struct VeilidConfigWSS { pub connect: bool, @@ -65,6 +133,13 @@ pub struct VeilidConfigWSS { pub url: Option, // Fixed URL is not optional for TLS-based protocols and is dynamically validated } +/// Configure Network Protocols +/// +/// Veilid can communicate over UDP, TCP, and Web Sockets. +/// +/// All protocols are available by default, and the Veilid node will +/// sort out which protocol is used for each peer connection. +/// #[derive(Default, Debug, Clone, Serialize, Deserialize)] pub struct VeilidConfigProtocol { pub udp: VeilidConfigUDP, @@ -73,6 +148,14 @@ pub struct VeilidConfigProtocol { pub wss: VeilidConfigWSS, } +/// Configure TLS +/// +/// ```yaml +/// tls: +/// certificate_path: /path/to/cert +/// private_key_path: /path/to/private/key +/// connection_initial_timeout_ms: 2000 +/// #[derive(Default, Debug, Clone, Serialize, Deserialize)] pub struct VeilidConfigTLS { pub certificate_path: String, @@ -80,6 +163,8 @@ pub struct VeilidConfigTLS { pub connection_initial_timeout_ms: u32, } +/// Configure the Distributed Hash Table (DHT) +/// #[derive(Default, Debug, Clone, Serialize, Deserialize)] pub struct VeilidConfigDHT { pub resolve_node_timeout_ms: Option, @@ -97,6 +182,8 @@ pub struct VeilidConfigDHT { pub validate_dial_info_receipt_time_ms: u32, } +/// Configure RPC +/// #[derive(Default, Debug, Clone, Serialize, Deserialize)] pub struct VeilidConfigRPC { pub concurrency: u32, @@ -107,6 +194,8 @@ pub struct VeilidConfigRPC { pub max_route_hop_count: u8, } +/// Configure the network routing table +/// #[derive(Default, Debug, Clone, Serialize, Deserialize)] pub struct VeilidConfigRoutingTable { pub limit_over_attached: u32, From b7e05ceea0be6c5c1e9b5af66696cf32dc1513ba Mon Sep 17 00:00:00 2001 From: Adam Shamblin Date: Mon, 19 Sep 2022 19:18:46 -0600 Subject: [PATCH 2/7] WIP, further docs --- .gitignore | 1 - README.md | 31 +++++++- veilid-core/src/veilid_config.rs | 3 + veilid-server/sample.config | 127 +++++++++++++++++++++++++++++++ veilid-server/src/unix.rs | 1 + 5 files changed, 160 insertions(+), 3 deletions(-) create mode 100644 veilid-server/sample.config diff --git a/.gitignore b/.gitignore index 22282470..44ae98d5 100644 --- a/.gitignore +++ b/.gitignore @@ -61,4 +61,3 @@ $RECYCLE.BIN/ ### Rust target/ logs/ - diff --git a/README.md b/README.md index 6ad68114..5e77285c 100644 --- a/README.md +++ b/README.md @@ -129,7 +129,9 @@ cd veilid-flutter **TODO** -## Veilid Server +## Running the Application(s) + +### Veilid Server In order to run the `veilid-server` locally: @@ -144,7 +146,7 @@ In order to see what options are available: cargo run -- --help ``` -## Veilid CLI +### Veilid CLI In order to connect to your local `veilid-server`: @@ -158,3 +160,28 @@ Similar to `veilid-server`, you may see CLI options by typing: ```shell cargo run -- --help ``` + +## Building the Application + +### Linux Packages + +Veilid server and cli can be built locally using the +[Earthly](https://earthly.dev/) framework. After [installing earthly on your +local machine](https://earthly.dev/get-earthly), you may use the `earthly` cli +to initiate a build: + +```shell +earthly +package-linux +``` + +This will assemble all dependencies and build `.deb` packages for both amd64 and +arm64 platforms. Earthly, built on Docker, caches build layers, so after a +longer first build, subsequent builds should be much quicker. + +During development, you may want to kick off specific build steps. To see a list +of the build steps configured, consult the `Earthfile`, or you may use the +`earthly` cli: + +```shell +earthly ls +``` diff --git a/veilid-core/src/veilid_config.rs b/veilid-core/src/veilid_config.rs index e8769776..dad9f8ae 100644 --- a/veilid-core/src/veilid_config.rs +++ b/veilid-core/src/veilid_config.rs @@ -333,6 +333,9 @@ pub struct VeilidConfigInner { pub network: VeilidConfigNetwork, } +/// The Veilid Configuration +/// +/// Veilid is configured #[derive(Clone)] pub struct VeilidConfig { inner: Arc>, diff --git a/veilid-server/sample.config b/veilid-server/sample.config new file mode 100644 index 00000000..3c7a4950 --- /dev/null +++ b/veilid-server/sample.config @@ -0,0 +1,127 @@ +daemon: + enabled: false +client_api: + enabled: true + listen_address: 'localhost:5959' +auto_attach: true +logging: + system: + enabled: false + level: 'info' + terminal: + enabled: true + level: 'info' + file: + enabled: false + path: '' + append: true + level: 'info' + api: + enabled: true + level: 'info' + otlp: + enabled: false + level: 'trace' + grpc_endpoint: 'localhost:4317' +testing: + subnode_index: 0 +core: + protected_store: + allow_insecure_fallback: true + always_use_insecure_storage: true + insecure_fallback_directory: '%INSECURE_FALLBACK_DIRECTORY%' + delete: false + table_store: + directory: '%TABLE_STORE_DIRECTORY%' + delete: false + block_store: + directory: '%BLOCK_STORE_DIRECTORY%' + delete: false + network: + connection_initial_timeout_ms: 2000 + connection_inactivity_timeout_ms: 60000 + max_connections_per_ip4: 32 + max_connections_per_ip6_prefix: 32 + max_connections_per_ip6_prefix_size: 56 + max_connection_frequency_per_min: 128 + client_whitelist_timeout_ms: 300000 + reverse_connection_receipt_time_ms: 5000 + hole_punch_receipt_time_ms: 5000 + node_id: '' + node_id_secret: '' + bootstrap: ['bootstrap.dev.veilid.net'] + bootstrap_nodes: [] + routing_table: + limit_over_attached: 64 + limit_fully_attached: 32 + limit_attached_strong: 16 + limit_attached_good: 8 + limit_attached_weak: 4 + rpc: + concurrency: 0 + queue_size: 1024 + max_timestamp_behind_ms: 10000 + max_timestamp_ahead_ms: 10000 + timeout_ms: 10000 + max_route_hop_count: 7 + dht: + resolve_node_timeout: + resolve_node_count: 20 + resolve_node_fanout: 3 + max_find_node_count: 20 + get_value_timeout: + get_value_count: 20 + get_value_fanout: 3 + set_value_timeout: + set_value_count: 20 + set_value_fanout: 5 + min_peer_count: 20 + min_peer_refresh_time_ms: 2000 + validate_dial_info_receipt_time_ms: 2000 + upnp: true + natpmp: false + detect_address_changes: true + enable_local_peer_scope: false + restricted_nat_retries: 0 + tls: + certificate_path: '%CERTIFICATE_PATH%' + private_key_path: '%PRIVATE_KEY_PATH%' + connection_initial_timeout_ms: 2000 + application: + https: + enabled: false + listen_address: ':5150' + path: 'app' + # url: 'https://localhost:5150' + http: + enabled: false + listen_address: ':5150' + path: 'app' + # url: 'http://localhost:5150' + protocol: + udp: + enabled: true + socket_pool_size: 0 + listen_address: ':5150' + # public_address: '' + tcp: + connect: true + listen: true + max_connections: 32 + listen_address: ':5150' + #'public_address: '' + ws: + connect: true + listen: true + max_connections: 16 + listen_address: ':5150' + path: 'ws' + # url: 'ws://localhost:5150/ws' + wss: + connect: true + listen: false + max_connections: 16 + listen_address: ':5150' + path: 'ws' + # url: '' + diff --git a/veilid-server/src/unix.rs b/veilid-server/src/unix.rs index f3374823..fe66e943 100644 --- a/veilid-server/src/unix.rs +++ b/veilid-server/src/unix.rs @@ -26,6 +26,7 @@ async fn handle_signals(mut signals: Signals) { } } +#[warn(missing_docs)] #[instrument(err)] pub fn run_daemon(settings: Settings, _matches: ArgMatches) -> EyreResult<()> { let daemon = { From 90e51e70c7ddfe5b128d0f6c456c4c57a5833b68 Mon Sep 17 00:00:00 2001 From: Adam Shamblin Date: Mon, 19 Sep 2022 20:18:35 -0600 Subject: [PATCH 3/7] WIP, docs folder --- README.md | 15 ++ {veilid-server => doc/config}/sample.config | 0 doc/config/veilid-server-config.md | 149 ++++++++++++++++++++ veilid-server/src/settings.rs | 10 ++ 4 files changed, 174 insertions(+) rename {veilid-server => doc/config}/sample.config (100%) create mode 100644 doc/config/veilid-server-config.md diff --git a/README.md b/README.md index 5e77285c..7fb3c4d6 100644 --- a/README.md +++ b/README.md @@ -146,6 +146,21 @@ In order to see what options are available: cargo run -- --help ``` +#### Configuration + +`veilid-server` has a wealth of configuration options. Further documentation on +the format of the `veilid-server.conf` file may be found [in the project /doc +directory](./doc/config/config.md). + +When running `veilid-server` in a Unix-like environment, the application will +look for its config file under `/etc/veilid-server/`. If the config file is not +found in this location, `veilid-server` will follow the XDG user directory spec +and look in `~/.config/veilid-server`. + +When running under Windows, the `veilid-server.conf` file may be created at +`C:\Users\\AppData\Roaming\Veilid\Veilid\`, and when running under macOS, +at `/Users//Library/Application Support/org.Veilid.Veilid`. + ### Veilid CLI In order to connect to your local `veilid-server`: diff --git a/veilid-server/sample.config b/doc/config/sample.config similarity index 100% rename from veilid-server/sample.config rename to doc/config/sample.config diff --git a/doc/config/veilid-server-config.md b/doc/config/veilid-server-config.md new file mode 100644 index 00000000..7332214e --- /dev/null +++ b/doc/config/veilid-server-config.md @@ -0,0 +1,149 @@ +--- +title: Veilid Server Configuration +keywords: +- config +- veilid-server +status: Draft +--- +# Veilid Server Configuration + +## Configuration File + +`veilid-server` may be run using configuration from both command-line arguments +and the `veilid-server.conf` file. + +### Global Directives + +| Directive | Description | +|---------------------------|---------------------------------------------------| +| [daemon](#daemon) | Run `veilid-server` in the background | +| [client_api](#client_api) || + +```yaml +daemon: + enabled: false +client_api: + enabled: true + listen_address: 'localhost:5959' +auto_attach: true +logging: + system: + enabled: false + level: 'info' + terminal: + enabled: true + level: 'info' + file: + enabled: false + path: '' + append: true + level: 'info' + api: + enabled: true + level: 'info' + otlp: + enabled: false + level: 'trace' + grpc_endpoint: 'localhost:4317' +testing: + subnode_index: 0 +core: + protected_store: + allow_insecure_fallback: true + always_use_insecure_storage: true + insecure_fallback_directory: '%INSECURE_FALLBACK_DIRECTORY%' + delete: false + table_store: + directory: '%TABLE_STORE_DIRECTORY%' + delete: false + block_store: + directory: '%BLOCK_STORE_DIRECTORY%' + delete: false + network: + connection_initial_timeout_ms: 2000 + connection_inactivity_timeout_ms: 60000 + max_connections_per_ip4: 32 + max_connections_per_ip6_prefix: 32 + max_connections_per_ip6_prefix_size: 56 + max_connection_frequency_per_min: 128 + client_whitelist_timeout_ms: 300000 + reverse_connection_receipt_time_ms: 5000 + hole_punch_receipt_time_ms: 5000 + node_id: '' + node_id_secret: '' + bootstrap: ['bootstrap.dev.veilid.net'] + bootstrap_nodes: [] + routing_table: + limit_over_attached: 64 + limit_fully_attached: 32 + limit_attached_strong: 16 + limit_attached_good: 8 + limit_attached_weak: 4 + rpc: + concurrency: 0 + queue_size: 1024 + max_timestamp_behind_ms: 10000 + max_timestamp_ahead_ms: 10000 + timeout_ms: 10000 + max_route_hop_count: 7 + dht: + resolve_node_timeout: + resolve_node_count: 20 + resolve_node_fanout: 3 + max_find_node_count: 20 + get_value_timeout: + get_value_count: 20 + get_value_fanout: 3 + set_value_timeout: + set_value_count: 20 + set_value_fanout: 5 + min_peer_count: 20 + min_peer_refresh_time_ms: 2000 + validate_dial_info_receipt_time_ms: 2000 + upnp: true + natpmp: false + detect_address_changes: true + enable_local_peer_scope: false + restricted_nat_retries: 0 + tls: + certificate_path: '%CERTIFICATE_PATH%' + private_key_path: '%PRIVATE_KEY_PATH%' + connection_initial_timeout_ms: 2000 + application: + https: + enabled: false + listen_address: ':5150' + path: 'app' + # url: 'https://localhost:5150' + http: + enabled: false + listen_address: ':5150' + path: 'app' + # url: 'http://localhost:5150' + protocol: + udp: + enabled: true + socket_pool_size: 0 + listen_address: ':5150' + # public_address: '' + tcp: + connect: true + listen: true + max_connections: 32 + listen_address: ':5150' + #'public_address: '' + ws: + connect: true + listen: true + max_connections: 16 + listen_address: ':5150' + path: 'ws' + # url: 'ws://localhost:5150/ws' + wss: + connect: true + listen: false + max_connections: 16 + listen_address: ':5150' + path: 'ws' + # url: '' +``` diff --git a/veilid-server/src/settings.rs b/veilid-server/src/settings.rs index d7e24c46..d487f561 100644 --- a/veilid-server/src/settings.rs +++ b/veilid-server/src/settings.rs @@ -752,6 +752,16 @@ impl Settings { Ok(()) } + /// Determine default config path + /// + /// In a unix-like environment, veilid-server will look for its config file + /// in /etc/veilid-server. If a config is not found in this location, it will + /// follow the XDG user directory spec, and look in `~/.config/veilid-server/`. + /// + /// For Windows, a user-local config may be created at + /// `C:\Users\\AppData\Roaming\Veilid\Veilid`, and for macOS, at + /// `/Users//Library/Application Support/org.Veilid.Veilid` + /// pub fn get_default_config_path() -> PathBuf { #[cfg(unix)] { From 478f08f0f27134be67c74fe3f6675dbb82eecdde Mon Sep 17 00:00:00 2001 From: Adam Shamblin Date: Mon, 19 Sep 2022 20:20:26 -0600 Subject: [PATCH 4/7] Correct README link --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 7fb3c4d6..e928750d 100644 --- a/README.md +++ b/README.md @@ -150,7 +150,7 @@ cargo run -- --help `veilid-server` has a wealth of configuration options. Further documentation on the format of the `veilid-server.conf` file may be found [in the project /doc -directory](./doc/config/config.md). +directory](./doc/config/veilid-server-config.md). When running `veilid-server` in a Unix-like environment, the application will look for its config file under `/etc/veilid-server/`. If the config file is not From 648c7f94e13736ca6b7740959974791b50e1dd88 Mon Sep 17 00:00:00 2001 From: Adam Shamblin Date: Mon, 19 Sep 2022 20:20:26 -0600 Subject: [PATCH 5/7] Correct README link --- README.md | 2 +- doc/config/veilid-server-config.md | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 7fb3c4d6..e928750d 100644 --- a/README.md +++ b/README.md @@ -150,7 +150,7 @@ cargo run -- --help `veilid-server` has a wealth of configuration options. Further documentation on the format of the `veilid-server.conf` file may be found [in the project /doc -directory](./doc/config/config.md). +directory](./doc/config/veilid-server-config.md). When running `veilid-server` in a Unix-like environment, the application will look for its config file under `/etc/veilid-server/`. If the config file is not diff --git a/doc/config/veilid-server-config.md b/doc/config/veilid-server-config.md index 7332214e..15e586e0 100644 --- a/doc/config/veilid-server-config.md +++ b/doc/config/veilid-server-config.md @@ -19,6 +19,9 @@ and the `veilid-server.conf` file. | [daemon](#daemon) | Run `veilid-server` in the background | | [client_api](#client_api) || + +#### daemon + ```yaml daemon: enabled: false From cf1ca2dcba039ddbac2aded2b0069538fd6fb744 Mon Sep 17 00:00:00 2001 From: Adam Shamblin Date: Mon, 19 Sep 2022 20:41:54 -0600 Subject: [PATCH 6/7] WIP, work on doc structure --- doc/config/veilid-server-config.md | 54 ++++++++++++++++++++++++++---- 1 file changed, 48 insertions(+), 6 deletions(-) diff --git a/doc/config/veilid-server-config.md b/doc/config/veilid-server-config.md index 15e586e0..3aa78f55 100644 --- a/doc/config/veilid-server-config.md +++ b/doc/config/veilid-server-config.md @@ -12,23 +12,55 @@ status: Draft `veilid-server` may be run using configuration from both command-line arguments and the `veilid-server.conf` file. -### Global Directives +## Global Directives -| Directive | Description | -|---------------------------|---------------------------------------------------| -| [daemon](#daemon) | Run `veilid-server` in the background | -| [client_api](#client_api) || +| Directive | Description | +|-------------------------------|---------------------------------------------------| +| [daemon](#daemon) | Run `veilid-server` in the background | +| [client\_api](#client_api) || +| [auto\_attach](#auto_attach) || +| [logging](#logging) || +| [testing](#testing) || +| [core](#core) || -#### daemon +### daemon ```yaml daemon: enabled: false +``` + +### client_api + +```yaml client_api: enabled: true listen_address: 'localhost:5959' +``` + +| Parameter | Description | +|-------------------------------------|-------------| +| [enabled](#enabled) || +| [listen\_address](#listen_address) || + +#### enabled + +**TODO** + +#### listen\_address + +**TODO** + +### auto\_attach + +```yaml auto_attach: true +``` + +### logging + +```yaml logging: system: enabled: false @@ -48,8 +80,18 @@ logging: enabled: false level: 'trace' grpc_endpoint: 'localhost:4317' +``` + +### testing + +```yaml testing: subnode_index: 0 +``` + +### core + +```yaml core: protected_store: allow_insecure_fallback: true From f70303a47ee00f41aaaddae2507afcebfd7cb982 Mon Sep 17 00:00:00 2001 From: Adam Shamblin Date: Mon, 19 Sep 2022 21:05:59 -0600 Subject: [PATCH 7/7] Continued additions to config doc format --- doc/config/veilid-server-config.md | 329 +++++++++++++++++++---------- 1 file changed, 221 insertions(+), 108 deletions(-) diff --git a/doc/config/veilid-server-config.md b/doc/config/veilid-server-config.md index 3aa78f55..be37c7ed 100644 --- a/doc/config/veilid-server-config.md +++ b/doc/config/veilid-server-config.md @@ -14,9 +14,9 @@ and the `veilid-server.conf` file. ## Global Directives -| Directive | Description | -|-------------------------------|---------------------------------------------------| -| [daemon](#daemon) | Run `veilid-server` in the background | +| Directive | Description | +|-------------------------------|-----------------------------------------| +| [daemon](#daemon) | Run `veilid-server` in the background | | [client\_api](#client_api) || | [auto\_attach](#auto_attach) || | [logging](#logging) || @@ -39,16 +39,16 @@ client_api: listen_address: 'localhost:5959' ``` -| Parameter | Description | -|-------------------------------------|-------------| -| [enabled](#enabled) || -| [listen\_address](#listen_address) || +| Parameter | Description | +|-----------------------------------------------|-------------| +| [enabled](#client_apienabled) || +| [listen\_address](#client_apilisten_address) || -#### enabled +#### client\_api:enabled **TODO** -#### listen\_address +#### client\_api:listen\_address **TODO** @@ -82,6 +82,57 @@ logging: grpc_endpoint: 'localhost:4317' ``` +| Parameter | Description | +|-------------------------------|-------------| +| [system](#loggingsystem) || +| [terminal](#loggingterminal) || +| [file](#loggingfile) || +| [api](#loggingapi) || +| [otlp](#loggingotlp) || + +#### logging:system + +```yaml +system: + enabled: false + level: 'info' +``` + +#### logging:terminal + +```yaml +terminal: + enabled: true + level: 'info' +``` + +#### logging:file + +```yaml +file: + enabled: false + path: '' + append: true + level: 'info' +``` + +#### logging:api + +```yaml +api: + enabled: true + level: 'info' +``` + +#### logging:otlp + +```yaml +otlp: + enabled: false + level: 'trace' + grpc_endpoint: 'localhost:4317' +``` + ### testing ```yaml @@ -91,104 +142,166 @@ testing: ### core +| Parameter | Description | +|-------------------------------------------|-------------| +| [protected\_store](#coreprotected_store) || +| [table\_store](#coretable_store) || +| [block\_store](#block_store) || +| [network](#corenetwork) || + +#### core:protected\_store + ```yaml -core: - protected_store: - allow_insecure_fallback: true - always_use_insecure_storage: true - insecure_fallback_directory: '%INSECURE_FALLBACK_DIRECTORY%' - delete: false - table_store: - directory: '%TABLE_STORE_DIRECTORY%' - delete: false - block_store: - directory: '%BLOCK_STORE_DIRECTORY%' - delete: false - network: - connection_initial_timeout_ms: 2000 - connection_inactivity_timeout_ms: 60000 - max_connections_per_ip4: 32 - max_connections_per_ip6_prefix: 32 - max_connections_per_ip6_prefix_size: 56 - max_connection_frequency_per_min: 128 - client_whitelist_timeout_ms: 300000 - reverse_connection_receipt_time_ms: 5000 - hole_punch_receipt_time_ms: 5000 - node_id: '' - node_id_secret: '' - bootstrap: ['bootstrap.dev.veilid.net'] - bootstrap_nodes: [] - routing_table: - limit_over_attached: 64 - limit_fully_attached: 32 - limit_attached_strong: 16 - limit_attached_good: 8 - limit_attached_weak: 4 - rpc: - concurrency: 0 - queue_size: 1024 - max_timestamp_behind_ms: 10000 - max_timestamp_ahead_ms: 10000 - timeout_ms: 10000 - max_route_hop_count: 7 - dht: - resolve_node_timeout: - resolve_node_count: 20 - resolve_node_fanout: 3 - max_find_node_count: 20 - get_value_timeout: - get_value_count: 20 - get_value_fanout: 3 - set_value_timeout: - set_value_count: 20 - set_value_fanout: 5 - min_peer_count: 20 - min_peer_refresh_time_ms: 2000 - validate_dial_info_receipt_time_ms: 2000 - upnp: true - natpmp: false - detect_address_changes: true - enable_local_peer_scope: false - restricted_nat_retries: 0 - tls: - certificate_path: '%CERTIFICATE_PATH%' - private_key_path: '%PRIVATE_KEY_PATH%' - connection_initial_timeout_ms: 2000 - application: - https: - enabled: false - listen_address: ':5150' - path: 'app' - # url: 'https://localhost:5150' - http: - enabled: false - listen_address: ':5150' - path: 'app' - # url: 'http://localhost:5150' - protocol: - udp: - enabled: true - socket_pool_size: 0 - listen_address: ':5150' - # public_address: '' - tcp: - connect: true - listen: true - max_connections: 32 - listen_address: ':5150' - #'public_address: '' - ws: - connect: true - listen: true - max_connections: 16 - listen_address: ':5150' - path: 'ws' - # url: 'ws://localhost:5150/ws' - wss: - connect: true - listen: false - max_connections: 16 - listen_address: ':5150' - path: 'ws' - # url: '' +protected_store: + allow_insecure_fallback: true + always_use_insecure_storage: true + insecure_fallback_directory: '%INSECURE_FALLBACK_DIRECTORY%' + delete: false +``` + +#### core:table\_store + +```yaml +table_store: + directory: '%TABLE_STORE_DIRECTORY%' + delete: false +``` + +#### core:block\_store + +```yaml +block_store: + directory: '%BLOCK_STORE_DIRECTORY%' + delete: false +``` + +#### core:network + +```yaml +network: + connection_initial_timeout_ms: 2000 + connection_inactivity_timeout_ms: 60000 + max_connections_per_ip4: 32 + max_connections_per_ip6_prefix: 32 + max_connections_per_ip6_prefix_size: 56 + max_connection_frequency_per_min: 128 + client_whitelist_timeout_ms: 300000 + reverse_connection_receipt_time_ms: 5000 + hole_punch_receipt_time_ms: 5000 + node_id: '' + node_id_secret: '' + bootstrap: ['bootstrap.dev.veilid.net'] + bootstrap_nodes: [] + upnp: true + natpmp: false + detect_address_changes: true + enable_local_peer_scope: false + restricted_nat_retries: 0 +``` + +| Parameter | Description | +|---------------------------------------------|-------------| +| [routing\_table](#corenetworkrouting_table) || +| [rpc](#corenetworkrpc) || +| [dht](#corenetworkdht) || +| [tls](#corenetworktls) || +| [application](#corenetworkapplication) || +| [protocol](#corenetworkprotocol) || + +#### core:network:routing\_table + +```yaml +routing_table: + limit_over_attached: 64 + limit_fully_attached: 32 + limit_attached_strong: 16 + limit_attached_good: 8 + limit_attached_weak: 4 +``` + +#### core:network:rpc + +```yaml +rpc: + concurrency: 0 + queue_size: 1024 + max_timestamp_behind_ms: 10000 + max_timestamp_ahead_ms: 10000 + timeout_ms: 10000 + max_route_hop_count: 7 +``` + +#### core:network:dht + +```yaml +dht: + resolve_node_timeout: + resolve_node_count: 20 + resolve_node_fanout: 3 + max_find_node_count: 20 + get_value_timeout: + get_value_count: 20 + get_value_fanout: 3 + set_value_timeout: + set_value_count: 20 + set_value_fanout: 5 + min_peer_count: 20 + min_peer_refresh_time_ms: 2000 + validate_dial_info_receipt_time_ms: 2000 +``` + +#### core:network:tls + +```yaml +tls: + certificate_path: '%CERTIFICATE_PATH%' + private_key_path: '%PRIVATE_KEY_PATH%' + connection_initial_timeout_ms: 2000 +``` + +#### core:network:application + +```yaml +application: + https: + enabled: false + listen_address: ':5150' + path: 'app' + # url: 'https://localhost:5150' + http: + enabled: false + listen_address: ':5150' + path: 'app' + # url: 'http://localhost:5150' +``` + +#### core:network:protocol + +```yaml +protocol: + udp: + enabled: true + socket_pool_size: 0 + listen_address: ':5150' + # public_address: '' + tcp: + connect: true + listen: true + max_connections: 32 + listen_address: ':5150' + #'public_address: '' + ws: + connect: true + listen: true + max_connections: 16 + listen_address: ':5150' + path: 'ws' + # url: 'ws://localhost:5150/ws' + wss: + connect: true + listen: false + max_connections: 16 + listen_address: ':5150' + path: 'ws' + # url: '' ```