X-Git-Url: https://git.novaco.in/?p=electrum-server.git;a=blobdiff_plain;f=server.py;h=d41bcf35e4af8362455304eb527a67527b60ae5b;hp=927e62de7b4febe551610010dd4b27818612a98a;hb=4ce69b7ea24ead59ebbcc7ed335ea9762ae3724b;hpb=c9c337a89a3f04d7a985a521ca552d421fd94fda diff --git a/server.py b/server.py index 927e62d..d41bcf3 100755 --- a/server.py +++ b/server.py @@ -48,22 +48,25 @@ def create_config(): config.set('server', 'report_host', '') config.set('server', 'stratum_tcp_port', '50001') config.set('server', 'stratum_http_port', '8081') - config.set('server', 'stratum_tcp_ssl_port', '50002') - config.set('server', 'stratum_http_ssl_port', '8082') + config.set('server', 'stratum_tcp_ssl_port', '') + config.set('server', 'stratum_http_ssl_port', '') config.set('server', 'report_stratum_tcp_port', '') config.set('server', 'report_stratum_http_port', '') config.set('server', 'report_stratum_tcp_ssl_port', '') config.set('server', 'report_stratum_http_ssl_port', '') + config.set('server', 'ssl_certfile', '') + config.set('server', 'ssl_keyfile', '') config.set('server', 'password', '') config.set('server', 'irc', 'yes') config.set('server', 'irc_nick', '') config.set('server', 'coin', '') config.set('server', 'datadir', '') - config.add_section('database') - config.set('database', 'type', 'psycopg2') - config.set('database', 'database', 'abe') - config.set('database', 'limit', '1000') - config.set('server', 'backend', 'abe') + + # use leveldb as default + config.set('server', 'backend', 'leveldb') + config.add_section('leveldb') + config.set('leveldb', 'path', '/dev/shm/electrum_db') + config.set('leveldb', 'pruning_limit', '100') for path in ('/etc/', ''): filename = path + 'electrum.conf' @@ -87,11 +90,16 @@ def run_rpc_command(command, stratum_tcp_port): return method = 'server.' + command - request = json.dumps({'id': 0, 'method': method, 'params': [password]}) + params = [password] + if len(sys.argv) > 2: + params.append(sys.argv[2]) + + request = json.dumps({'id': 0, 'method': method, 'params': params}) s.send(request + '\n') msg = '' while True: o = s.recv(1024) + if not o: break msg += o if msg.find('\n') != -1: break @@ -100,9 +108,9 @@ def run_rpc_command(command, stratum_tcp_port): if command == 'info': now = time.time() - print 'type address sub version time' + print 'type address sub version time' for item in r: - print '%4s %15s %3s %7s %.2f' % (item.get('name'), + print '%4s %21s %3s %7s %.2f' % (item.get('name'), item.get('address'), item.get('subscriptions'), item.get('version'), @@ -134,9 +142,7 @@ if __name__ == '__main__': from backends.irc import ServerProcessor backend_name = config.get('server', 'backend') - if backend_name == 'abe': - from backends.abe import BlockchainProcessor - elif backend_name == 'libbitcoin': + if backend_name == 'libbitcoin': from backends.libbitcoin import BlockchainProcessor elif backend_name == 'leveldb': from backends.bitcoind import BlockchainProcessor