remove unused settings and constants
This commit is contained in:
parent
f6e7700c4c
commit
4a11cf007f
3 changed files with 4 additions and 56 deletions
|
@ -16,29 +16,11 @@ log = logging.getLogger(__name__)
|
||||||
NOT_SET = type(str('NOT_SET'), (object,), {})
|
NOT_SET = type(str('NOT_SET'), (object,), {})
|
||||||
T = typing.TypeVar('T')
|
T = typing.TypeVar('T')
|
||||||
|
|
||||||
KB = 2 ** 10
|
|
||||||
MB = 2 ** 20
|
|
||||||
|
|
||||||
ANALYTICS_ENDPOINT = 'https://api.segment.io/v1'
|
|
||||||
ANALYTICS_TOKEN = 'Ax5LZzR1o3q3Z3WjATASDwR5rKyHH0qOIRIbLmMXn2H='
|
|
||||||
API_ADDRESS = 'lbryapi'
|
|
||||||
APP_NAME = 'LBRY'
|
|
||||||
BLOBFILES_DIR = 'blobfiles'
|
|
||||||
CRYPTSD_FILE_EXTENSION = '.cryptsd'
|
|
||||||
CURRENCIES = {
|
CURRENCIES = {
|
||||||
'BTC': {'type': 'crypto'},
|
'BTC': {'type': 'crypto'},
|
||||||
'LBC': {'type': 'crypto'},
|
'LBC': {'type': 'crypto'},
|
||||||
'USD': {'type': 'fiat'},
|
'USD': {'type': 'fiat'},
|
||||||
}
|
}
|
||||||
ICON_PATH = 'icons' if 'win' in sys.platform else 'app.icns'
|
|
||||||
LOG_FILE_NAME = 'lbrynet.log'
|
|
||||||
LOG_POST_URL = 'https://lbry.io/log-upload'
|
|
||||||
MAX_BLOB_REQUEST_SIZE = 64 * KB
|
|
||||||
MAX_HANDSHAKE_SIZE = 64 * KB
|
|
||||||
MAX_REQUEST_SIZE = 64 * KB
|
|
||||||
MAX_RESPONSE_INFO_SIZE = 64 * KB
|
|
||||||
MAX_BLOB_INFOS_TO_REQUEST = 20
|
|
||||||
PROTOCOL_PREFIX = 'lbry'
|
|
||||||
SLACK_WEBHOOK = (
|
SLACK_WEBHOOK = (
|
||||||
'nUE0pUZ6Yl9bo29epl5moTSwnl5wo20ip2IlqzywMKZiIQSFZR5'
|
'nUE0pUZ6Yl9bo29epl5moTSwnl5wo20ip2IlqzywMKZiIQSFZR5'
|
||||||
'AHx4mY0VmF0WQZ1ESEP9kMHZlp1WzJwWOoKN3ImR1M2yUAaMyqGZ='
|
'AHx4mY0VmF0WQZ1ESEP9kMHZlp1WzJwWOoKN3ImR1M2yUAaMyqGZ='
|
||||||
|
@ -471,7 +453,6 @@ class CLIConfig(BaseConfig):
|
||||||
|
|
||||||
|
|
||||||
class Config(CLIConfig):
|
class Config(CLIConfig):
|
||||||
|
|
||||||
data_dir = Path("Directory path to store blobs.", metavar='DIR')
|
data_dir = Path("Directory path to store blobs.", metavar='DIR')
|
||||||
download_dir = Path(
|
download_dir = Path(
|
||||||
"Directory path to place assembled files downloaded from LBRY.",
|
"Directory path to place assembled files downloaded from LBRY.",
|
||||||
|
@ -486,20 +467,12 @@ class Config(CLIConfig):
|
||||||
"Whether to share usage stats and diagnostic info with LBRY.", True,
|
"Whether to share usage stats and diagnostic info with LBRY.", True,
|
||||||
previous_names=['upload_log', 'upload_log', 'share_debug_info']
|
previous_names=['upload_log', 'upload_log', 'share_debug_info']
|
||||||
)
|
)
|
||||||
|
|
||||||
# claims set to expire within this many blocks will be
|
|
||||||
# automatically renewed after startup (if set to 0, renews
|
|
||||||
# will not be made automatically)
|
|
||||||
auto_renew_claim_height_delta = Integer("", 0)
|
|
||||||
cache_time = Integer("", 150)
|
cache_time = Integer("", 150)
|
||||||
data_rate = Float("points/megabyte", .0001)
|
|
||||||
delete_blobs_on_remove = Toggle("", True)
|
|
||||||
dht_node_port = Integer("", 4444)
|
dht_node_port = Integer("", 4444)
|
||||||
download_timeout = Float("", 30.0)
|
download_timeout = Float("", 30.0)
|
||||||
blob_download_timeout = Float("", 20.0)
|
blob_download_timeout = Float("", 20.0)
|
||||||
peer_connect_timeout = Float("", 3.0)
|
peer_connect_timeout = Float("", 3.0)
|
||||||
node_rpc_timeout = Float("", constants.rpc_timeout)
|
node_rpc_timeout = Float("", constants.rpc_timeout)
|
||||||
is_generous_host = Toggle("", True)
|
|
||||||
announce_head_blobs_only = Toggle("", True)
|
announce_head_blobs_only = Toggle("", True)
|
||||||
concurrent_announcers = Integer("", 10)
|
concurrent_announcers = Integer("", 10)
|
||||||
known_dht_nodes = Servers("", [
|
known_dht_nodes = Servers("", [
|
||||||
|
@ -509,26 +482,15 @@ class Config(CLIConfig):
|
||||||
('lbrynet4.lbry.io', 4444) # ASIA
|
('lbrynet4.lbry.io', 4444) # ASIA
|
||||||
])
|
])
|
||||||
max_connections_per_stream = Integer("", 5)
|
max_connections_per_stream = Integer("", 5)
|
||||||
seek_head_blob_first = Toggle("", True)
|
|
||||||
max_key_fee = MaxKeyFee("", {'currency': 'USD', 'amount': 50.0})
|
max_key_fee = MaxKeyFee("", {'currency': 'USD', 'amount': 50.0})
|
||||||
min_info_rate = Float("points/1000 infos", .02)
|
|
||||||
min_valuable_hash_rate = Float("points/1000 infos", .05)
|
|
||||||
min_valuable_info_rate = Float("points/1000 infos", .05)
|
|
||||||
peer_port = Integer("", 3333)
|
peer_port = Integer("", 3333)
|
||||||
pointtrader_server = String("", 'http://127.0.0.1:2424')
|
|
||||||
reflector_port = Integer("", 5566)
|
|
||||||
# if reflect_uploads is True, send files to reflector after publishing (as well as a periodic check in the
|
# if reflect_uploads is True, send files to reflector after publishing (as well as a periodic check in the
|
||||||
# event the initial upload failed or was disconnected part way through, provided the auto_re_reflect_interval > 0)
|
# event the initial upload failed or was disconnected part way through, provided the auto_re_reflect_interval > 0)
|
||||||
reflect_uploads = Toggle("", True)
|
reflect_uploads = Toggle("", True)
|
||||||
auto_re_reflect_interval = Integer("set to 0 to disable", 86400)
|
|
||||||
reflector_servers = Servers("", [
|
reflector_servers = Servers("", [
|
||||||
('reflector.lbry.io', 5566)
|
('reflector.lbry.io', 5566)
|
||||||
])
|
])
|
||||||
run_reflector_server = Toggle("adds reflector to components_to_skip unless True", False)
|
|
||||||
sd_download_timeout = Integer("", 3)
|
|
||||||
peer_search_timeout = Integer("", 60)
|
|
||||||
use_upnp = Toggle("", True)
|
use_upnp = Toggle("", True)
|
||||||
use_keyring = Toggle("", False)
|
|
||||||
blockchain_name = String("", 'lbrycrd_main')
|
blockchain_name = String("", 'lbrycrd_main')
|
||||||
lbryum_servers = Servers("", [
|
lbryum_servers = Servers("", [
|
||||||
('lbryumx1.lbry.io', 50001),
|
('lbryumx1.lbry.io', 50001),
|
||||||
|
|
|
@ -5,9 +5,12 @@ import logging
|
||||||
import aiohttp
|
import aiohttp
|
||||||
|
|
||||||
from lbrynet import utils
|
from lbrynet import utils
|
||||||
from lbrynet.conf import Config, ANALYTICS_ENDPOINT, ANALYTICS_TOKEN
|
from lbrynet.conf import Config
|
||||||
from lbrynet.extras import system_info
|
from lbrynet.extras import system_info
|
||||||
|
|
||||||
|
ANALYTICS_ENDPOINT = 'https://api.segment.io/v1'
|
||||||
|
ANALYTICS_TOKEN = 'Ax5LZzR1o3q3Z3WjATASDwR5rKyHH0qOIRIbLmMXn2H='
|
||||||
|
|
||||||
# Things We Track
|
# Things We Track
|
||||||
SERVER_STARTUP = 'Server Startup'
|
SERVER_STARTUP = 'Server Startup'
|
||||||
SERVER_STARTUP_SUCCESS = 'Server Startup Success'
|
SERVER_STARTUP_SUCCESS = 'Server Startup Success'
|
||||||
|
|
|
@ -84,15 +84,6 @@ class TestCostEst(unittest.TestCase):
|
||||||
result = yield f2d(daemon.get_est_cost("test", size))
|
result = yield f2d(daemon.get_est_cost("test", size))
|
||||||
self.assertEqual(result, correct_result)
|
self.assertEqual(result, correct_result)
|
||||||
|
|
||||||
def test_fee_and_ungenerous_data(self):
|
|
||||||
conf = Config(is_generous_host=False)
|
|
||||||
size = 10000000
|
|
||||||
fake_fee_amount = 4.5
|
|
||||||
correct_result = size / 10 ** 6 * conf.data_rate + fake_fee_amount
|
|
||||||
daemon = get_test_daemon(conf, with_fee=True)
|
|
||||||
result = yield f2d(daemon.get_est_cost("test", size))
|
|
||||||
self.assertEqual(result, round(correct_result, 1))
|
|
||||||
|
|
||||||
def test_generous_data_and_no_fee(self):
|
def test_generous_data_and_no_fee(self):
|
||||||
size = 10000000
|
size = 10000000
|
||||||
correct_result = 0.0
|
correct_result = 0.0
|
||||||
|
@ -100,14 +91,6 @@ class TestCostEst(unittest.TestCase):
|
||||||
result = yield f2d(daemon.get_est_cost("test", size))
|
result = yield f2d(daemon.get_est_cost("test", size))
|
||||||
self.assertEqual(result, correct_result)
|
self.assertEqual(result, correct_result)
|
||||||
|
|
||||||
def test_ungenerous_data_and_no_fee(self):
|
|
||||||
conf = Config(is_generous_host=False)
|
|
||||||
size = 10000000
|
|
||||||
correct_result = size / 10 ** 6 * conf.data_rate
|
|
||||||
daemon = get_test_daemon(conf)
|
|
||||||
result = yield f2d(daemon.get_est_cost("test", size))
|
|
||||||
self.assertEqual(result, round(correct_result, 1))
|
|
||||||
|
|
||||||
|
|
||||||
@unittest.SkipTest
|
@unittest.SkipTest
|
||||||
class TestJsonRpc(unittest.TestCase):
|
class TestJsonRpc(unittest.TestCase):
|
||||||
|
|
Loading…
Add table
Reference in a new issue