示例#1
0
 def __init__(self, app):
     BaseService.__init__(self, app)
     assert self.app.config['data_dir']
     self.uncommitted = dict()
     self.stop_event = Event()
     dbfile = os.path.join(self.app.config['data_dir'], 'leveldb')
     LevelDB.__init__(self, dbfile)
示例#2
0
 def __init__(self, app):
     BaseService.__init__(self, app)
     assert self.app.config['node']['data_dir']
     self.uncommitted = dict()
     self.stop_event = Event()
     dbfile = os.path.join(self.app.config['node']['data_dir'], 'leveldb')
     LevelDB.__init__(self, dbfile)
    def __init__(self, app):
        assert app.config['data_dir']

        BaseService.__init__(self, app)

        db_directory = os.path.join(app.config['data_dir'], 'lmdb')

        self.env = lmdb.Environment(db_directory, map_size=TB)
        self.db_directory = db_directory
        self.uncommitted = dict()
        self.stop_event = Event()
示例#4
0
文件: jsonrpc.py 项目: youzg/pyethapp
    def __init__(self, app):
        log.debug('initializing JSONRPCServer')
        BaseService.__init__(self, app)
        self.app = app

        self.dispatcher = LoggingDispatcher()
        # register sub dispatchers
        for subdispatcher in self.subdispatcher_classes():
            subdispatcher.register(self)

        transport = WsgiServerTransport(queue_class=gevent.queue.Queue)
        # start wsgi server as a background-greenlet
        self.listen_port = app.config['jsonrpc']['listen_port']
        self.listen_host = app.config['jsonrpc']['listen_host']
        self.wsgi_server = gevent.wsgi.WSGIServer(
            (self.listen_host, self.listen_port),
            transport.handle,
            log=WSGIServerLogger)
        self.rpc_server = RPCServerGreenlets(transport, JSONRPCProtocol(),
                                             self.dispatcher)
        self.default_block = 'latest'
示例#5
0
    def __init__(self, app):
        log.debug('initializing JSONRPCServer')
        BaseService.__init__(self, app)
        self.app = app

        self.dispatcher = LoggingDispatcher()
        # register sub dispatchers
        for subdispatcher in self.subdispatcher_classes():
            subdispatcher.register(self)

        transport = WsgiServerTransport(queue_class=gevent.queue.Queue)
        # start wsgi server as a background-greenlet
        self.listen_port = app.config['jsonrpc']['listen_port']
        self.listen_host = app.config['jsonrpc']['listen_host']
        self.wsgi_server = gevent.wsgi.WSGIServer((self.listen_host, self.listen_port),
                                                  transport.handle, log=WSGIServerLogger)
        self.rpc_server = RPCServerGreenlets(
            transport,
            JSONRPCProtocol(),
            self.dispatcher
        )
        self.default_block = 'latest'
 def __init__(self, app):
     BaseService.__init__(self, app)
     _EphemDB.__init__(self)
     self.stop_event = Event()