'Setup various variables.'

@blocking_call_on_reactor_thread
@inlineCallbacks
def setUp(self, autoload_discovery=True):

    os.environ[BOOTSTRAP_FILE_ENVNAME] = os.path.join(TESTS_DATA_DIR, 'bootstrap_empty.txt')
    (yield TestAsServer.setUp(self, autoload_discovery=autoload_discovery))
    self.sessions = []
    self.eccrypto = ECCrypto()
    ec = self.eccrypto.generate_key(u'curve25519')
    MarketCommunityTests.master_key = self.eccrypto.key_to_bin(ec.pub()).encode('hex')
    ec = self.eccrypto.generate_key(u'curve25519')
    TriblerChainCommunityTests.master_key = self.eccrypto.key_to_bin(ec.pub()).encode('hex')
    ec = self.eccrypto.generate_key(u'curve25519')
    TradeChainCommunityTests.master_key = self.eccrypto.key_to_bin(ec.pub()).encode('hex')
    market_member = self.generate_member(self.session)
    self.market_communities = {}
    mc_community = self.load_triblerchain_community_in_session(self.session)
    self.load_market_community_in_session(self.session, market_member, mc_community)
