'Load a custom instance of the TriblerChain community in a given session.'

@blocking_call_on_reactor_thread
def load_triblerchain_community_in_session(self, session):

    dispersy = session.get_dispersy_instance()
    keypair = dispersy.crypto.generate_key(u'curve25519')
    dispersy_member = dispersy.get_member(private_key=dispersy.crypto.key_to_bin(keypair))
    triblerchain_kwargs = {'tribler_session': session}
    return dispersy.define_auto_load(TriblerChainCommunityTests, dispersy_member, load=True, kargs=triblerchain_kwargs)[0]
