Coder Social home page Coder Social logo

electrum-server's People

Contributors

admin-slush avatar bauerj avatar bitfoo avatar blinkystitt avatar coblee avatar coinx-ltc avatar colindean avatar digitalhermit avatar ecdsa avatar erasmospunk avatar gits7r avatar jkozera avatar justintarthur avatar knocte avatar laodc avatar luke-jr avatar lvets avatar mirobit avatar mlapaglia avatar overlordq avatar ovidiusoft avatar pastly avatar pooler avatar red-coracle avatar renepickhardt avatar ryanjohns avatar shsmith avatar sombernight avatar theblazehen avatar wozz avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

electrum-server's Issues

Server crash after restart while reorganizes the blockchain

This is a very rare bug and it only happened in testnet so far.

The server crashed due to issue #57, then I restarted and saw a message that it was doing a reorg, I wanted to test something so I closed the server. After it started again, an assertion failed in blockchain_processor.py in the function init_headers:

assert prev_hash == header.get('prev_block_hash')

I investigated and the prev_hash was the hash of the orphaned block, so it makes sense that it fails.

Tried to fix it by replacing the assert with:

if prev_hash != header.get('prev_block_hash'):
    # The header in file seems to be orphaned, go back
    height -= 2
    prev_hash = self.hash_header(self.read_header(height))
    continue

and it seems to work but I would like your feedback on the matter.

OpenSSL Python Module required even when SSL is turned off in the config

[10/04/2013-13:58:19] blockchain is up to date.
Traceback (most recent call last):
File "/home/electrum/bin/electrum", line 177, in
from transports.stratum_http import HttpServer
File "/home/electrum/src/electrum/server/transports/stratum_http.py", line 42, in
from OpenSSL import SSL
ImportError: No module named OpenSSL
[10/04/2013-13:58:36] blockchain: 230650 (0.030s)

Logging

So print_log doesn't seem to release the lock properly.

Is there any reason the standard logging module isn't being used. It's highly configurable and dead simple to use. It also works fine with threads.

AttributeError: 'Storage' object has no attribute 'db_utxo'

Hi,

I've installed Electrum server following the HOWTO file, but I'm encountering a few problems.

Problem number 1 : When executing electrum-server start as root I get the following :

root@BashTestUbuntu:~# electrum-server start 
/usr/lib/python2.7/dist-packages/pkg_resources.py:1031: UserWarning: /home/bitcoin/.python-eggs is writable by group/others and vulnerable to attack when used with get_resource_filename. Consider a more secure location (set with .set_extraction_path or the PYTHON_EGG_CACHE environment variable).
warnings.warn(msg, UserWarning)
Starting server as daemon
bash: line 0: ulimit: open files: cannot modify limit: Operation not permitted
nohup: redirecting stderr to stdout`

Then it just exits. Why try to apply the ulimit as the user specified in the configuration file ? By default only root can set the ulimit so of course it will spew up an error.

Problem number 2 : When executing run_electrum_server directly as the user specified in the configuration file I get the following :

bitcoin@BashTestUbuntu:/root$ run_electrum_server
/usr/lib/python2.7/dist-packages/pkg_resources.py:1031: UserWarning: /home/bitcoin/.python-eggs is writable by group/others and vulnerable to attack when used with get_resource_filename. Consider a more secure location (set with .set_extraction_path or the PYTHON_EGG_CACHE environment variable).
warnings.warn(msg, UserWarning)
INFO:electrum:Starting Electrum server on localhost
ERROR:electrum:db init
Traceback (most recent call last):
File "build/bdist.linux-x86_64/egg/electrumserver/storage.py", line 35, in __init__
self.db_utxo = plyvel.DB(os.path.join(self.dbpath,'utxo'), create_if_missing=True, compression=None)
File "_plyvel.pyx", line 236, in plyvel._plyvel.DB.__init__ (plyvel/_plyvel.cpp:3129)
File "_plyvel.pyx", line 80, in plyvel._plyvel.raise_for_status (plyvel/_plyvel.cpp:1698)
IOError: IO error: /var/electrum-server/utxo/LOCK: No such file or directory
INFO:electrum:Stopping Stratum
INFO:electrum:initializing database
Traceback (most recent call last):
File "/usr/local/bin/run_electrum_server", line 5, in <module>
pkg_resources.run_script('electrum-server==0.9', 'run_electrum_server')
File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 528, in run_script
self.require(requires)[0].run_script(script_name, ns)
File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 1401, in run_script
exec(script_code, namespace, namespace)
File "/usr/local/lib/python2.7/dist-packages/electrum_server-0.9-py2.7.egg/EGG-INFO/scripts/run_electrum_server", line 257, in <module>

File "build/bdist.linux-x86_64/egg/electrumserver/blockchain_processor.py", line 52, in __init__
File "build/bdist.linux-x86_64/egg/electrumserver/storage.py", line 54, in __init__
File "build/bdist.linux-x86_64/egg/electrumserver/storage.py", line 200, in put_node
AttributeError: 'Storage' object has no attribute 'db_utxo'

Is there any way I can fix this ?

Thread Exception When building database

I noticed if the download from the foundry is ahead of what bitcoind has processed so far, the server will start up and then halt with no sort of error messages. I had to run the server by hand to get an actual error message out of it.

$ python -m pdb /usr/local/bin/run_electrum_server
> /usr/local/bin/run_electrum_server(3)<module>()
-> __requires__ = 'electrum-server==1.0'
(Pdb) c
INFO:electrum:Starting Electrum server on electrum.infoha.us
INFO:electrum:Database version 3
INFO:electrum:Blockchain height 364172
INFO:electrum:UTXO tree root hash: 024be20b1a208ee8dd04cfb982b176fdec6428bbe4cc6025260aa8116fe2cc64
INFO:electrum:Coins in database: 1435151785615950
INFO:electrum:TCP server started on 199.101.100.59:50001
Exception in thread Thread-4:
Traceback (most recent call last):
  File "/usr/lib/python2.7/threading.py", line 810, in __bootstrap_inner
    self.run()
  File "/usr/lib/python2.7/threading.py", line 763, in run
    self.__target(*self.__args, **self.__kwargs)
  File "build/bdist.linux-x86_64/egg/electrumserver/blockchain_processor.py", line 74, in do_catch_up
    self.header = self.block2header(self.bitcoind('getblock', [self.storage.last_hash]))
  File "build/bdist.linux-x86_64/egg/electrumserver/blockchain_processor.py", line 126, in bitcoind
    raise BaseException(r['error'])
BaseException: {u'message': u"Can't read block from disk", u'code': -32603}```

python IRC module > 8.6 module name issues

It appears the newer version of the python IRC module electrum-server started using in Q3/2014 has undergone some changes which break functionality.

We could detect the version number and support multiple versions or prompt the user to upgrade. It's a bit messy see below:

From IRC:

[13:51:38] <erik_> Finaly got IRC working on my electum-server. In ircthread.py 'client = irc.client.IRC()' changed it into 'client = irc.client.Reactor()'. 2 days of searching... But very happy now!
[15:17:19] <chrisblaat|away> irc.client.Reactor is mentioned in the change notes of the irc module.
[15:18:17] <chrisblaat|away> als we had to truncate the irc username to two characters or it would spit out some ugly error message
[15:18:23] <chrisblaat|away> als=also
[15:22:28] <chrisblaat|away> version 10 : Renamed irc.client.IRC to irc.client.Manifold to provide a clearer name for that object. Clients supporting 8.6 and later can use the Manifold name. Latest clients must use the Manifold name.
[15:22:49] <chrisblaat|away> Renamed irc.client.Manifold to irc.client.Reactor. Reactor better reflects the implementation as a reactor pattern <. This name makes it's function much more clear and inline with standard terminology.
[15:24:10] <erik_> so version 10 changed from IRC to Manifold. And version 11 changed Manifold to Reactor.

Address subscriptions send duplicate notifications

When I am subscribed to transactions pertaining to an address, I get duplicate notifications.

{"method": "blockchain.address.subscribe", "params": ["1dice8EMZmqKvrGE4Qc9bUFf9PX3xaYDp"], "id": 7}
{"id": 7, "result": "76eb1bffd3ca311e959f264aaba1856269599c57754fc9568cf5b5795a302b73"}
{"params": ["1dice8EMZmqKvrGE4Qc9bUFf9PX3xaYDp", "a0d3dca049edc8671f8e6232606d3bf65ac802fb816eed7f2aeceac05f2e3da1"], "id": null, "method": "blockchain.address.subscribe"}
{"params": ["1dice8EMZmqKvrGE4Qc9bUFf9PX3xaYDp", "a0d3dca049edc8671f8e6232606d3bf65ac802fb816eed7f2aeceac05f2e3da1"], "id": null, "method": "blockchain.address.subscribe"}

stratum_tcp stopped accepting connections after TypeError exception

Stratum TCP stopped accepting connections while catching up 5 blocks and lots of connections (possibly unrelated) - I had to restart to get stratum_tcp to work again.

There was an exception which I couldn't find in the log but on the stderr
http://pastebin.com/NeLGxHN1

"TypeError: 'int' object is not subscriptable" looks as though some illegal command with an integer (?) was passed but the try: didn't return correctly but thew an exception.

DIY Web Client HOWTO

A diy client walkthrough or overview for html5 client creation could be very helpful for new developerswanting to leverage the established electrum ecosystem.

IRC Bot

The IRC code works, but I have no idea how.

Should something like http://pypi.python.org/pypi/irc be used instead? It would make it really easy to build an electrum server bot that could respond to commands, but it does add an external dependency.

run_electrum_server does not verify open files limit is high enough

Suggest adding logic like this near the top of run_electrum_server:

# prevent database corruption due to default open file limits
import resource
softlimit, hardlimit = resource.getrlimit(resource.RLIMIT_OFILE)
if hardlimit < 64000:
    print "Your open files limit is too low." 
    sys.exit()

Single misbehaving client can stall poller

The do_handshake operation is single-threaded and runs in the main poller thread. If a misbehaving client causes this process to take too long (or forever) it prevents the server from accepting new connections and also stops processing existing connections.

I think we need to call settimeout on the connection prior to calling do_handshake, like this:

                timeout = session._connection.gettimeout()
                session._connection.settimeout(60)
                session._connection.do_handshake()
                session._connection.settimeout(timeout)

It would be even better if there was a non-blocking way to do the handshake, or possibly the handshake can run in a worker thread that does not block the main poller thread.

server sent history with non-unique txid

raise Exception("error: server sent history with non-unique txid", result)
Exception: ('error: server sent history with non-unique txid', [{u'tx_hash': u'9a61816a5df0c327f81c4f66375835f4d3fbf9657d7f1b9bc9f0fc2042260029', u'height': 333094}, {u'tx_hash': u'771d769c4183bbaf808ddc0e80611b871807b66e0afea6eb4ba33a9513fa8fd3', u'height': 333053}, {u'tx_hash': u'9a61816a5df0c327f81c4f66375835f4d3fbf9657d7f1b9bc9f0fc2042260029', u'height': 0}])

Why electrum-server send duplicated transaction ids with 0-height ?

blockchain.transaction.broadcast returns errors in result

Errors are expected to show up in the error field of the resulting JSON object, and not in result.

Example

{"id": 6, "result": "{u'message': u'TX rejected', u'code': -22}"}

Expected

{"id": 6, "error": {"message": "TX rejected", "code": -22}}

items.pop(letter) KeyError: '\xd2'

I'm not sure what this could be, when I start the electrum server it dosen't binds any ports. The leveldb get's updated from bitcoind and is now up-today. However, when I kill the process (./stop dose not work without open socket) the server starts the network services for a moment and then terminates.

./start

[26/06/2014-17:20:58] Starting Electrum server on localhost
[26/06/2014-17:20:59] Database version 3
[26/06/2014-17:20:59] Blockchain height 307234
[26/06/2014-17:20:59] UTXO tree root hash: 3ce3cacd0fc48065566022080bb676d761633388a1d42ae4182afa08ba810632
[26/06/2014-17:20:59] Coins in database: 1292945797871746
Exception in thread Thread-4:
Traceback (most recent call last):
File "/usr/lib/python2.7/threading.py", line 810, in __bootstrap_inner
self.run()
File "/usr/lib/python2.7/threading.py", line 1082, in run
self.function(_self.args, *_self.kwargs)
File "/home/bitcoin/electrum-server/backends/bitcoind/blockchain_processor.py", line 78, in
threading.Timer(0, lambda: self.catch_up(sync=False)).start()
File "/home/bitcoin/electrum-server/backends/bitcoind/blockchain_processor.py", line 664, in catch_up
self.import_block(next_block, next_block_hash, self.storage.height+1, sync)
File "/home/bitcoin/electrum-server/backends/bitcoind/blockchain_processor.py", line 398, in import_block
undo = self.storage.import_transaction(txid, tx, block_height, touched_addr)
File "/home/bitcoin/electrum-server/backends/bitcoind/storage.py", line 573, in import_transaction
self.set_spent(addr, txi, txid, i, block_height, undo)
File "/home/bitcoin/electrum-server/backends/bitcoind/storage.py", line 521, in set_spent
s = self.delete_address(leaf)
File "/home/bitcoin/electrum-server/backends/bitcoind/storage.py", line 408, in delete_address
items.pop(letter)
KeyError: '\xd2'

kill PID

[26/06/2014-17:45:32] Signal handler called with signal 15
[26/06/2014-17:45:32] Stopping Stratum
[26/06/2014-17:45:32] Blockchain is up to date.
[26/06/2014-17:45:36] utxo not in database; postponing mempool update
[26/06/2014-17:45:36] Memory pool initialized.
[26/06/2014-17:45:36] TCP server started on port 50001
[26/06/2014-17:45:36] SSL server started on port 50002
[26/06/2014-17:45:36] HTTP server started.
[26/06/2014-17:45:36] HTTPS server started.
[26/06/2014-17:45:46] Stopping timer
[26/06/2014-17:45:46] Closing database...
[26/06/2014-17:45:46] Database is closed
[26/06/2014-17:45:46] Electrum Server stopped

Listening Ports in Config

In the config i have commented out certain ports and only want what i have put in the config but as you can see when the server starts it just uses the default ports anyway.

Config:
[server]
host = 0.0.0.0
report_host = electrum.yacoin.com

stratum_tcp_port = 50001

stratum_http_port = 8081

stratum_tcp_ssl_port = 50002
stratum_http_ssl_port = 8082

report_stratum_tcp_port = 50001

report_stratum_http_port = 80

report_stratum_tcp_ssl_port = 50002
report_stratum_http_ssl_port = 443

Result:
[25/01/2014-20:57:11] TCP server started on port 50001
[25/01/2014-20:57:11] SSL server started on port 50002
[25/01/2014-20:57:11] HTTP server started.
[25/01/2014-20:57:11] HTTPS server started.

Negative Balance

I got few times negative unconfirmed balance

request: { "id": 1, "method": "blockchain.address.get_balance", "params:["1ENgineCaw1zmJq2G2Gx1g9MAjjokGKu4K"] }

result: {"id": 1, "result": {"confirmed": 533506535, "unconfirmed": -35150000}}

Patching Bitcoin

In the section of HOWTO.md that discusses applying Electrum-specific patches to Bitcoin, the -p2 argument did not work for me. I got errors like this:

can't find file to patch at input line 5
Perhaps you should have used the -p or --strip option?

I had to use -p1, and that appeared to work correctly. Perhaps HOWTO.md should be updated to use -p1 instead of -p2?

Starting server: ValueError: filedescriptor out of range in select()

Any ideas? this happened when electrum caught up with blockchain and tried to start the server.

[16/08/2014-09:54:40] catch_up: block 315000 (77.828s 8497.079s) b3f16b1e6ff63262312bf34ee1ce7b1b2df606de1aa381b1dbeed097c8b7a596
[16/08/2014-12:05:08] Blockchain is up to date.
[16/08/2014-12:05:11] utxo not in database; postponing mempool update
[16/08/2014-12:05:11] Memory pool initialized.
[16/08/2014-12:05:11] TCP server started on port 50001
[16/08/2014-12:05:11] HTTP server started.
[16/08/2014-12:05:11] Stopping Stratum
Exception in thread Thread-8:
Traceback (most recent call last):
File "/usr/lib/python2.7/threading.py", line 810, in __bootstrap_inner
self.run()
File "/home/bitcoin/electrum-server/transports/stratum_http.py", line 382, in run
self.server.serve_forever()
File "/usr/lib/python2.7/SocketServer.py", line 236, in serve_forever
poll_interval)
File "/usr/lib/python2.7/SocketServer.py", line 155, in _eintr_retry
return func(*args)
ValueError: filedescriptor out of range in select()

[16/08/2014-12:05:21] Stopping timer
[16/08/2014-12:05:21] Closing database...
[16/08/2014-12:05:21] Database is closed
[16/08/2014-12:05:21] Electrum Server stopped

Startup with bitcoind 0.10.0rc1

Electrum server runs OK with new version of bitcoind provided that bitcoind has finished its startup when electrum-server starts. However, if electrum server is started first and is waiting for bitcoind it crashes soon after starting bitcoind.

The cause is that bitcoind 0.10.0 responds with an error message
error: {"code":-28,"message":"Verifying blocks..."}
Contrast this with bitcoind 0.9.3 which would not reply at all in this state.

Fails with latest electrum

Hi,
I filed an issue in electrum but it looks like the issue might be with electrum-server. Is this git tree the current production code?
With electrum 1.9.8, I am getting the following in logs:
127.0.0.1 - - [13/May/2014 00:02:15] code 400, message Bad request syntax ('{"params": [], "id": 0, "method": "network.is_connected"}')
with the client crashing...

electrum server install ImportError

I have a trouble when i install the electrum server.The electrum server install document reference(https://github.com/spesmilo/electrum-server/blob/master/HOWTO.md).everything has been done before run "electrum-server start" command to launch electrum server.but it print an error: "ImportError: /home/bitcoin/.python-eggs/plyvel-0.9-py2.7-linux-x86_64.egg-tmp/plyvel/_plyvel.so: undefined symbol: _ZN6snappy13RawUncompressEPKcmP".

I have google with the keyword "_ZN6snappy13RawUncompressEPKcmP". i found a reference in this page("wbolster/plyvel#5"). I do as this page said, but finally still failed. my leveldb is 1.9, i install the liblevedb1,libleveldb-dev,plyvel. can anybody help me to solve this big problem.thanks a lot!

error parsing tx's

when i start up my server, and build the db from scratch, it has an error parsing every transaction, is that normal? does it only parse electrum transactions or should it be parsing all of them?

"Server not running" after starting server

I can't seem to get the server to start:

~/electrum-server$ ./electrum-server start
Starting server as daemon
nohup: ignoring input and appending output to ‘nohup.out’
~/electrum-server$ cat nohup.out
server not running
server not running
server not running
server not running
server not running
~/electrum-server$ ./electrum-server getinfo
Server not running
~/electrum-server$ cat /var/log/electrum.log
$ ps aux | grep electrum
electrum     19802  0.0  0.0  11740   912 pts/1    S+   13:59   0:00 grep --color=auto electrum

Server fails to do initial index

On initial start of electrum-server:

Traceback (most recent call last):
  File "/usr/src/electrum-server/backends/bitcoind/blockchain_processor.py", line 71, in __init__
    hist = self.deserialize(self.db.Get('height'))
KeyError
[02/08/2013-21:59:43] initializing database
Exception in thread Thread-4:
Traceback (most recent call last):
  File "/usr/lib/python2.7/threading.py", line 551, in __bootstrap_inner
    self.run()
  File "/usr/lib/python2.7/threading.py", line 759, in run
    self.function(*self.args, **self.kwargs)
  File "/usr/src/electrum-server/backends/bitcoind/blockchain_processor.py", line 91, in <lambda>
    threading.Timer(0, lambda: self.catch_up(sync=False)).start()
  File "/usr/src/electrum-server/backends/bitcoind/blockchain_processor.py", line 794, in catch_up
    next_block = self.bitcoind('getblock', [next_block_hash, 1])
  File "/usr/src/electrum-server/backends/bitcoind/blockchain_processor.py", line 116, in bitcoind
    raise BaseException(r['error'])
BaseException: {u'message': u'value is type int, expected bool', u'code': -1}

SSL cert change breaks connection for clients who connected before with the older cert

Reinstalled my server and didn't have backups for the SSL cert and private key. The server is running, connects to IRC but I couldn't connect to it from my Electrum 2.3.2 client it until I manually deleted the old SSL data in /electrum-data/certs related to this server.

Server log file was saying:
handshake failure:[SSL: TLSV1_ALERT_UNKNOWN_CA] tlsv1 alert unknown ca (_ssl.c:581)

Also, foundry server-peer-hash isn't able to connect to it and check server's hash via SSL port.

multiple interfaces / ipv6

i just installed electrum server and finished indexing

setup:

  • ipv4 and ipv6 (and tor, but haven't tried anything there yet)
  • fqdn resolving to both ipv4 and ipv6
  • trusted ssl cert (not self-signed) for my fqdn

if i set host=my.fqdn.com in electrum.conf, electrum will only bind to my ipv6 interface.
setting host=0.0.0.0 to bind on all ipv4 IFs works, but then i cannot set a correct report_host anymore;

  • if i create a special fqdn (that only resolves to v4) the ssl-cert name is not correct anymore
  • if i report my correct fqdn clients with working ipv6 won't reach me

how can i make electrum server bind to both ipv4 and ipv6?

Blockchain Reorg Can Occur without Increasing Height

if the blockchain reorgs on bitcoind, then the last_hash of storage won't match the last blockhash of bitcoind, however, the storage height could still be equal to the bitcoind height

electrum-server assumes that if the last bitcoind hash does not match the last storage hash that the storage height is less than the bitcoind height

GPL3 or AGPL3?

From LICENSE:1

GNU AFFERO GENERAL PUBLIC LICENSE
Version 3, 19 November 2007

From README:3

Licence: GNU GPL v3

I believe README to be incorrect. Confirm?

client error "TypeError: must be long, not int" with certain server setups

I setup an electrum-server last night (E_molec, electrum.0x0000.de) and my client throws an error when I connect to it. For comparison: the error is not thrown whey I connect to ecdsa.net:110.

I suspect something with the server certificate, which I generated exactly according to HOWTO.md.

Here's the error thrown:

Traceback (most recent call last):
  File "/home/nick/bitcoin/electrum/lib/interface.py", line 224, in start_tcp
    x.parse(cert)
  File "/usr/lib/python2.7/site-packages/tlslite/x509.py", line 43, in parse
    self.parseBinary(bytes)
  File "/usr/lib/python2.7/site-packages/tlslite/x509.py", line 97, in parseBinary
    self.publicKey = _createPublicRSAKey(n, e)
  File "/usr/lib/python2.7/site-packages/tlslite/utils/keyfactory.py", line 179, in _createPublicRSAKey
    return PyCrypto_RSAKey(n, e)
  File "/usr/lib/python2.7/site-packages/tlslite/utils/pycrypto_rsakey.py", line 18, in __init__
    self.rsa = RSA.construct( (n, e) )
  File "/usr/lib/python2.7/site-packages/Crypto/PublicKey/RSA.py", line 539, in construct
    key = self._math.rsa_construct(*tup)
TypeError: must be long, not int

support i2p

Hello!

I would suggest an feature request. Please support the I2P Project (https://geti2p.net/de/), so that we can build up electrum server in this network.

Thanks a lot!

ProtocolError

I tried to setup a Electrum Server but everytime the following Error occurs:

Traceback (most recent call last):
File "/usr/local/bin/run_electrum_server", line 5, in
pkg_resources.run_script('electrum-server==0.9', 'run_electrum_server')
File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 528, in run_script
self.require(requires)[0].run_script(script_name, ns)
File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 1401, in run_script
exec(script_code, namespace, namespace)
File "/usr/local/lib/python2.7/dist-packages/electrum_server-0.9-py2.7.egg/EGG-INFO/scripts/run_electrum_server", line 224, in

File "/usr/local/lib/python2.7/dist-packages/electrum_server-0.9-py2.7.egg/EGG-INFO/scripts/run_electrum_server", line 137, in run_rpc_command

File "/usr/lib/python2.7/xmlrpclib.py", line 1224, in call
return self.__send(self.__name, args)
File "/usr/lib/python2.7/xmlrpclib.py", line 1578, in __request
verbose=self.__verbose
File "/usr/lib/python2.7/xmlrpclib.py", line 1264, in request
return self.single_request(host, handler, request_body, verbose)
File "/usr/lib/python2.7/xmlrpclib.py", line 1312, in single_request
response.msg,
xmlrpclib.ProtocolError: ProtocolError for localhost:8000/RPC2: 404 Not Found

This is my electrum.conf content created by the configure script:

[server]
username = bitcoin
host = localhost
electrum_rpc_port = 8000
stratum_tcp_port = 50001
password = 123456
banner = Welcome to Electrum!
banner_file = /etc/electrum.banner
logfile = /var/log/electrum.log
donation_address =

[leveldb]
path = /var/electrum-server
pruning_limit = 100

[bitcoind]
host = localhost
port = 8332
user =
password = 123456

blockchain processor / delete address / key error

Hey, this popped up after starting for the first time, thought I'd report it.

Exception in thread Thread-4:
Traceback (most recent call last):
File "/usr/lib/python2.7/threading.py", line 551, in __bootstrap_inner
self.run()
File "/usr/lib/python2.7/threading.py", line 759, in run
self.function(_self.args, *_self.kwargs)
File "/home/bitcoin/electrum-server/backends/bitcoind/blockchain_processor.py", line 78, in
threading.Timer(0, lambda: self.catch_up(sync=False)).start()
File "/home/bitcoin/electrum-server/backends/bitcoind/blockchain_processor.py", line 664, in catch_up
self.import_block(next_block, next_block_hash, self.storage.height+1, sync)
File "/home/bitcoin/electrum-server/backends/bitcoind/blockchain_processor.py", line 398, in import_block
undo = self.storage.import_transaction(txid, tx, block_height, touched_addr)
File "/home/bitcoin/electrum-server/backends/bitcoind/storage.py", line 573, in import_transaction
self.set_spent(addr, txi, txid, i, block_height, undo)
File "/home/bitcoin/electrum-server/backends/bitcoind/storage.py", line 521, in set_spent
s = self.delete_address(leaf)
File "/home/bitcoin/electrum-server/backends/bitcoind/storage.py", line 408, in delete_address
items.pop(letter)
KeyError: '/'

log rotation for the logfile

Been running electrum nodes with continuous uptime, I saw electrum.log (electrum server's log file) infinitely grows. Removing it entirely without keeping the last maybe let's say 100 lines might not be so healthy for debugging and server monitoring, in case something goes wrong or in case we need to identify a bug. Would be nice if we could have some kind of a log rotation, like Tor has, which sends a SIGHUP to the process and renames electrum.log to electrum.log.1 after a given time, and deletes .1 after some more time.

Empty response for RPC "blockchain.address.get_balance"

When I query about an address which hasn't been used yet (no TX in blockchain or mempool), the response is usually empty but sometimes it's valid JSON string:

curl -v -d '{"method":"blockchain.address.get_balance","params":["1HEbGvJtr48uouAUuuUquXWTqXe1GgW4m5"],"id":1}' http://<electrum-server>:8081

returns most of the time:

< HTTP/1.0 200 OK
< Server: BaseHTTP/0.3 Python/2.7.9
< Date: Thu, 09 Jul 2015 13:45:00 GMT
< Set-Cookie: SESSION=4FUrB7ACfusrH1HqSvBgEXxLXa1d
< Content-type: application/json-rpc
< Access-Control-Allow-Origin: *
< Content-length: 0

and sometimes (approx. 1 in 10 tries) gives valid response: {"id": 1, "result": {"confirmed": 0, "unconfirmed": 0}}

not patched bitcoind gives strange info in electrum server log file

if bitcoind is not patched, electrum server should give some help instead of loging:

2013-09-06_00:16:21.50305 [06/09/2013-00:16:21] Starting Electrum server on 192.168.115.11
2013-09-06_00:16:21.82369 [06/09/2013-00:16:21] Database version 1
2013-09-06_00:16:21.82370 [06/09/2013-00:16:21] Blockchain height 256122
2013-09-06_00:16:21.82693 Exception in thread Thread-4:
2013-09-06_00:16:21.82693 Traceback (most recent call last):
2013-09-06_00:16:21.82693 File "/usr/lib/python2.7/threading.py", line 552, in __bootstrap_inner
2013-09-06_00:16:21.82694 self.run()
2013-09-06_00:16:21.82694 File "/usr/lib/python2.7/threading.py", line 760, in run
2013-09-06_00:16:21.82694 self.function(_self.args, *_self.kwargs)
2013-09-06_00:16:21.82694 File "/home/btc/server/backends/bitcoind/blockchain_processor.py", line 91, in
2013-09-06_00:16:21.82694 threading.Timer(0, lambda: self.catch_up(sync=False)).start()
2013-09-06_00:16:21.82694 File "/home/btc/server/backends/bitcoind/blockchain_processor.py", line 794, in catch_up
2013-09-06_00:16:21.82694 next_block = self.bitcoind('getblock', [next_block_hash, 1])
2013-09-06_00:16:21.82695 File "/home/btc/server/backends/bitcoind/blockchain_processor.py", line 116, in bitcoind
2013-09-06_00:16:21.82695 raise BaseException(r['error'])
2013-09-06_00:16:21.82695 BaseException: {u'message': u'getblock \nReturns details of a block with given block-hash.', u'code': -1}

KeyError in blockchain_processor.py

My local bitcoind (v0.8.1) is downloading the blockchain; is the KeyError due to that?

[17/04/2013-13:27:04] Starting Electrum server on BlaBla Traceback (most recent call last): File "/home/bitcoin/src/electrum-server/backends/bitcoind/blockchain_processor.py", line 62, in __init__ hist = self.deserialize(self.db.Get('height')) KeyError [17/04/2013-13:27:05] initializing database Exception in thread Thread-4: Traceback (most recent call last): File "/usr/lib/python2.7/threading.py", line 810, in __bootstrap_inner self.run() File "/usr/lib/python2.7/threading.py", line 1082, in run self.function(*self.args, **self.kwargs) File "/home/bitcoin/src/electrum-server/backends/bitcoind/blockchain_processor.py", line 82, in <lambda> threading.Timer(0, lambda: self.catch_up(sync=False)).start() File "/home/bitcoin/src/electrum-server/backends/bitcoind/blockchain_processor.py", line 790, in catch_up self.import_block(next_block, next_block_hash, self.height+1, sync) File "/home/bitcoin/src/electrum-server/backends/bitcoind/blockchain_processor.py", line 558, in import_block addr = self.batch_txio[txi] KeyError: '\x04Y\x98>W\n\xec\xa8\x88w\x07\xc1\x1bJ%\xc8\xdb\x1c\x83\xc5p\x98\x93\xc55\x1ds\xd2[x\xac\x00\x00\x00\x00'`

ulimit: open files: cannot modify limit: Operation not permitted

Getting this error when starting electrum-server:

$ electrum-server start
Starting server as daemon
/usr/local/bin/electrum-ixc-server: line 64: ulimit: open files: cannot modify limit: Operation not permitted

I'm running electrum-server on a Xen vps server... Might that be the issue? And if so, how to get around that problem?

Anonymous stats reporting

Goals:

  • [ ] extending current protocol with anonymous stats reporting by an electrum server
  • [ ] adding Yes/No configuration parameter allowing switching reporting off by the server admin, with default value Yes

What do we want to be reported:

  • [ ] current blockchain
  • [ ] number of TCP/HTTP connections in last 10 minutes

Who will do it?

database building process

@ecdsa - the database building process, in my opinion, is now a pretty weak point of the electrum ecosystem. most of servers share the same build, and the process starts to be very long, which might be pretty risky if we must rebuild the database rapidly by any reason.

do you see any method to split the process among cores or independent servers, and join the result later? if yes, i do volunteer to write a script utilising one of major cloud services.

blockchain parsing information in log file during catch up

When I download current leveldb from foundry, it is outdated. Unfortunately at the moment electrum server does not report progress of catching up to current blockchain, which is very annoying, as you are not able to see what's going on with the server for hours.

Request: the server should report to log file every parsed blockchain.

Install / configure process needs additional file limit settings for ubuntu >= 14.04

I messed around with this for ages but using default configure and install guide does not work for setting file limits. Some googling helped me figure out that on 14.04 and perhaps afterwards you cannot raise file limits without also adding settings for pam. Maybe these could be added to configure or at least install guide.

Edit /etc/pam.d/common-session* and add the following line. Note the * as there are 2 files that need editing for this to work.

session required pam_limits.so

Once I did this the electrum user finally was seeing the raised nofile limits.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.