mitchellolsthoorn / tribler

Privacy with BitTorrent and resilient to shut down
http://www.tribler.org
GNU Lesser General Public License v3.0
1 stars 1 forks source link

Market Community cannot be initialized. #34

Closed StefanBoodt closed 8 years ago

StefanBoodt commented 8 years ago

Please, fill all relevant items:

Tribler feature/market

Operating system and version:

Ubuntu 14.04

Expected behavior:

Tribler community starts.

Actual behavior:

TypeException is thrown.

Steps to reproduce the behavior:

It goes wrong as follows:

from twisted.internet.threads import blockingCallFromThread from Tribler.Core.Utilities.twisted_thread import reactor from Tribler.community.market.community import MarketCommunity

def start_market_community(): """This will start the market community, do not forget to start this in a seperate thread.""" keypair = self.dispersy.crypto.generate_key(u"curve25519") member = self.dispersy.get_member(private_key=self.dispersy.crypto.key_to_bin(keypair)) cls = MarketCommunity self.market_community = self.dispersy.define_auto_load(cls, member, (self.session, self.settings), load=True)[0]

blockingCallFromThread(reactor, start_market_community)

Relevant log file output:

File "ExitNode.py", line 207, in start blockingCallFromThread(reactor, start_market_community) File "/usr/lib/python2.7/dist-packages/twisted/internet/threads.py", line 122, in blockingCallFromThread result.raiseException() File "", line 2, in raiseException TypeError: initialize() takes exactly 1 argument (3 given)

Reason of it going wrong:

Dispersy create community calls initialize with 3 arguments. It specifies initialize as

def initialize(self, _args, *_kwargs) for subclasses.

mitchellolsthoorn commented 8 years ago

That is because you're giving it three arguments, dispersy itself only accepts one (the class). So you should remove the arguments (self.session, self.settings), because the community doesn't use these. We do need the multichain community, so that should be the second argument

StefanBoodt commented 8 years ago

We already started that community. I shall check again.