From aebef798209b809abbda40ac35da2cfbfb23039e Mon Sep 17 00:00:00 2001 From: Victor Shyba Date: Thu, 19 May 2022 18:15:21 -0300 Subject: [PATCH 1/4] add p2p-seeding.md --- documents/resources/p2p-seeding.md | 55 ++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 documents/resources/p2p-seeding.md diff --git a/documents/resources/p2p-seeding.md b/documents/resources/p2p-seeding.md new file mode 100644 index 0000000..d65ca40 --- /dev/null +++ b/documents/resources/p2p-seeding.md @@ -0,0 +1,55 @@ +--- +title: LBRY P2P: Settings and troubleshooting +description: Guide on properly setting up P2P nodes and how to diagnose/fix common issues. +--- + +# LBRY P2P: Settings and troubleshooting + +A very important step in supporting the network resilience is hosting content in a decentralized way. This already happens when you stream content using the desktop version of LBRY APP, but sometimes we want to make sure this is working or dedicate larger amounts of resources for this task. + +This document aims to explain P2P configuration and troubleshooting from small to large nodes. If you don't know how to change SDK settings, check [this other document first](https://lbry.tech/resources/daemon-settings). + +## Reachability +The first priority when seeding content is making sure there is a way for other nodes to reach you across the internet. + +### Figuring out your ports +In order to troubleshoot reachability, we start by checking your configuration for the UDP and TCP ports. By default, they will both be set to 4444. Those can be found on the configuration under the keys `udp_port` and `tcp_port`. Please set them both to the same value as this helps holepunching and ease of management. + +### Checking for reachability +Some websites that can provide a generic way to check are: +- https://www.portcheckers.com/ +- https://portchecker.co/check + +Also, there is a tool hosted by Madiator, a community member, which can properly check if the correct protocols are exposed. Sometimes the mapping works for TCP but not UDP or the other way around and this tool can identify which one is broken. +- To test for UDP (DHT): http://test.madiator.com:60666/dht/ +- To test for TCP (P2P): http://test.madiator.com:60666/p2p/ + +As a last resource, if you need to test a remote machine, from a local SDK try: +```bash +lbrynet peer ping +``` + +To find out what the `DHT node id` is, on the target machine run `lbrynet status` and look for `node_id` . + +## Content blobs storage settings + +Files in LBRY are composed by `content blobs`, which can be seen as chunks of binary encrypted data belonging to some content. By default, the SDK enables saving blobs to disk, which then can be served over P2P. To check if that is enabled, look for the `save_blobs` setting. + +**The following settings are isolated. The space limit set for one does not apply to the other.** + +### Setting up storage space control + +By default, content blobs are kept indefinitely as long as the files are still in your SDK. If you wish to allocate a space limit for content blobs and let the SDK decide what to delete, set `blob_storage_limit` to a value in megabytes. + +This won't delete your downloads from the file list. Instead, it deletes content blobs associated with older files as space for newer blobs is requested. + + +### Setting up space for automatic contribution + +This section is aimed at fully automatic contribution in background. Normal usage of the SDK with P2P enabled already helps the network, but requires interaction. + +LBRY SDK can be configured to help the P2P network by automatically downloading and hosting content. This is ideal for contributing spare disk space and network bandwidth without further interaction. + +Enabling: change `network_storage_limit` to the size (in megabytes) that will be used for automatic seeding. + +Disabling: setting the space to 0 disables it. The space used will eventually be released automatically. For cleaning immediately, issue a `lbrynet blob clean` from command line. From 9b5c92a7225f0e2bbfca5923fd71270d493c27ba Mon Sep 17 00:00:00 2001 From: Victor Shyba Date: Thu, 19 May 2022 18:19:30 -0300 Subject: [PATCH 2/4] add wiki reference on hole punching --- documents/resources/p2p-seeding.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/documents/resources/p2p-seeding.md b/documents/resources/p2p-seeding.md index d65ca40..8a4ec7f 100644 --- a/documents/resources/p2p-seeding.md +++ b/documents/resources/p2p-seeding.md @@ -13,7 +13,7 @@ This document aims to explain P2P configuration and troubleshooting from small t The first priority when seeding content is making sure there is a way for other nodes to reach you across the internet. ### Figuring out your ports -In order to troubleshoot reachability, we start by checking your configuration for the UDP and TCP ports. By default, they will both be set to 4444. Those can be found on the configuration under the keys `udp_port` and `tcp_port`. Please set them both to the same value as this helps holepunching and ease of management. +In order to troubleshoot reachability, we start by checking your configuration for the UDP and TCP ports. By default, they will both be set to 4444. Those can be found on the configuration under the keys `udp_port` and `tcp_port`. Please set them both to the same value as this helps connectivity trough [hole punching](https://en.wikipedia.org/wiki/Hole_punching_(networking)) and ease of management. ### Checking for reachability Some websites that can provide a generic way to check are: From dbb050baa0dcb311b2370a3a9b4e2d7a85e53259 Mon Sep 17 00:00:00 2001 From: Victor Shyba Date: Thu, 19 May 2022 18:46:14 -0300 Subject: [PATCH 3/4] improve reachability text --- documents/resources/p2p-seeding.md | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/documents/resources/p2p-seeding.md b/documents/resources/p2p-seeding.md index 8a4ec7f..b956272 100644 --- a/documents/resources/p2p-seeding.md +++ b/documents/resources/p2p-seeding.md @@ -16,21 +16,31 @@ The first priority when seeding content is making sure there is a way for other In order to troubleshoot reachability, we start by checking your configuration for the UDP and TCP ports. By default, they will both be set to 4444. Those can be found on the configuration under the keys `udp_port` and `tcp_port`. Please set them both to the same value as this helps connectivity trough [hole punching](https://en.wikipedia.org/wiki/Hole_punching_(networking)) and ease of management. ### Checking for reachability -Some websites that can provide a generic way to check are: +There are some websites providing generic ways to check ports, like: - https://www.portcheckers.com/ - https://portchecker.co/check -Also, there is a tool hosted by Madiator, a community member, which can properly check if the correct protocols are exposed. Sometimes the mapping works for TCP but not UDP or the other way around and this tool can identify which one is broken. +However, checking the port does not check if LBRY P2P protocol is working behind it. For a better check, we can use a tool hosted by Madiator, a community member. - To test for UDP (DHT): http://test.madiator.com:60666/dht/ - To test for TCP (P2P): http://test.madiator.com:60666/p2p/ -As a last resource, if you need to test a remote machine, from a local SDK try: +As a last resource to test a remote machine DHT service, from a local SDK try: ```bash lbrynet peer ping ``` To find out what the `DHT node id` is, on the target machine run `lbrynet status` and look for `node_id` . +### I am unreachable. What now? + +VPN users: check with your provider if they feature port forwarding. There are guides specific to each one, like [this one from Mullvad](https://mullvad.net/en/help/port-forwarding-and-mullvad/). + +Domestic routers: there are websites like [this one](https://portforward.com/how-to-port-forward/) providing information on popular router models. Unfortunately, this document would be huge if we added port forwarding instructions for every router/firewall. + +Servers: check if your firewall is blocking the SDK ports. For ufw on Linux, this is `sudo ufw allow `. + +If you still have trouble figuring that out, don't be shy, [ask the LBRY community on Discord!](https://chat.lbry.com/) + ## Content blobs storage settings Files in LBRY are composed by `content blobs`, which can be seen as chunks of binary encrypted data belonging to some content. By default, the SDK enables saving blobs to disk, which then can be served over P2P. To check if that is enabled, look for the `save_blobs` setting. From 3d2139472851ebfabae1f586994cbc4a5f804e92 Mon Sep 17 00:00:00 2001 From: Victor Shyba Date: Thu, 19 May 2022 18:49:34 -0300 Subject: [PATCH 4/4] refactor confusing paragraph --- documents/resources/p2p-seeding.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/documents/resources/p2p-seeding.md b/documents/resources/p2p-seeding.md index b956272..f4bba56 100644 --- a/documents/resources/p2p-seeding.md +++ b/documents/resources/p2p-seeding.md @@ -49,7 +49,7 @@ Files in LBRY are composed by `content blobs`, which can be seen as chunks of bi ### Setting up storage space control -By default, content blobs are kept indefinitely as long as the files are still in your SDK. If you wish to allocate a space limit for content blobs and let the SDK decide what to delete, set `blob_storage_limit` to a value in megabytes. +By default, content blobs are kept as long as the files are still in your file list. If you wish to allocate a space limit for content blobs and let the SDK decide what to delete, set `blob_storage_limit` to a value in megabytes. This won't delete your downloads from the file list. Instead, it deletes content blobs associated with older files as space for newer blobs is requested.