Skip to content

Commit

Permalink
Remove CreditMining feature
Browse files Browse the repository at this point in the history
  • Loading branch information
ichorid committed Jun 3, 2020
1 parent 76b0de1 commit 10385c4
Show file tree
Hide file tree
Showing 43 changed files with 201 additions and 2,917 deletions.
2 changes: 0 additions & 2 deletions src/tribler-common/tribler_common/simpledefs.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,6 @@
STATE_START_TORRENT_CHECKER = 'Starting torrent checker...'
STATE_START_API_ENDPOINTS = 'Starting API endpoints...'
STATE_START_WATCH_FOLDER = 'Starting watch folder...'
STATE_START_CREDIT_MINING = 'Starting credit mining...'
STATE_START_RESOURCE_MONITOR = 'Starting resource monitor...'
STATE_READABLE_STARTED = 'Started'

Expand All @@ -98,7 +97,6 @@ class NTFY(Enum):
UPGRADER_STARTED = "upgrader_started"
UPGRADER_DONE = "upgrader_done"
CHANNEL_ENTITY_UPDATED = "channel_entity_updated"
CREDIT_MINING_ERROR = "credit_mining_error"
LOW_SPACE = "low_space"
EVENTS_START = "events_start"
TRIBLER_EXCEPTION = "tribler_exception"
1 change: 0 additions & 1 deletion src/tribler-core/run_market_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ async def signal_handler(sig):
config.set_torrent_checking_enabled(False)
config.set_libtorrent_enabled(True)
config.set_http_api_enabled(True)
config.set_credit_mining_enabled(False)
config.set_dummy_wallets_enabled(True)
config.set_popularity_community_enabled(False)
config.set_chant_enabled(False)
Expand Down
1 change: 0 additions & 1 deletion src/tribler-core/run_tunnel_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,6 @@ async def start(self, options):
config.set_ipv8_port(ipv8_port)
config.set_ipv8_address(options.ipv8_address)
config.set_trustchain_enabled(True)
config.set_credit_mining_enabled(False)
config.set_market_community_enabled(False)
config.set_dht_enabled(True)
config.set_tunnel_community_exitnode_enabled(bool(options.exit))
Expand Down
16 changes: 0 additions & 16 deletions src/tribler-core/tribler_core/config/test_tribler_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,11 +78,6 @@ def test_tunnel_community_socks5_listen_ports(self):
self.tribler_config.set_tunnel_community_socks5_listen_ports(ports)
self.assertListEqual(self.tribler_config.get_tunnel_community_socks5_listen_ports(), ports)

def test_credit_mining_sources(self):
source_list = "listitem"
self.tribler_config.set_credit_mining_sources(source_list)
self.assertEqual(self.tribler_config.get_credit_mining_sources(), source_list)

def test_bootstrap_configs(self):

self.tribler_config.set_bootstrap_enabled(False)
Expand Down Expand Up @@ -283,17 +278,6 @@ def test_get_set_methods_resource_monitor(self):
self.tribler_config.set_cpu_priority_order(3)
self.assertEqual(self.tribler_config.get_cpu_priority_order(), 3)

def test_get_set_methods_credit_mining(self):
"""
Check whether credit mining get and set methods are working as expected.
"""
self.tribler_config.set_credit_mining_enabled(True)
self.assertEqual(self.tribler_config.get_credit_mining_enabled(), True)
self.tribler_config.set_credit_mining_sources(True)
self.assertEqual(self.tribler_config.get_credit_mining_sources(), True)
self.tribler_config.set_credit_mining_disk_space(1024 ** 2)
self.assertEqual(self.tribler_config.get_credit_mining_disk_space(), 1024 ** 2)

def test_get_set_methods_dht(self):
"""
Check whether dht get and set methods are working as expected.
Expand Down
19 changes: 0 additions & 19 deletions src/tribler-core/tribler_core/config/tribler_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -594,22 +594,3 @@ def set_resource_monitor_history_size(self, value):

def get_resource_monitor_history_size(self):
return self.config['resource_monitor']['history_size']

# Credit mining
def set_credit_mining_enabled(self, value):
self.config['credit_mining']['enabled'] = value

def get_credit_mining_enabled(self):
return self.config['credit_mining']['enabled']

def set_credit_mining_sources(self, source_list):
self.config['credit_mining']['sources'] = source_list

def get_credit_mining_sources(self):
return self.config['credit_mining']['sources']

def set_credit_mining_disk_space(self, value):
self.config['credit_mining']['max_disk_space'] = value

def get_credit_mining_disk_space(self):
return self.config['credit_mining']['max_disk_space']
5 changes: 0 additions & 5 deletions src/tribler-core/tribler_core/config/tribler_config.spec
Original file line number Diff line number Diff line change
Expand Up @@ -99,11 +99,6 @@ cpu_priority = integer(min=0, max=5, default=1)
poll_interval = integer(min=1, default=5)
history_size = integer(min=1, default=20)

[credit_mining]
enabled = boolean(default=False)
sources = string_list(default=list())
max_disk_space = integer(min=0, default=53687091200)

[popularity_community]
enabled = boolean(default=True)
cache_dir = string(default=health_cache)
12 changes: 1 addition & 11 deletions src/tribler-core/tribler_core/logger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ loggers:
propagate: no
asyncio:
level: DEBUG
level: INFO
handlers: [console, error_console, info_memory_handler, error_memory_handler]
propagate: no
Expand All @@ -99,16 +99,6 @@ loggers:
handlers: [console, error_console, info_memory_handler, error_memory_handler]
propagate: no
CreditMiningManager:
level: INFO
handlers: [console, error_console, info_memory_handler, error_memory_handler]
propagate: no
CreditMiningSource:
level: INFO
handlers: [console, error_console, info_memory_handler, error_memory_handler]
propagate: no
TrustChainDB:
level: INFO
handlers: [console, error_console, info_memory_handler, error_memory_handler]
Expand Down

This file was deleted.

Loading

0 comments on commit 10385c4

Please sign in to comment.