def testAddIntrospection(self):
        """A 'system' subhandler is added."""
        server = jsonrpc.RPCFactory(TestRPC)
        server.addIntrospection()

        self.assertTrue('system' in server.subHandlers)
        system = server.subHandlers['system']
        self.assertEqual(Introspection, system[0])
Beispiel #2
0
 def setUp(self):
     self.p = reactor.listenTCP(0, jsonrpc.RPCFactory(Test),
                                interface="127.0.0.1")
     self.port = self.p.getHost().port
Beispiel #3
0
 def setUp(self):
     server = jsonrpc.RPCFactory(Test)
     server.addIntrospection()
     self.p = reactor.listenTCP(0, server, interface="127.0.0.1")
     self.port = self.p.getHost().port
Beispiel #4
0
        kserver.querySeed("162.213.253.147:8080",
                          "5b56c8daeb3b37c8a9b47be6102fa43b9f069f58dcb57475984041b26c99e389"))\
        .addCallback(on_bootstrap_complete)

kserver.saveStateRegularly(DATA_FOLDER + 'cache.pickle', 10)
protocol.register_processor(kserver.protocol)

# market
mserver = network.Server(kserver, keys.signing_key)
mserver.protocol.connect_multiplexer(protocol)
protocol.register_processor(mserver.protocol)

reactor.listenUDP(port, protocol)

# json-rpc server
factory = jsonrpc.RPCFactory(RPCCalls(kserver, mserver, keys))
reactor.listenTCP(18465, factory, interface="127.0.0.1")

# web sockets
ws_factory = WSFactory("ws://127.0.0.1:18466", mserver, kserver)
ws_factory.protocol = WSProtocol
ws_factory.setProtocolOptions(allowHixie76=True)
listenWS(ws_factory)
webdir = File(".")
web = Site(webdir)
reactor.listenTCP(9000, web, interface="127.0.0.1")

# rest api
api = OpenBazaarAPI(mserver, kserver)
site = Site(api, timeout=None)
reactor.listenTCP(18469, site, interface="127.0.0.1")