Bitcoin Forum

Bitcoin => Electrum => Topic started by: ThomasV on June 04, 2012, 10:11:35 PM



Title: Electrum server discussion thread
Post by: ThomasV on June 04, 2012, 10:11:35 PM
This thread is for announcements and questions concerning the Electrum server code.
You want to subscribe to it if you run an Electrum server.

________________________________


Today we just fixed a bug in bitcoin-abe, that was causing a memory allocation error.
https://github.com/jtobey/bitcoin-abe/commit/0b7f464b52454555c69a6b77b4ad0cf453a2cf48

The bug was silent because exceptions thrown by the library were not properly logged.
This is fixed too; exceptions thrown by the library are logged, and the server will enter its 'server not ready' status when such an exception is raised.

If you are a server operator, please pull the latest version of both abe and of the Electrum server.
Do not forget to reinstall the abe library ('python setup.py install') prior to restarting the electrum server.


Title: Re: Electrum server discussion thread
Post by: marcus_of_augustus on June 07, 2012, 09:46:59 PM
watching.


Title: Re: Electrum server discussion thread
Post by: duncant on June 10, 2012, 03:26:02 AM
I've been having some trouble with my server, uncle-enzo.info , getting killed by (what I assume is) an out of memory problem. I didn't have this problem before I upgraded to the lastest version of abe and electrum-server.

I'm going to try to debug it further and get back to you.


Title: Re: Electrum server discussion thread
Post by: ThomasV on June 10, 2012, 10:21:27 PM
I've been having some trouble with my server, uncle-enzo.info , getting killed by (what I assume is) an out of memory problem. I didn't have this problem before I upgraded to the lastest version of abe and electrum-server.

I'm going to try to debug it further and get back to you.

I have always had memory problems with the server.
the memory used by bitcoind increases slowly but regularly; my patches may have introcuced a memory leak, but I did not find it.
electrum_server reads the memory pool every 10 seconds. this is pretty intensive, and could also cause this leak.


Title: Re: Electrum server discussion thread
Post by: anfedorov on June 11, 2012, 01:15:48 AM
For the last couple of hours, the servers at ecdsa.org, btcback.com, and electrum.novit.ro have been responding to:

--> {"params": [], "id": 2, "method": "blockchain.numblocks.subscribe"}

with:

<-- {"id": 2, "result": 0}

Which seems... unlikely. Any idea of what could be causing it?


Title: Re: Electrum server discussion thread
Post by: TheBitMan on June 11, 2012, 03:22:06 AM
everything is down..no server connection


Title: Re: Electrum server discussion thread
Post by: NothinG on June 11, 2012, 03:23:03 AM
everything is down..no server connection
I've got connection to uncle-enzo.info


Title: Re: Electrum server discussion thread
Post by: Tuxavant on June 11, 2012, 03:36:06 AM
Server connection is there (see debug info) but the client is erroneously reporting "no server connection" in place of a balance. If you run from the command line "electrum balance" you'll see the wallet balance.


Title: Re: Electrum server discussion thread
Post by: ThomasV on June 11, 2012, 05:09:40 AM
For the last couple of hours, the servers at ecdsa.org, btcback.com, and electrum.novit.ro have been responding to:

--> {"params": [], "id": 2, "method": "blockchain.numblocks.subscribe"}

with:

<-- {"id": 2, "result": 0}

Which seems... unlikely. Any idea of what could be causing it?

bitcoind crashed at ecdsa.org.


Title: Re: Electrum server discussion thread
Post by: ThomasV on June 11, 2012, 05:32:23 AM
For the last couple of hours, the servers at ecdsa.org, btcback.com, and electrum.novit.ro have been responding to:

--> {"params": [], "id": 2, "method": "blockchain.numblocks.subscribe"}

with:

<-- {"id": 2, "result": 0}

Which seems... unlikely. Any idea of what could be causing it?

this is the answer returned by the server when the local bitcoin daemon cannot be reached.
this causes the client to display "server not ready"


Title: Re: Electrum server discussion thread
Post by: ThomasV on June 11, 2012, 11:48:49 AM
we are having problems with ecdsa.org and electrum.novit.ro
both servers are down.
sorry for the inconvenience.


Title: Re: Electrum server discussion thread
Post by: Tuxavant on June 11, 2012, 12:05:50 PM
Dunno if this will be helpful, but this is how I keep bitcoind running on my tor exit servers:

Code:
2012-06-11:0803 EDT
[redacted@tor-exit-alpha ~]$ crontab -l
*/5 * * * * /home/redacted/bin/check-bitcoind &> /dev/null


2012-06-11:0803 EDT
[redacted@tor-exit-alpha ~]$ cat /home/redacted/bin/check-bitcoind
#!/bin/bash

pgrep "^bitcoind$" &> /dev/null
if [ $? -gt 0 ]; then
  echo "bitcoind not running. Starting process..."
  /usr/local/bin/bitcoind &
else
  echo "bitcoind is alive."
  true
fi



Title: Re: Electrum server discussion thread
Post by: ThomasV on June 11, 2012, 12:28:55 PM
Dunno if this will be helpful, but this is how I keep bitcoind running on my tor exit servers:

bitcoind is fine. we just both upgraded Abe and it somehow corrupted our databases.
my server is back now.
I applied a workaround, but I still have to understand what really happened, and if the database is ok.


Title: Re: Electrum server discussion thread
Post by: duncant on June 12, 2012, 01:51:38 AM
I see that bitcoin-abe and electrum/server have been updated. Should I go ahead an upgrade or should I wait until everything is stable?


Title: Re: Electrum server discussion thread
Post by: duncant on June 12, 2012, 09:38:04 PM
I see that bitcoin-abe and electrum/server have been updated. Should I go ahead an upgrade or should I wait until everything is stable?

Well, I went ahead and upgraded (after making a backup of the database). The server is outputting messages like those below. Should I be worried/should I restore from backup and downgrade?

Code:
block number: 184242
WARNING: missing tx_in for tx 3977349
WARNING: missing tx_out for tx 3977349
block number: 184243
WARNING: missing tx_in for tx 3977352
block number: 184244
WARNING: missing tx_in for tx 3977356
block number: 184245
WARNING: missing tx_in for tx 3977404
block number: 184246
WARNING: missing tx_in for tx 3977413
block number: 184247
WARNING: missing tx_in for tx 3977461
block number: 184248


Title: Re: Electrum server discussion thread
Post by: ThomasV on June 12, 2012, 09:48:05 PM
I see that bitcoin-abe and electrum/server have been updated. Should I go ahead an upgrade or should I wait until everything is stable?

Well, I went ahead and upgraded (after making a backup of the database). The server is outputting messages like those below. Should I be worried/should I restore from backup and downgrade?

Code:
block number: 184242
WARNING: missing tx_in for tx 3977349
WARNING: missing tx_out for tx 3977349
block number: 184243
WARNING: missing tx_in for tx 3977352
block number: 184244
WARNING: missing tx_in for tx 3977356
block number: 184245
WARNING: missing tx_in for tx 3977404
block number: 184246
WARNING: missing tx_in for tx 3977413
block number: 184247
WARNING: missing tx_in for tx 3977461
block number: 184248
no, don't worry. I added these warnings after the last schema change in abe, but they seem to be harmless.


Title: Re: Electrum server discussion thread
Post by: ThomasV on June 13, 2012, 09:23:54 PM
today I fixed a major performance issue with the server.

if you upgrade, please note that I updated the bitcoind patch. (for 0.6.2)
you need to recompile bitcoind with this new patch in order to complete the upgrade.


Title: Re: Electrum server discussion thread
Post by: TheBitMan on June 13, 2012, 10:26:55 PM
today I fixed a major performance issue with the server.

if you upgrade, please note that I updated the bitcoind patch. (for 0.6.2)
you need to recompile bitcoind with this new patch in order to complete the upgrade.

will you loose any coins?


Title: Re: Electrum server discussion thread
Post by: ThomasV on June 13, 2012, 10:41:15 PM
will you loose any coins?

can you explain your question?


Title: Re: Electrum server discussion thread
Post by: TheBitMan on June 13, 2012, 11:49:32 PM
will you loose any coins?

can you explain your question?
When I update it, will I still have my coins afterword?


Title: Re: Electrum server discussion thread
Post by: rjk on June 13, 2012, 11:50:33 PM
will you loose any coins?

can you explain your question?
When I update it, will I still have my coins afterword?
Why would anyone put out an update to anything that caused directly or indirectly a loss of data or coins for any reason? That's absurd.


Title: Re: Electrum server discussion thread
Post by: TheBitMan on June 13, 2012, 11:51:55 PM
will you loose any coins?

can you explain your question?
When I update it, will I still have my coins afterword?
Why would anyone put out an update to anything that caused directly or indirectly a loss of data or coins for any reason? That's absurd.
I got confused to what he wrote..got the new version and it's working well.


Title: Re: Electrum server discussion thread
Post by: ThomasV on June 14, 2012, 07:50:36 AM
will you loose any coins?

can you explain your question?
When I update it, will I still have my coins afterword?
Why would anyone put out an update to anything that caused directly or indirectly a loss of data or coins for any reason? That's absurd.
I got confused to what he wrote..got the new version and it's working well.

The new version of what? the client or the server?
This thread is about the server, and the server does not manage your coins; the client does.
This is why your question did not make sense to me.

Please clarify. do you run an Electrum server?


Title: Re: Electrum server discussion thread
Post by: ThomasV on June 14, 2012, 09:44:23 AM
I just added a very basic DOS protection to the server code:

addresses with more than 200 inputs or output transactions will raise an error.
this means protection agains requests of the history of popular addresses (eg Satoshi Dice)




Title: Re: Electrum server discussion thread
Post by: marcus_of_augustus on June 14, 2012, 11:23:09 AM

This is more a question about the design philosophy of the server than specifics;

Why SQL database?


Title: Re: Electrum server discussion thread
Post by: ThomasV on June 14, 2012, 11:24:07 AM

This is more a question about the design philosophy of the server than specifics;

Why SQL database?

because I use abe.


Title: Re: Electrum server discussion thread
Post by: ThomasV on June 14, 2012, 09:05:28 PM
I just pushed another important update with a new bitcoind patch.
it fixes memorypool issues.


Title: Re: Electrum server discussion thread
Post by: ThomasV on June 15, 2012, 02:06:36 PM
here is another update to the patch.
the pevious version did not return orphaned transactions in getmemorypool

https://gitorious.org/electrum/server/commit/a1156626e746cd847bb0a02344bfb57993fd1c80


Title: Re: Electrum server discussion thread
Post by: Tachikoma on June 17, 2012, 12:47:33 PM
Can I ask you what kind of resources a electrum server uses or rather what kind of resources I should dedicate to it to have it running stable.


Title: Re: Electrum server discussion thread
Post by: ThomasV on June 17, 2012, 07:32:14 PM
Can I ask you what kind of resources a electrum server uses or rather what kind of resources I should dedicate to it to have it running stable.


my server (ecdsa.org) runs on a vps hosted by cinfu.com, with 1GB of RAM

I had crashes in the last few days because I was working on the server code;
the traffic increase caused by SatoshiDice forced me to make my bitcoind patch more efficient..

I believe this is fixed. bitcoind has been running for 24h and does not crash anymore.

However, its memory usage slowly increases; there might be a memory leak.
The total memory usage right now is 630M. This is bitcoind + the electrum server in python.

(note that the electrum server never removes elements from its cache, so in principle this is another leak that should be fixed.
in practice, however, bitcoind eats much more)



Title: Re: Electrum server discussion thread
Post by: marcus_of_augustus on June 18, 2012, 12:38:17 AM
Can I ask you what kind of resources a electrum server uses or rather what kind of resources I should dedicate to it to have it running stable.

The HOWTO is instructive http://gitorious.org/electrum/server/blobs/master/HOWTO (http://gitorious.org/electrum/server/blobs/master/HOWTO)

I thought this was a consideration ....

Quote
Important notice: This is a *very* long process. Even on fast machines you can expect it to take hours. Here are some benchmarks for importing ~173.000 blocks (size of the Bitcoin blockchain at the time of this writing):

System 1: ~9 hours.
        * CPU: Intel Core i7 Q740 @ 1.73GHz
        * HDD: very fast SSD
System 2: ~55 hours.
        * CPU: Intel Xeon X3430 @ 2.40GHz
        * HDD: 2 x SATA in a RAID1.


Title: Re: Electrum server discussion thread
Post by: Tachikoma on June 18, 2012, 09:33:54 AM
Thanks for the answers ThomasV and Marcus.

I think Slush posted a torrent somewhere, I hope this might speed up the initial blockchain import, not sure how old that is by now. To be sure I will assign it 2GB and see how it behaves.

I think ecdsa.org might have crashed again btw, I have pending transaction that is confirmed on the other servers.


Title: Re: Electrum server discussion thread
Post by: anfedorov on June 18, 2012, 05:11:25 PM
When I connect to electrum.novit.ro, I seem to get all of my transactions (up to today's).

When I connect to ecdsa.org, I get transactions up to two days ago (Jun 16th), although I didn't make any yesterday, so it might just be today's that are missing.

When I connect to uncle-enzo.info, I get transactions up to four days ago (Jun 14th).

When I connect to btcback.com, I get transactions up to ~two weeks ago (Jun 3rd).

This does not inspire confidence in the status of the Electrum servers... what could be causing the issues?


Title: Re: Electrum server discussion thread
Post by: ThomasV on June 18, 2012, 06:36:17 PM
When I connect to electrum.novit.ro, I seem to get all of my transactions (up to today's).

When I connect to ecdsa.org, I get transactions up to two days ago (Jun 16th), although I didn't make any yesterday, so it might just be today's that are missing.

When I connect to uncle-enzo.info, I get transactions up to four days ago (Jun 14th).

When I connect to btcback.com, I get transactions up to ~two weeks ago (Jun 3rd).

This does not inspire confidence in the status of the Electrum servers... what could be causing the issues?

I agree. The server is now my top priority.


Title: Re: Electrum server discussion thread
Post by: duncant on June 18, 2012, 09:00:27 PM
When I connect to electrum.novit.ro, I seem to get all of my transactions (up to today's).

When I connect to ecdsa.org, I get transactions up to two days ago (Jun 16th), although I didn't make any yesterday, so it might just be today's that are missing.

When I connect to uncle-enzo.info, I get transactions up to four days ago (Jun 14th).

When I connect to btcback.com, I get transactions up to ~two weeks ago (Jun 3rd).

This does not inspire confidence in the status of the Electrum servers... what could be causing the issues?

I hadn't noticed that. I'm rebooting the server and importing all the missing transactions.


Title: Re: Electrum server discussion thread
Post by: ajze on June 21, 2012, 12:22:19 AM
Hi all.  I'm the operator of btcback.com.  I just upgraded bitcoind/electrum and have been getting tons of errors along these lines:

ERROR:Abe.DataStore:Chain not found for magic number '\xfb\x89\xa4\x03' in block file /home/bitcoind/.bitcoin/blk0001.dat at offset 1612760166.  If file contents have changed, consider forcing a rescan: UPDATE datadir SET blkfile_number=1, blkfile_offset=0 WHERE dirname='/home/bitcoind/.bitcoin'

I shutdown electrum, ran the SQL query it suggests and restarted it.  Now I can't connect to the server and the logs are empty except for: 'Starting Electrum server on btcback.com'.  I'm assuming it takes just takes a long time to re-scan the blockchain.


Before I started that, I was also getting a different error about a missing column in the db:
OperationalError: (1054, "Unknown column 'last_value' in 'field list'")
error: sql error: 1MUbXxCYa3W2Q6YMrrQcNQDz8kaGftwXkq
Traceback (most recent call last):
  File "/home/bitcoind/src/electrum/server/backends/abe/__init__.py", line 87, in safe_sql
    ret = self.selectall(sql,params)
  File "/usr/local/lib/python2.6/dist-packages/Abe/DataStore.py", line 510, in _selectall
    store.sql(stmt, params)
  File "/usr/local/lib/python2.6/dist-packages/Abe/DataStore.py", line 412, in sql
    store.cursor.execute(cached, params)
  File "/usr/lib/pymodules/python2.6/MySQLdb/cursors.py", line 166, in execute
    self.errorhandler(self, exc, value)
  File "/usr/lib/pymodules/python2.6/MySQLdb/connections.py", line 35, in defaulterrorhandler
    raise errorclass, errorvalue

Any thoughts on that one?


Title: Re: Electrum server discussion thread
Post by: duncant on June 21, 2012, 12:40:18 AM
I shutdown electrum, ran the SQL query it suggests and restarted it.  Now I can't connect to the server and the logs are empty except for: 'Starting Electrum server on btcback.com'.  I'm assuming it takes just takes a long time to re-scan the blockchain.

It's faster if you run
Code:
abe --config <config file> --no-serve
than letting the electrum server take care of the import.


Title: Re: Electrum server discussion thread
Post by: apetersson on June 21, 2012, 12:57:05 AM
watching


Title: Re: Electrum server discussion thread
Post by: ajze on June 21, 2012, 02:08:59 AM
I shutdown electrum, ran the SQL query it suggests and restarted it.  Now I can't connect to the server and the logs are empty except for: 'Starting Electrum server on btcback.com'.  I'm assuming it takes just takes a long time to re-scan the blockchain.

It's faster if you run
Code:
abe --config <config file> --no-serve
than letting the electrum server take care of the import.

So its re-importing everything?  Guess btcback.com will be down for a couple of days :/


EDIT:

Switched to Abe and it looks like is wasn't re-importing everything.  Should be back up as soon as I find out who's been winning at Satoshi Dice over the past couple of weeks :)


Title: Re: Electrum server discussion thread
Post by: anfedorov on June 21, 2012, 10:22:08 PM
In the server response to "blockchain.address.get_history" commands, a transaction's timestamp is set to the time it was included in a block (or 0 while it's in the mempool). This makes it impossible for a client to correctly sort transactions which occurred while the it wasn't connected to the server, and adds a lot of complexity to correctly sorting those which occur when it's connected.

Could the server be updated to report the time a transaction was first received, either instead of the current timestamp value (as the blockchain.info API does) or in another field?

I can provide a patch if you let me know which of these is preferred, ThomasV.


Title: Re: Electrum server discussion thread
Post by: ThomasV on June 22, 2012, 07:04:58 AM
In the server response to "blockchain.address.get_history" commands, a transaction's timestamp is set to the time it was included in a block (or 0 while it's in the mempool). This makes it impossible for a client to correctly sort transactions which occurred while the it wasn't connected to the server, and adds a lot of complexity to correctly sorting those which occur when it's connected.

Could the server be updated to report the time a transaction was first received, either instead of the current timestamp value (as the blockchain.info API does) or in another field?

I can provide a patch if you let me know which of these is preferred, ThomasV.

this is not possible. the time a tx was first received depends on the server.
the correct way to sort transactions is to look at their inputs and outputs.


Title: Re: Electrum server discussion thread
Post by: anfedorov on June 22, 2012, 07:40:05 AM
this is not possible. the time a tx was first received depends on the server.
the correct way to sort transactions is to look at their inputs and outputs.

I think that's OK - in practice, transactions are spread fast enough that it won't differ by more than a few seconds, whereas blocks are often over 30 minutes apart.

I'm not sure if I understand how inputs/outputs can be used to sort transactions... could you expound?


Title: Re: Electrum server discussion thread
Post by: ThomasV on June 22, 2012, 10:29:20 AM
this is not possible. the time a tx was first received depends on the server.
the correct way to sort transactions is to look at their inputs and outputs.

I think that's OK - in practice, transactions are spread fast enough that it won't differ by more than a few seconds, whereas blocks are often over 30 minutes apart.

no, there is no guarantee that different servers will configure their clock with the same time.

in addition, get_history will be extended, and it should be completely deterministic;
a hash of the history will be used to avoid the server resending the whole history everytime it changes.


Quote
I'm not sure if I understand how inputs/outputs can be used to sort transactions... could you expound?

when transactions are in the same block, they are logically ordered; you cannot spend coins before you receive them


Title: Re: Electrum server discussion thread
Post by: ThomasV on June 22, 2012, 11:11:03 AM
I made some changes to the server code this week:

- The server shuts itself down if it loses connection with the bitcoin daemon. This will prevent servers lagging in the past
- The server announces its version to clients. The current server version is tagged 0.1.
This version number will be used by future versions of the client; for example, the client will filter out servers that have not been upgraded after a critical bug has been fixed.


Title: Re: Electrum server discussion thread
Post by: Tachikoma on June 22, 2012, 11:22:28 AM
Updated my server but go this while starting it back up.

Code:
Traceback (most recent call last):
  File "/home/animazing/src/electrum/server/backends/abe/__init__.py", line 87, in safe_sql
    ret = self.selectall(sql,params)
  File "/usr/local/lib/python2.7/dist-packages/Abe/DataStore.py", line 510, in _selectall
    store.sql(stmt, params)
  File "/usr/local/lib/python2.7/dist-packages/Abe/DataStore.py", line 412, in sql
    store.cursor.execute(cached, params)
  File "/usr/local/lib/python2.7/dist-packages/MySQLdb/cursors.py", line 174, in execute
    self.errorhandler(self, exc, value)
  File "/usr/local/lib/python2.7/dist-packages/MySQLdb/connections.py", line 36, in defaulterrorhandler
    raise errorclass, errorvalue
OperationalError: (1054, "Unknown column 'last_value' in 'field list'")
error: sql error: <OMITTED ADRESS>
Traceback (most recent call last):
  File "/home/animazing/src/electrum/server/backends/abe/__init__.py", line 87, in safe_sql
    ret = self.selectall(sql,params)
  File "/usr/local/lib/python2.7/dist-packages/Abe/DataStore.py", line 510, in _selectall
    store.sql(stmt, params)
  File "/usr/local/lib/python2.7/dist-packages/Abe/DataStore.py", line 412, in sql
    store.cursor.execute(cached, params)
  File "/usr/local/lib/python2.7/dist-packages/MySQLdb/cursors.py", line 174, in execute
    self.errorhandler(self, exc, value)
  File "/usr/local/lib/python2.7/dist-packages/MySQLdb/connections.py", line 36, in defaulterrorhandler
    raise errorclass, errorvalue
OperationalError: (1054, "Unknown column 'last_value' in 'field list'")
error: sql error: <OMITTED ADRESS>
Traceback (most recent call last):
  File "/home/animazing/src/electrum/server/backends/abe/__init__.py", line 87, in safe_sql
    ret = self.selectall(sql,params)
  File "/usr/local/lib/python2.7/dist-packages/Abe/DataStore.py", line 510, in _selectall
    store.sql(stmt, params)
  File "/usr/local/lib/python2.7/dist-packages/Abe/DataStore.py", line 412, in sql
    store.cursor.execute(cached, params)
  File "/usr/local/lib/python2.7/dist-packages/MySQLdb/cursors.py", line 174, in execute
    self.errorhandler(self, exc, value)
  File "/usr/local/lib/python2.7/dist-packages/MySQLdb/connections.py", line 36, in defaulterrorhandler
    raise errorclass, errorvalue
OperationalError: (1054, "Unknown column 'last_value' in 'field list'")
error: sql error: <OMITTED ADRESS>
Traceback (most recent call last):
  File "/home/animazing/src/electrum/server/backends/abe/__init__.py", line 87, in safe_sql
    ret = self.selectall(sql,params)
  File "/usr/local/lib/python2.7/dist-packages/Abe/DataStore.py", line 510, in _selectall
    store.sql(stmt, params)
  File "/usr/local/lib/python2.7/dist-packages/Abe/DataStore.py", line 412, in sql
    store.cursor.execute(cached, params)
  File "/usr/local/lib/python2.7/dist-packages/MySQLdb/cursors.py", line 174, in execute
    self.errorhandler(self, exc, value)
  File "/usr/local/lib/python2.7/dist-packages/MySQLdb/connections.py", line 36, in defaulterrorhandler
    raise errorclass, errorvalue
OperationalError: (1054, "Unknown column 'last_value' in 'field list'")
error: sql error: <OMITTED ADRESS>
Traceback (most recent call last):
  File "/home/animazing/src/electrum/server/backends/abe/__init__.py", line 87, in safe_sql
    ret = self.selectall(sql,params)
  File "/usr/local/lib/python2.7/dist-packages/Abe/DataStore.py", line 510, in _selectall
    store.sql(stmt, params)
  File "/usr/local/lib/python2.7/dist-packages/Abe/DataStore.py", line 412, in sql
    store.cursor.execute(cached, params)
  File "/usr/local/lib/python2.7/dist-packages/MySQLdb/cursors.py", line 174, in execute
    self.errorhandler(self, exc, value)
  File "/usr/local/lib/python2.7/dist-packages/MySQLdb/connections.py", line 36, in defaulterrorhandler
    raise errorclass, errorvalue
OperationalError: (1054, "Unknown column 'last_value' in 'field list'")
error: sql error: <OMITTED ADRESS>
Traceback (most recent call last):
  File "/home/animazing/src/electrum/server/backends/abe/__init__.py", line 87, in safe_sql
    ret = self.selectall(sql,params)
  File "/usr/local/lib/python2.7/dist-packages/Abe/DataStore.py", line 510, in _selectall
    store.sql(stmt, params)
  File "/usr/local/lib/python2.7/dist-packages/Abe/DataStore.py", line 412, in sql
    store.cursor.execute(cached, params)
  File "/usr/local/lib/python2.7/dist-packages/MySQLdb/cursors.py", line 174, in execute
    self.errorhandler(self, exc, value)
  File "/usr/local/lib/python2.7/dist-packages/MySQLdb/connections.py", line 36, in defaulterrorhandler
    raise errorclass, errorvalue
OperationalError: (1054, "Unknown column 'last_value' in 'field list'")
error: sql error: <OMITTED ADRESS>
Traceback (most recent call last):
  File "/home/animazing/src/electrum/server/backends/abe/__init__.py", line 87, in safe_sql
    ret = self.selectall(sql,params)
  File "/usr/local/lib/python2.7/dist-packages/Abe/DataStore.py", line 510, in _selectall
    store.sql(stmt, params)
  File "/usr/local/lib/python2.7/dist-packages/Abe/DataStore.py", line 412, in sql
    store.cursor.execute(cached, params)
  File "/usr/local/lib/python2.7/dist-packages/MySQLdb/cursors.py", line 174, in execute
    self.errorhandler(self, exc, value)
  File "/usr/local/lib/python2.7/dist-packages/MySQLdb/connections.py", line 36, in defaulterrorhandler
    raise errorclass, errorvalue
OperationalError: (1054, "Unknown column 'last_value' in 'field list'")
error: sql error: <OMITTED ADRESS>
Traceback (most recent call last):
  File "/home/animazing/src/electrum/server/backends/abe/__init__.py", line 87, in safe_sql
    ret = self.selectall(sql,params)
  File "/usr/local/lib/python2.7/dist-packages/Abe/DataStore.py", line 510, in _selectall
    store.sql(stmt, params)
  File "/usr/local/lib/python2.7/dist-packages/Abe/DataStore.py", line 412, in sql
    store.cursor.execute(cached, params)
  File "/usr/local/lib/python2.7/dist-packages/MySQLdb/cursors.py", line 174, in execute
    self.errorhandler(self, exc, value)
  File "/usr/local/lib/python2.7/dist-packages/MySQLdb/connections.py", line 36, in defaulterrorhandler
    raise errorclass, errorvalue
OperationalError: (1054, "Unknown column 'last_value' in 'field list'")
error: sql error: <OMITTED ADRESS>
Traceback (most recent call last):
  File "/home/animazing/src/electrum/server/backends/abe/__init__.py", line 87, in safe_sql
    ret = self.selectall(sql,params)
  File "/usr/local/lib/python2.7/dist-packages/Abe/DataStore.py", line 510, in _selectall
    store.sql(stmt, params)
  File "/usr/local/lib/python2.7/dist-packages/Abe/DataStore.py", line 412, in sql
    store.cursor.execute(cached, params)
  File "/usr/local/lib/python2.7/dist-packages/MySQLdb/cursors.py", line 174, in execute
    self.errorhandler(self, exc, value)
  File "/usr/local/lib/python2.7/dist-packages/MySQLdb/connections.py", line 36, in defaulterrorhandler
    raise errorclass, errorvalue
OperationalError: (1054, "Unknown column 'last_value' in 'field list'")
error: sql error: <OMITTED ADRESS>
Traceback (most recent call last):
  File "/home/animazing/src/electrum/server/backends/abe/__init__.py", line 87, in safe_sql
    ret = self.selectall(sql,params)
  File "/usr/local/lib/python2.7/dist-packages/Abe/DataStore.py", line 510, in _selectall
    store.sql(stmt, params)
  File "/usr/local/lib/python2.7/dist-packages/Abe/DataStore.py", line 412, in sql
    store.cursor.execute(cached, params)
  File "/usr/local/lib/python2.7/dist-packages/MySQLdb/cursors.py", line 174, in execute
    self.errorhandler(self, exc, value)
  File "/usr/local/lib/python2.7/dist-packages/MySQLdb/connections.py", line 36, in defaulterrorhandler
    raise errorclass, errorvalue
OperationalError: (1054, "Unknown column 'last_value' in 'field list'")
error: sql error: <OMITTED ADRESS>
Traceback (most recent call last):
  File "/home/animazing/src/electrum/server/backends/abe/__init__.py", line 87, in safe_sql
    ret = self.selectall(sql,params)
  File "/usr/local/lib/python2.7/dist-packages/Abe/DataStore.py", line 510, in _selectall
    store.sql(stmt, params)
  File "/usr/local/lib/python2.7/dist-packages/Abe/DataStore.py", line 412, in sql
    store.cursor.execute(cached, params)
  File "/usr/local/lib/python2.7/dist-packages/MySQLdb/cursors.py", line 174, in execute
    self.errorhandler(self, exc, value)
  File "/usr/local/lib/python2.7/dist-packages/MySQLdb/connections.py", line 36, in defaulterrorhandler
    raise errorclass, errorvalue
OperationalError: (1054, "Unknown column 'last_value' in 'field list'")
error: sql error: <OMITTED ADRESS>
Traceback (most recent call last):
  File "/home/animazing/src/electrum/server/backends/abe/__init__.py", line 87, in safe_sql
    ret = self.selectall(sql,params)
  File "/usr/local/lib/python2.7/dist-packages/Abe/DataStore.py", line 510, in _selectall
    store.sql(stmt, params)
  File "/usr/local/lib/python2.7/dist-packages/Abe/DataStore.py", line 412, in sql
    store.cursor.execute(cached, params)
  File "/usr/local/lib/python2.7/dist-packages/MySQLdb/cursors.py", line 174, in execute
    self.errorhandler(self, exc, value)
  File "/usr/local/lib/python2.7/dist-packages/MySQLdb/connections.py", line 36, in defaulterrorhandler
    raise errorclass, errorvalue
OperationalError: (1054, "Unknown column 'last_value' in 'field list'")
error: sql error: <OMITTED ADRESS>
Traceback (most recent call last):
  File "/home/animazing/src/electrum/server/backends/abe/__init__.py", line 87, in safe_sql
    ret = self.selectall(sql,params)
  File "/usr/local/lib/python2.7/dist-packages/Abe/DataStore.py", line 510, in _selectall
    store.sql(stmt, params)
  File "/usr/local/lib/python2.7/dist-packages/Abe/DataStore.py", line 412, in sql
    store.cursor.execute(cached, params)
  File "/usr/local/lib/python2.7/dist-packages/MySQLdb/cursors.py", line 174, in execute
    self.errorhandler(self, exc, value)
  File "/usr/local/lib/python2.7/dist-packages/MySQLdb/connections.py", line 36, in defaulterrorhandler
    raise errorclass, errorvalue
OperationalError: (1054, "Unknown column 'last_value' in 'field list'")
error: sql error: <OMITTED ADRESS>
Traceback (most recent call last):
  File "/home/animazing/src/electrum/server/backends/abe/__init__.py", line 87, in safe_sql
    ret = self.selectall(sql,params)
  File "/usr/local/lib/python2.7/dist-packages/Abe/DataStore.py", line 510, in _selectall
    store.sql(stmt, params)
  File "/usr/local/lib/python2.7/dist-packages/Abe/DataStore.py", line 412, in sql
    store.cursor.execute(cached, params)
  File "/usr/local/lib/python2.7/dist-packages/MySQLdb/cursors.py", line 174, in execute
    self.errorhandler(self, exc, value)
  File "/usr/local/lib/python2.7/dist-packages/MySQLdb/connections.py", line 36, in defaulterrorhandler
    raise errorclass, errorvalue
OperationalError: (1054, "Unknown column 'last_value' in 'field list'")
error: sql error: <OMITTED ADRESS>
Traceback (most recent call last):
  File "/home/animazing/src/electrum/server/backends/abe/__init__.py", line 87, in safe_sql
    ret = self.selectall(sql,params)
  File "/usr/local/lib/python2.7/dist-packages/Abe/DataStore.py", line 510, in _selectall
    store.sql(stmt, params)
  File "/usr/local/lib/python2.7/dist-packages/Abe/DataStore.py", line 412, in sql
    store.cursor.execute(cached, params)
  File "/usr/local/lib/python2.7/dist-packages/MySQLdb/cursors.py", line 174, in execute
    self.errorhandler(self, exc, value)
  File "/usr/local/lib/python2.7/dist-packages/MySQLdb/connections.py", line 36, in defaulterrorhandler
    raise errorclass, errorvalue
OperationalError: (1054, "Unknown column 'last_value' in 'field list'")
error: sql error: <OMITTED ADRESS>
Traceback (most recent call last):
  File "/home/animazing/src/electrum/server/backends/abe/__init__.py", line 87, in safe_sql
    ret = self.selectall(sql,params)
  File "/usr/local/lib/python2.7/dist-packages/Abe/DataStore.py", line 510, in _selectall
    store.sql(stmt, params)
  File "/usr/local/lib/python2.7/dist-packages/Abe/DataStore.py", line 412, in sql
    store.cursor.execute(cached, params)
  File "/usr/local/lib/python2.7/dist-packages/MySQLdb/cursors.py", line 174, in execute
    self.errorhandler(self, exc, value)
  File "/usr/local/lib/python2.7/dist-packages/MySQLdb/connections.py", line 36, in defaulterrorhandler
    raise errorclass, errorvalue
OperationalError: (1054, "Unknown column 'last_value' in 'field list'")
error: sql error: <OMITTED ADRESS>
Traceback (most recent call last):
  File "/home/animazing/src/electrum/server/backends/abe/__init__.py", line 87, in safe_sql
    ret = self.selectall(sql,params)
  File "/usr/local/lib/python2.7/dist-packages/Abe/DataStore.py", line 510, in _selectall
    store.sql(stmt, params)
  File "/usr/local/lib/python2.7/dist-packages/Abe/DataStore.py", line 412, in sql
    store.cursor.execute(cached, params)
  File "/usr/local/lib/python2.7/dist-packages/MySQLdb/cursors.py", line 174, in execute
    self.errorhandler(self, exc, value)
  File "/usr/local/lib/python2.7/dist-packages/MySQLdb/connections.py", line 36, in defaulterrorhandler
    raise errorclass, errorvalue
OperationalError: (1054, "Unknown column 'last_value' in 'field list'")
error: sql error: <OMITTED ADRESS>
Traceback (most recent call last):
  File "/home/animazing/src/electrum/server/backends/abe/__init__.py", line 87, in safe_sql
    ret = self.selectall(sql,params)
  File "/usr/local/lib/python2.7/dist-packages/Abe/DataStore.py", line 510, in _selectall
    store.sql(stmt, params)
  File "/usr/local/lib/python2.7/dist-packages/Abe/DataStore.py", line 412, in sql
    store.cursor.execute(cached, params)
  File "/usr/local/lib/python2.7/dist-packages/MySQLdb/cursors.py", line 174, in execute
    self.errorhandler(self, exc, value)
  File "/usr/local/lib/python2.7/dist-packages/MySQLdb/connections.py", line 36, in defaulterrorhandler
    raise errorclass, errorvalue
OperationalError: (1054, "Unknown column 'last_value' in 'field list'")
error: sql error: <OMITTED ADRESS>
Traceback (most recent call last):
  File "/home/animazing/src/electrum/server/backends/abe/__init__.py", line 87, in safe_sql
    ret = self.selectall(sql,params)
  File "/usr/local/lib/python2.7/dist-packages/Abe/DataStore.py", line 510, in _selectall
    store.sql(stmt, params)
  File "/usr/local/lib/python2.7/dist-packages/Abe/DataStore.py", line 412, in sql
    store.cursor.execute(cached, params)
  File "/usr/local/lib/python2.7/dist-packages/MySQLdb/cursors.py", line 174, in execute
    self.errorhandler(self, exc, value)
  File "/usr/local/lib/python2.7/dist-packages/MySQLdb/connections.py", line 36, in defaulterrorhandler
    raise errorclass, errorvalue
OperationalError: (1054, "Unknown column 'last_value' in 'field list'")
error: sql error: <OMITTED ADRESS>
Traceback (most recent call last):
  File "/home/animazing/src/electrum/server/backends/abe/__init__.py", line 87, in safe_sql
    ret = self.selectall(sql,params)
  File "/usr/local/lib/python2.7/dist-packages/Abe/DataStore.py", line 510, in _selectall
    store.sql(stmt, params)
  File "/usr/local/lib/python2.7/dist-packages/Abe/DataStore.py", line 412, in sql
    store.cursor.execute(cached, params)
  File "/usr/local/lib/python2.7/dist-packages/MySQLdb/cursors.py", line 174, in execute
    self.errorhandler(self, exc, value)
  File "/usr/local/lib/python2.7/dist-packages/MySQLdb/connections.py", line 36, in defaulterrorhandler
    raise errorclass, errorvalue
OperationalError: (1054, "Unknown column 'last_value' in 'field list'")

Edited out the addresses but other then that it is as is. It also looks like my client might be stuck synchronizing.

Should I worry about this?

Edit: I get the errors each time I want to connect to the server with my client.


Title: Re: Electrum server discussion thread
Post by: ThomasV on June 22, 2012, 11:27:17 AM
Updated my server but go this while starting it back up.

...

Edited out the addresses but other then that it is as is. It also looks like my client might be stuck synchronizing.

Should I worry about this?

Edit: I get the errors each time I want to connect to the server with my client.

I guess this is a schema change in abe
try to run the abe update script:

Code:
python -m Abe.abe --config your_abe_config_file


Title: Re: Electrum server discussion thread
Post by: Tachikoma on June 22, 2012, 11:29:50 AM
I already updated Abe yesterday. Will give it a try though.

Edit: No dice, seems this commit (https://gitorious.org/electrum/server/commit/b8cf75c6438d5a0633c4010d1ee3dfee1e8ccad7/diffs/74a20cd58fddb7c95835e8b05365afb6aa64a2d5) might have something to do with it since it errors on this column.


Title: Re: Electrum server discussion thread
Post by: ThomasV on June 22, 2012, 11:57:22 AM
I already updated Abe yesterday. Will give it a try though.

Edit: No dice, seems this commit (https://gitorious.org/electrum/server/commit/b8cf75c6438d5a0633c4010d1ee3dfee1e8ccad7/diffs/74a20cd58fddb7c95835e8b05365afb6aa64a2d5) might have something to do with it since it errors on this column.

indeed. I removed the call to new_id() because it was creating a new id.
however, the request might not work on all databases. (I use postgresql)


Title: Re: Electrum server discussion thread
Post by: anfedorov on June 22, 2012, 01:10:35 PM
no, there is no guarantee that different servers will configure their clock with the same time.

Why not just use UTC?

in addition, get_history will be extended, and it should be completely deterministic;
a hash of the history will be used to avoid the server resending the whole history everytime it changes.

Then just remove the received time before hashing? Or just use the hash of the last block a client knows of to identify how much history is missing?

I'm not sure if I understand how inputs/outputs can be used to sort transactions... could you expound?

when transactions are in the same block, they are logically ordered; you cannot spend coins before you receive them

That's a very sparse ordering. Say I receive transactions from three different accounts 5 minutes apart. As of now, it's quite possible for me to see the oldest transaction at the top of my transaction list, with the newer transactions below it. If I'm expecting them and keeping an eye on the list as I'm receiving them, that's a really obvious and confusing bug, and a horrible UX.

Or say you need to send out several transactions in a row, there are a ton of use cases where seeing them in the same order you sent them might be important. Again, the current situation can lead to bad UX.

The blockchain.info API seems to provide the received time for transactions without much issue, why can't Electrum?

Edit: sorting by tx_id when transactions belong to the same block seems to partially mitigate the issue. It doesn't fix transactions which take time to be confirmed, however...


Title: Re: Electrum server discussion thread
Post by: Tachikoma on June 22, 2012, 01:51:08 PM
I already updated Abe yesterday. Will give it a try though.

Edit: No dice, seems this commit (https://gitorious.org/electrum/server/commit/b8cf75c6438d5a0633c4010d1ee3dfee1e8ccad7/diffs/74a20cd58fddb7c95835e8b05365afb6aa64a2d5) might have something to do with it since it errors on this column.

indeed. I removed the call to new_id() because it was creating a new id.
however, the request might not work on all databases. (I use postgresql)

There is no last_value on MySQL as far as I am aware. Would it be possible to replace:

Code:
        current_id = self.safe_sql("""SELECT last_value FROM tx_seq""")
        current_id = current_id[0][0]

With

Code:
        current_id = self.safe_sql("""SELECT * FROM tx_seq ORDER BY id DESC LIMIT 1""")
        current_id = current_id[0][0]

Since my server crashes I can't be sure what current_id is returning on Postgre.


Title: Re: Electrum server discussion thread
Post by: ajze on June 23, 2012, 02:00:36 AM
I already updated Abe yesterday. Will give it a try though.

Edit: No dice, seems this commit (https://gitorious.org/electrum/server/commit/b8cf75c6438d5a0633c4010d1ee3dfee1e8ccad7/diffs/74a20cd58fddb7c95835e8b05365afb6aa64a2d5) might have something to do with it since it errors on this column.

indeed. I removed the call to new_id() because it was creating a new id.
however, the request might not work on all databases. (I use postgresql)

There is no last_value on MySQL as far as I am aware. Would it be possible to replace:

Code:
        current_id = self.safe_sql("""SELECT last_value FROM tx_seq""")
        current_id = current_id[0][0]

With

Code:
        current_id = self.safe_sql("""SELECT * FROM tx_seq ORDER BY id DESC LIMIT 1""")
        current_id = current_id[0][0]

Since my server crashes I can't be sure what current_id is returning on Postgre.

This is the same bug I'm getting.  I didn't even realize that PostgreSQL was an option.  If you're trying to support several different databases, you might want to consider a database abstraction layer, such as ADOdb.  It will make things much easier for you.

As a temporary solution something like this should be compatible with both:

Code:
        current_id = self.safe_sql("""SELECT max(id) FROM tx_seq""");

If the table is indexed properly, it should be just as fast, too.  I'll try it on my node later and let you know how it works.


Title: Re: Electrum server discussion thread
Post by: Tachikoma on June 23, 2012, 07:04:01 AM

Code:
        current_id = self.safe_sql("""SELECT max(id) FROM tx_seq""");

If the table is indexed properly, it should be just as fast, too.  I'll try it on my node later and let you know how it works.


I tried that first but I got a tuple error of some kind. Let me know if you have more luck.


Title: Re: Electrum server discussion thread
Post by: ThomasV on June 23, 2012, 12:11:19 PM

...

What you are proposing is that Electrum servers store information that is not in the bitcoin blockchain.
There are more obvious uses to it than just sorting transactions. For example servers could store transaction labels.

This is beyond scope, at least for now.
It would involve an extra layer and infrastructure, and it would be a bad idea to mix such requests with the stratum commands.



Title: Re: Electrum server discussion thread
Post by: anfedorov on June 23, 2012, 12:28:03 PM

...

What you are proposing is that Electrum servers store information that is not in the bitcoin blockchain.
There are more obvious uses to it than just sorting transactions. For example servers could store transaction labels.

This is beyond scope, at least for now.
It would involve an extra layer and infrastructure, and it would be a bad idea to mix such requests with the stratum commands.

That makes sense. Thanks for the thorough explanations.

I realize it's a bit of a hack, but do you see any practical drawbacks or issues in using tx_id fields for sorting transactions when their timestamp fields are equal? That seems to work well in addressing my UX concerns.


Title: Re: Electrum server discussion thread
Post by: ThomasV on June 23, 2012, 12:38:29 PM

...

What you are proposing is that Electrum servers store information that is not in the bitcoin blockchain.
There are more obvious uses to it than just sorting transactions. For example servers could store transaction labels.

This is beyond scope, at least for now.
It would involve an extra layer and infrastructure, and it would be a bad idea to mix such requests with the stratum commands.

That makes sense. Thanks for the thorough explanations.

I realize it's a bit of a hack, but do you see any practical drawbacks or issues in using tx_id fields for sorting transactions when their timestamp fields are equal? That seems to work well in addressing my UX concerns.

tx_id is not part of the protocol and should not be sent at all by the server.
it is a field that is only returned by abe-based servers, not servers using libbitcoin


Title: Re: Electrum server discussion thread
Post by: bitfoo on June 23, 2012, 08:59:40 PM

Code:
        current_id = self.safe_sql("""SELECT max(id) FROM tx_seq""");

If the table is indexed properly, it should be just as fast, too.  I'll try it on my node later and let you know how it works.


I tried that first but I got a tuple error of some kind. Let me know if you have more luck.

I can confirm that SELECT max(id) works for me on a MySQL server.


Title: Re: Electrum server discussion thread
Post by: ajze on June 23, 2012, 10:34:49 PM
Nevermind.  After accidentally trashing my db for the 10th time, I'm declaring the current solution of bitcoind+abe+electrum server [edit]annoying[/edit].  I'll come back when it's not a full time job just to get it to run.


Edit:
Sorry, I was very frustrated.  Now that I've calmed down, I'm going to try to help fix things instead of complaining :)


Title: Re: Electrum server discussion thread
Post by: TehZomB on June 24, 2012, 01:16:26 AM
If I am running bitcoind daemon and an Electrum server, do both programs download the block chain separately?


Title: Re: Electrum server discussion thread
Post by: ajze on June 24, 2012, 01:40:32 AM
If I am running bitcoind daemon and an Electrum server, do both programs download the block chain separately?

bitcoind downloads the blockchain, then Electrum server (with the help of Abe) reads it and puts it in an SQL database to make it easier to query.


Title: Re: Electrum server discussion thread
Post by: anfedorov on June 24, 2012, 04:15:44 AM

I realize it's a bit of a hack, but do you see any practical drawbacks or issues in using tx_id fields for sorting transactions when their timestamp fields are equal? That seems to work well in addressing my UX concerns.

tx_id is not part of the protocol and should not be sent at all by the server.
it is a field that is only returned by abe-based servers, not servers using libbitcoin

D'oh! Story of my life.

It would really help if it were possible to recover those protocol docs (the link you posted on another thread is still down). What is libbitcoin? It seems like it might help to document the different kinds of servers, as well...


Title: Re: Electrum server discussion thread
Post by: vuce on June 24, 2012, 11:57:50 PM
Is there a way of getting "blockchain.address.get_history" from a certain block hash onwards only? I'd imagine downloading full history of some addresses with a lot of traffic might be somewhat resource-consuming.

Maybe something like:
Code:
{
  "id": 0,
  "method": "blockchain.address.get_history",
  "params": [
    "17Su3J2RWnm2WLqf8pfpgj4hFUf6MFH9SZ",
    "000000000000077b2195a0c9db6f4179cb98ef579f300943b3a69357ac9e2028"
  ]
}

With the block hash from subscribe this could be very useful.


Title: Re: Electrum server discussion thread
Post by: Red Emerald on June 25, 2012, 04:13:18 AM
I should have another server up again soon.  I ran one for a little bit, but then Abe died and I haven't bothered since.


Title: Re: Electrum server discussion thread
Post by: bitfoo on June 25, 2012, 04:30:47 AM
I'm now running a server as well to hopefully provide some redundancy for users.


Title: Re: Electrum server discussion thread
Post by: ThomasV on June 25, 2012, 06:15:27 AM
Is there a way of getting "blockchain.address.get_history" from a certain block hash onwards only? I'd imagine downloading full history of some addresses with a lot of traffic might be somewhat resource-consuming.

Maybe something like:
Code:
{
  "id": 0,
  "method": "blockchain.address.get_history",
  "params": [
    "17Su3J2RWnm2WLqf8pfpgj4hFUf6MFH9SZ",
    "000000000000077b2195a0c9db6f4179cb98ef579f300943b3a69357ac9e2028"
  ]
}

With the block hash from subscribe this could be very useful.

yes, I am planning something like that.
get_status will be deprecated, and the client will send a hash of its current history


Title: Re: Electrum server discussion thread
Post by: ThomasV on June 26, 2012, 02:32:22 PM
Can I ask you what kind of resources a electrum server uses or rather what kind of resources I should dedicate to it to have it running stable.

post scriptum:
 * make sure you use a 64-bit OS
 * the first time you import the blockchain in abe, stop bitcoind during the import, it will go much faster.
 * I do not currently use a SSD for ecdsa.org, but I would pick a VPS with SSD if I had to redo this


Title: Re: Electrum server discussion thread
Post by: vuce on June 27, 2012, 05:09:19 PM
Thomas, is there any specification for the server commands? I have trouble with some of the "methods" (namely "blockchain.address.subscribe"), but it might be due to me not understanding what it actually does. I've looked at the stratum protocol draft (I'm assuming electrum uses this or is at least based on it?) but it doesn't seem to have any real info either.


Title: Re: Electrum server discussion thread
Post by: ThomasV on June 27, 2012, 05:10:48 PM
Thomas, is there any specification for the server commands? I have trouble with some of the "methods" (namely "blockchain.address.subscribe"), but it might be due to me not understanding what it actually does. I've looked at the stratum protocol draft (I'm assuming electrum uses this or is at least based on it?) but it doesn't seem to have any real info either.

the specs are hosted on the bitcoinconsultancy wiki. that wiki is down atm. there is no ETA afaik


Title: Re: Electrum server discussion thread
Post by: genjix on June 27, 2012, 05:19:53 PM
vuce, i made an implementation of the server backend and created the server frontend so i can help you out. you should come to #electrum on Freenode.


Title: Re: Electrum server discussion thread
Post by: vuce on June 27, 2012, 08:37:15 PM
vuce, i made an implementation of the server backend and created the server frontend so i can help you out. you should come to #electrum on Freenode.
Managed to figure it out, but I'll drop by if I have any more questions, thanks genjix!


Title: Re: Electrum server discussion thread
Post by: bitfoo on July 08, 2012, 06:28:18 AM
Here's a note about running the electrum server on a 32-bit machine. The issue is that abe tries to mmap the blk000x.dat file, which may be too large to fit in 32-bit virtual memory. I use a patch for bitcoin that reduces the max size of each dat file to ~500MB:

Code:
diff -ur bitcoin-0.6.2_orig/src/main.cpp bitcoin-0.6.2/src/main.cpp
--- bitcoin-0.6.2_orig/src/main.cpp 2012-07-07 23:18:28.365376724 -0700
+++ bitcoin-0.6.2/src/main.cpp 2012-06-19 18:40:45.842931405 -0700
@@ -1865,7 +1865,7 @@
         if (fseek(file, 0, SEEK_END) != 0)
             return NULL;
         // FAT32 filesize max 4GB, fseek and ftell max 2GB, so we must stay under 2GB
-        if (ftell(file) < 0x7F000000 - MAX_SIZE)
+        if (ftell(file) < 0x1F000000 - MAX_SIZE)
         {
             nFileRet = nCurrentBlockFile;
             return file;

The idea for this patch comes from this post (https://bitcointalk.org/index.php?topic=22785.msg777150#msg777150) by John Tobey. The "right" way to do this may be to fix abe to only mmap the file partially, but until then, this little hack works.


Title: Re: Electrum server discussion thread
Post by: wabber on July 12, 2012, 01:54:26 PM
I've set up an electrum server some time ago for me and my friends because we didn't want to download the blockchain. I've made it public now, it doesn't have a domain but the IP should show up in the server list: 176.9.206.164



Title: Re: Electrum server discussion thread
Post by: marcus_of_augustus on July 13, 2012, 09:58:04 PM

So I notice there are currently 6 servers the Electrum client is aware of ... just wondering if the servers can be made aware of other servers in the same way that the client is?


Title: Re: Electrum server discussion thread
Post by: wabber on July 13, 2012, 11:42:20 PM

So I notice there are currently 6 servers the Electrum client is aware of ... just wondering if the servers can be made aware of other servers in the same way that the client is?

I didn't take a closer look to the source but i think electrum uses irc to find servers, so yeah it wouldn't be a problem for the server to be aware of other servers. But why would you need that?


Title: Re: Electrum server discussion thread
Post by: marcus_of_augustus on July 15, 2012, 08:41:45 AM

So I notice there are currently 6 servers the Electrum client is aware of ... just wondering if the servers can be made aware of other servers in the same way that the client is?

I didn't take a closer look to the source but i think electrum uses irc to find servers, so yeah it wouldn't be a problem for the server to be aware of other servers. But why would you need that?

It makes possible the linking of servers into groups for auditing, cross-checking, etc. It offers other possibilities like a stratum network on top of bitcoin, a server-to-server network, or even just groupings of servers that electrum clients could log into and be ambivalent about which precise server they are referencing just that it is one of a trusted group, etc ... it may be easier for electrum servers to get blockchain update information directly from other electrum servers (in addition to the bitcoin network) since they share db architecture ...

... and lots of other reasons ;)

Basically a network of servers is stronger and less centralised than nodes of lone, isolated servers.


Title: Re: Electrum server discussion thread
Post by: unclemantis on July 15, 2012, 12:08:55 PM
do the electrum servers have the available to be connected using rpcjson? I am currently using blockchain.info but I would like to be able to use an electrum server.


Title: Re: Electrum server discussion thread
Post by: duncant on July 25, 2012, 06:29:45 AM
Hi! I just upgraded my server to the lastest git version. I'm getting the following error when I try to run the server
Code:
Starting Electrum server on uncle-enzo.info
Traceback (most recent call last):
  File "/var/bitcoin/bin/electrum-server", line 122, in <module>
    chain_proc = backend.BlockchainProcessor(config)
  File "/var/bitcoin/src/electrum/server/backends/abe/__init__.py", line 452, in __init__
    self.store = AbeStore(config)
  File "/var/bitcoin/src/electrum/server/backends/abe/__init__.py", line 39, in __init__
    print 'Coin chain_id = %d' % self.chain_id
TypeError: %d format: a number is required, not NoneType

Is there a setting that I need to make the new version work?


Title: Re: Electrum server discussion thread
Post by: Tachikoma on July 25, 2012, 07:08:59 PM
I think the latest git version has multi-chain support build in. Open up your config file (/etc/electrum.conf) and add the following under the [server] part:

Code:
coin=bitcoin
datadir=/home/myuser/.bitcoin

Replace the datadir with the path to your bitcoind config folder.


Title: Re: Electrum server discussion thread
Post by: duncant on July 26, 2012, 06:25:51 AM
I'm still getting the same error after adding those lines to my electrum.conf.


Title: Re: Electrum server discussion thread
Post by: Tachikoma on July 26, 2012, 07:40:54 AM
Try to run this query on your electrum database

Code:
update datadir set chain_id=1 where datadir_id =1

Or manually open the datadir table and put chain_id to one for the correct row.


Title: Re: Electrum server discussion thread
Post by: duncant on July 26, 2012, 06:57:44 PM
That fixed it! Thanks!


Title: Re: Electrum server discussion thread
Post by: unclemantis on July 28, 2012, 03:28:42 PM
Until the servers can be more stable and the windows version of the application can connect to the servers on a constant basis, I will be using Multibit which I am happy to say is more forgiving of glitches. There is even a nifty rollback feature.


Title: Re: Electrum server discussion thread
Post by: Tachikoma on July 28, 2012, 06:39:51 PM
Until the servers can be more stable and the windows version of the application can connect to the servers on a constant basis, I will be using Multibit which I am happy to say is more forgiving of glitches. There is even a nifty rollback feature.

This feels kinda passive aggressive in my humble opinion. You post in a thread to tell us you are _not_ using the client the thread is dedicated to.


Title: Re: Electrum server discussion thread
Post by: unclemantis on July 29, 2012, 01:13:00 AM
Until the servers can be more stable and the windows version of the application can connect to the servers on a constant basis, I will be using Multibit which I am happy to say is more forgiving of glitches. There is even a nifty rollback feature.

This feels kinda passive aggressive in my humble opinion. You post in a thread to tell us you are _not_ using the client the thread is dedicated to.

You make me sound like a Troll :(


Title: Re: Electrum server discussion thread
Post by: JompinDox on August 22, 2012, 08:57:13 PM
I'm thinking of setting up a server... Just wondering, how many users connect to a given server per day, on average?


Title: Re: Electrum server discussion thread
Post by: Tuxavant on September 04, 2012, 05:49:42 PM
Where can I get the latest stratum software?


Title: Re: Electrum server discussion thread
Post by: flatfly on September 05, 2012, 08:12:40 AM
Where can I get the latest stratum software?

Should be here:
 https://github.com/spesmilo/electrum-server


Title: Re: Electrum server discussion thread
Post by: Tuxavant on September 05, 2012, 06:21:16 PM
Thanks Flatfly.... Throwing some errors when applying the patches..

Code:
$ patch -p 2 < ~/src/electrum/server/patches/bitcoin-0.6.2.diff 
patching file bitcoinrpc.cpp
Hunk #1 FAILED at 1497.
Hunk #2 FAILED at 1933.
Hunk #3 FAILED at 2055.
3 out of 3 hunks FAILED -- saving rejects to file bitcoinrpc.cpp.rej
patching file main.cpp
Hunk #1 FAILED at 3134.
1 out of 1 hunk FAILED -- saving rejects to file main.cpp.rej
patching file main.h
Hunk #1 FAILED at 395.
Hunk #2 FAILED at 416.
2 out of 2 hunks FAILED -- saving rejects to file main.h.rej


Title: Re: Electrum server discussion thread
Post by: bitfoo on September 05, 2012, 08:40:08 PM
Thanks Flatfly.... Throwing some errors when applying the patches..

Code:
$ patch -p 2 < ~/src/electrum/server/patches/bitcoin-0.6.2.diff 

The latest bitcoin patch I see on git is bitcoin-0.6.3 diff. Are you trying to apply bitcoin-0.6.2.diff to bitcoin 0.6.3?


Title: Re: Electrum server discussion thread
Post by: Tuxavant on September 05, 2012, 10:30:19 PM
good call... it was indeed the wrong patch/version, but then,

There doesn't appear to be a ..../bitcoin-0.6.3.diff patch file, so I went with 0.6.2

Code:
$ tar zxvf bitcoin-0.6.2.tgz 
bitcoin@host:~/src$ mv bitcoin-bitcoin-06d764e bitcoin-0.6.2
bitcoin@host:~/src$ cd bitcoin-0.6.2
bitcoin@host:~/src/bitcoin-0.6.2$ patch -p 2 < ~/src/electrum/server/patches/bitcoin-0.6.2.diff
patching file bitcoinrpc.cpp
Hunk #1 FAILED at 1497.
Hunk #2 FAILED at 1933.
Hunk #3 FAILED at 2055.
3 out of 3 hunks FAILED -- saving rejects to file bitcoinrpc.cpp.rej
patching file main.cpp
Hunk #1 FAILED at 3134.
1 out of 1 hunk FAILED -- saving rejects to file main.cpp.rej
patching file main.h
Hunk #1 FAILED at 395.
Hunk #2 FAILED at 416.
2 out of 2 hunks FAILED -- saving rejects to file main.h.rej



Title: Re: Electrum server discussion thread
Post by: ErebusBat on September 05, 2012, 10:32:22 PM
There doesn't appear to be a ..../bitcoin-0.6.3.diff patch file
Are you sure you are on the correct version/branch in git?  Can you post your commit hash?


Title: Re: Electrum server discussion thread
Post by: Tuxavant on September 05, 2012, 10:44:44 PM
Are you sure you are on the correct version/branch in git?  Can you post your commit hash?

Code:
$ git show
commit d659a2f2020b052c8c33f4903091f2d0e64398f2


Title: Re: Electrum server discussion thread
Post by: Tachikoma on September 06, 2012, 08:26:35 AM
Are you sure you are on the correct version/branch in git?  Can you post your commit hash?

Code:
$ git show
commit d659a2f2020b052c8c33f4903091f2d0e64398f2

I think you are on the wrong branch or repo. Here is a direct link (https://github.com/spesmilo/electrum-server/blob/master/patches/bitcoin-0.6.3.diff) to the 6.3 patch.


Title: Re: Electrum server discussion thread
Post by: slush on September 24, 2012, 04:18:27 PM
Independent server monitoring: https://bitcointalk.org/index.php?topic=112413.0


Title: Re: Electrum server discussion thread
Post by: Tachikoma on October 02, 2012, 09:52:02 PM
Independent server monitoring: https://bitcointalk.org/index.php?topic=112413.0

First implementation online, see  this post (https://bitcointalk.org/index.php?topic=112413.msg1240320#msg1240320).


Title: Re: Electrum server discussion thread
Post by: duncant on October 09, 2012, 01:59:54 AM
Hi all!

I've been trying to move my server uncle-enzo.info to a new/better host uncle-enzo.mit.edu, but things have gone horribly wrong.

The initial abe import went just fine. I can start the server and it prints the correct number of blocks. When I fire up my client, the server prints a flurry of "discarding tx id ..." messages followed by the typical "[<datetime>] TCP <ip address> <bitocin address> <address count> <client version>" message. After that, everything just hangs. My client gets stuck on "Connecting..." and nothing more interesting happens on the server end.

Do you have any idea what could be going on? Thank you!


Title: Re: Electrum server discussion thread
Post by: Tachikoma on October 09, 2012, 07:31:52 AM
Can you reach Bitcoind normally? bitcoind getbalance etc. works?


Title: Re: Electrum server discussion thread
Post by: duncant on October 09, 2012, 03:41:12 PM
Yes. Bitcoind responds to all its commands appropriately.


Title: Re: Electrum server discussion thread
Post by: duncant on October 10, 2012, 05:36:27 PM
During startup, the server prints the following error message. Perhaps this has something to do with the problem I'm having?
Code:
Exception in thread Thread-2:
Traceback (most recent call last):
  File "/usr/lib/python2.7/threading.py", line 551, in __bootstrap_inner
    self.run()
  File "/usr/share/electrum-server/processor.py", line 246, in run
    self.update()
  File "/usr/share/electrum-server/processor.py", line 260, in update
    self.send_response(internal_id, response)
  File "/usr/share/electrum-server/processor.py", line 276, in send_response
    session.send_response(response)
  File "/usr/share/electrum-server/transports/stratum_tcp.py", line 30, in send_response
    data = json.dumps(response) + "\n"
  File "/usr/lib/python2.7/json/__init__.py", line 231, in dumps
    return _default_encoder.encode(obj)
  File "/usr/lib/python2.7/json/encoder.py", line 201, in encode
    chunks = self.iterencode(o, _one_shot=True)
  File "/usr/lib/python2.7/json/encoder.py", line 264, in iterencode
    return _iterencode(o, 0)
  File "/usr/lib/python2.7/json/encoder.py", line 178, in default
    raise TypeError(repr(o) + " is not JSON serializable")
TypeError: <read-only buffer for 0x48db490, size 25, offset 0 at 0x48fc870> is not JSON serializable


Title: Re: Electrum server discussion thread
Post by: ThomasV on October 10, 2012, 07:18:31 PM
Hi all!

I've been trying to move my server uncle-enzo.info to a new/better host uncle-enzo.mit.edu, but things have gone horribly wrong.

The initial abe import went just fine. I can start the server and it prints the correct number of blocks. When I fire up my client, the server prints a flurry of "discarding tx id ..." messages followed by the typical "[<datetime>] TCP <ip address> <bitocin address> <address count> <client version>" message. After that, everything just hangs. My client gets stuck on "Connecting..." and nothing more interesting happens on the server end.

Do you have any idea what could be going on? Thank you!

I would try to rebuild of the abe database from scratch. (I know, it is slow...)


Title: Re: Electrum server discussion thread
Post by: ErebusBat on October 11, 2012, 08:45:08 PM
I would try to rebuild of the abe database from scratch. (I know, it is slow...)
See ya in 3 weeks duncant :/


Title: Re: Electrum server discussion thread
Post by: duncant on October 12, 2012, 04:26:28 AM
I would try to rebuild of the abe database from scratch. (I know, it is slow...)
See ya in 3 weeks duncant :/

Okay, so I rebuilt the database. The first time I fired up the server, it worked perfectly. I started it with "cache = no" and "irc = no". After testing it, I wanted to enable those, so I stopped the server, which worked fine. I edited the config file and restarted the server. As soon as it started up, I got the traceback that I posted above and it doesn't work again. About 1 in 10 times, the server starts properly, the rest of the time I get the traceback above.

Another thing to note, is that when the server wasn't working properly, and I went to shut it down, "electrum-server stop" hung, without printing the "ok" message. The server did shut itself down, but the "electrum-server stop" command never finished. When I Ctrl-C'd it it printed the following traceback:

Code:
Traceback (most recent call last):
  File "/usr/bin/electrum-server", line 101, in <module>
    run_rpc_command(sys.argv[1], stratum_tcp_port)
  File "/usr/bin/electrum-server", line 75, in run_rpc_command
    o = s.recv(1024)
KeyboardInterrupt

=========== Frustration break occurred here ==========

As an experiment, I tried starting the server with iptables preventing incoming connections on port 50000. I waited until the "block number: XXXXXX" message was printed, then opened the firewall. I tried that a couple of times, and It appears to work fine when I do that. Perhaps there's a race condition between the stratum thread and the thread that interfaces with the database?


Title: Re: Electrum server discussion thread
Post by: duncant on October 12, 2012, 05:37:48 AM
I tried starting the server with iptables preventing incoming connections on port 50000

and by port 50000 I mean port 50001


Title: Re: Electrum server discussion thread
Post by: slush on October 12, 2012, 05:49:36 PM
That "KeyboardInterrupt" traceback is just telling you that you interrupted the script by Ctrl+C, nothing more.

electrum-stop script is connecting to the server over RPC, so if server is loading block database or is busy with something else, it won't response. Please send "tail electrum.log" here. You can also check "top" command; if database is under load, then electrum is updating Abe db.


Title: Re: Electrum server discussion thread
Post by: duncant on October 12, 2012, 06:08:52 PM
That "KeyboardInterrupt" traceback is just telling you that you interrupted the script by Ctrl+C, nothing more.
Right, I thought that the relevant bit of that traceback was where the command was hanging.

electrum-stop script is connecting to the server over RPC, so if server is loading block database or is busy with something else, it won't response. Please send "tail electrum.log" here. You can also check "top" command; if database is under load, then electrum is updating Abe db.
I'm not quite sure what you're saying here, but the database isn't under any significant load. top shows that neither the python process, nor postgres are using any significant amounts of CPU. iotop also shows that there's no disk activity from either process.

Here's an example of the output when the server isn't running properly:
Code:
[bitcoin@uncle-enzo /]$ electrum-server
Starting Electrum server on uncle-enzo.mit.edu
Coin chain_id = 1
blockchain: 202904 blocks
TCP server started.
HTTP server started.
Exception in thread Thread-2:
Traceback (most recent call last):
  File "/usr/lib/python2.7/threading.py", line 551, in __bootstrap_inner
    self.run()
  File "/usr/share/electrum-server/processor.py", line 246, in run
    self.update()
  File "/usr/share/electrum-server/processor.py", line 260, in update
    self.send_response(internal_id, response)
  File "/usr/share/electrum-server/processor.py", line 276, in send_response
    session.send_response(response)
  File "/usr/share/electrum-server/transports/stratum_tcp.py", line 30, in send_response
    data = json.dumps(response) + "\n"
  File "/usr/lib/python2.7/json/__init__.py", line 231, in dumps
    return _default_encoder.encode(obj)
  File "/usr/lib/python2.7/json/encoder.py", line 201, in encode
    chunks = self.iterencode(o, _one_shot=True)
  File "/usr/lib/python2.7/json/encoder.py", line 264, in iterencode
    return _iterencode(o, 0)
  File "/usr/lib/python2.7/json/encoder.py", line 178, in default
    raise TypeError(repr(o) + " is not JSON serializable")
TypeError: <read-only buffer for 0x44606d0, size 25, offset 0 at 0x44664f0> is not JSON serializable

[12/10/2012-00:13:53] TCP <redacted> 10 1.0
[12/10/2012-00:13:53] TCP <redacted> 12 1.0
[12/10/2012-00:13:53] TCP <redacted> 7 1.01-e
[12/10/2012-00:13:54] TCP <redacted> 16 1.0
block number: 202904
Stopping Stratum
processor terminating
Server stopped
exit timer


I left the server running last night. It was working fine when I went to bed, but when I woke up this morning, I saw this in the logs, and the server is no longer responsive:
Code:
discarding tx id 3984266
discarding tx id 3984266
discarding tx id 4031277
discarding tx id 4031277
discarding tx id 4152198
discarding tx id 4320304
[12/10/2012-07:11:59] TCP <redacted> 7 1.0
[12/10/2012-07:13:13] TCP <redacted> 7 1.0
block number: 202952
block number: 202953
block number: 202954
[12/10/2012-07:39:06] TCP <redacted> 1 1.0
[12/10/2012-07:39:31] TCP <redacted> 1 1.01-e
discarding tx id 6769795
[12/10/2012-07:43:12] TCP <redacted> 8 0.52
block number: 202955
[12/10/2012-08:01:32] TCP <redacted> 7 0.61
block number: 202956
block number: 202957
[12/10/2012-08:04:07] TCP <redacted> 1 1.01-e
[12/10/2012-08:16:16] TCP <redacted> 1 1.01-e
[12/10/2012-08:19:01] TCP <redacted> 7 1.01-e
[12/10/2012-08:21:51] TCP <redacted> 7 1.01-e
[12/10/2012-08:25:39] TCP <redacted> 1 1.01-e
block number: 202958
[12/10/2012-08:32:03] TCP <redacted> 8 1.01-e
Exception in thread Thread-2:
Traceback (most recent call last):
  File "/usr/lib/python2.7/threading.py", line 551, in __bootstrap_inner
    self.run()
  File "/usr/share/electrum-server/processor.py", line 246, in run
    self.update()
  File "/usr/share/electrum-server/processor.py", line 260, in update
    self.send_response(internal_id, response)
  File "/usr/share/electrum-server/processor.py", line 276, in send_response
    session.send_response(response)
  File "/usr/share/electrum-server/transports/stratum_tcp.py", line 30, in send_response
    data = json.dumps(response) + "\n"
  File "/usr/lib/python2.7/json/__init__.py", line 231, in dumps
    return _default_encoder.encode(obj)
  File "/usr/lib/python2.7/json/encoder.py", line 201, in encode
    chunks = self.iterencode(o, _one_shot=True)
  File "/usr/lib/python2.7/json/encoder.py", line 264, in iterencode
    return _iterencode(o, 0)
  File "/usr/lib/python2.7/json/encoder.py", line 178, in default
    raise TypeError(repr(o) + " is not JSON serializable")
TypeError: <read-only buffer for 0x2f98d30, size 25, offset 0 at 0x2fe70b0> is not JSON serializable

[12/10/2012-08:32:30] TCP <redacted> 8 1.01-e
block number: 202959
[12/10/2012-08:40:05] TCP <redacted> 10 1.0
block number: 202960
[12/10/2012-08:44:31] TCP <redacted> 7 1.0
block number: 202961
discarding tx id 6478819
discarding tx id 6015062           
discarding tx id 5935605
discarding tx id 5935579
discarding tx id 5935292
discarding tx id 5933473


Title: Re: Electrum server discussion thread
Post by: slush on October 12, 2012, 06:16:00 PM
Can you please add "print response.__repr__()" to line /usr/share/electrum-server/transports/stratum_tcp.py, line 30?

It is now:
data = json.dumps(response) + "\n"

Should be:
print response.__repr__()
data = json.dumps(response) + "\n"

This will give us some info what information is server trying to serialize...


Title: Re: Electrum server discussion thread
Post by: duncant on October 12, 2012, 06:25:03 PM
Can you please add "print response.__repr__()" to line /usr/share/electrum-server/transports/stratum_tcp.py, line 30?

This is the object that it fails to serialize:
Code:
{'id': 15, 'result': [{'block_hash': '00000000000002d8c76e662906670ed570ccf1dcdab0f9ecc0fe40ff7aceda2d', 'is_input': 0, 'tx_hash': '39a539f1bf330287c259620b217232f5ea77d116f0f5a88d316d2957e4caf863', 'index': 1, 'outputs': ['1NFbPZr7KD3V8ZvjdssdnidepvjMSTARUZ', '1NAt9bC3fNCkoAXL2Bo3FqnXhWiZHb7vJ8'], 'timestamp': 1340853742, 'inputs': ['1DGUkqgt8ecdSmTtFosujuEx2nBxM2tXAQ'], 'value': 2000000000, 'height': 186565}, {'tx_hash': '5c297e69d89b2cdb8e46799711df7e8745aaed1e119652c9decaaf48e2140350', 'inputs': ['13HLfocvUzAz7dZghau3hpZJ2YhDRWzLMw', '1DqSR6MiL4kB62Z6YMmQ1KpPNsK23Kb5Po'], 'outputs': ['1372wdd5bwdwWf5HvzW7s8D9of6vcxFNj2', '1NAt9bC3fNCkoAXL2Bo3FqnXhWiZHb7vJ8'], 'height': 186572, 'block_hash': '00000000000002baa2474fa9bbcde9ff68cd1639d755a9dbeb933cc2e3fb8900', 'is_input': 0, 'index': 1, 'value': 6000000000, 'raw_output_script': <read-only buffer for 0x3bbe190, size 25, offset 0 at 0x3bc3130>, 'timestamp': 1340857517}, {'block_hash': '000000000000047f5c61faad21a0242ff37e087e804d0adeb3f9c61dd682a26d', 'is_input': 1, 'tx_hash': 'f32c96681776bc7065206ed53c6c62f0e47002384e5536153f4da243a5caed59', 'index': 0, 'outputs': ['1G7EXGeahYYmXsYVAfBjT9G8RjywhstuB8', '1BYKEj4odWztfvWXvYf6SvnQv5PtyRJiSp'], 'timestamp': 1348980703, 'inputs': ['1NAt9bC3fNCkoAXL2Bo3FqnXhWiZHb7vJ8'], 'value': -2000000000, 'height': 201182}, {'tx_hash': '5c297e69d89b2cdb8e46799711df7e8745aaed1e119652c9decaaf48e2140350', 'inputs': ['13HLfocvUzAz7dZghau3hpZJ2YhDRWzLMw', '1DqSR6MiL4kB62Z6YMmQ1KpPNsK23Kb5Po'], 'outputs': ['1372wdd5bwdwWf5HvzW7s8D9of6vcxFNj2', '1NAt9bC3fNCkoAXL2Bo3FqnXhWiZHb7vJ8'], 'height': 0, 'block_hash': 'mempool', 'is_input': 0, 'index': 1, 'value': 6000000000, 'raw_output_script': <read-only buffer for 0x3bbe110, size 25, offset 0 at 0x3bc3070>, 'timestamp': 0}, {'block_hash': 'mempool', 'is_input': 0, 'tx_hash': '39a539f1bf330287c259620b217232f5ea77d116f0f5a88d316d2957e4caf863', 'index': 1, 'outputs': ['1NFbPZr7KD3V8ZvjdssdnidepvjMSTARUZ', '1NAt9bC3fNCkoAXL2Bo3FqnXhWiZHb7vJ8'], 'timestamp': 0, 'inputs': ['1DGUkqgt8ecdSmTtFosujuEx2nBxM2tXAQ'], 'value': 2000000000, 'height': 0}, {'block_hash': 'mempool', 'is_input': 1, 'tx_hash': 'f32c96681776bc7065206ed53c6c62f0e47002384e5536153f4da243a5caed59', 'index': 0, 'outputs': ['1G7EXGeahYYmXsYVAfBjT9G8RjywhstuB8', '1BYKEj4odWztfvWXvYf6SvnQv5PtyRJiSp'], 'timestamp': 0, 'inputs': ['1NAt9bC3fNCkoAXL2Bo3FqnXhWiZHb7vJ8'], 'value': -2000000000, 'height': 0}]}


Title: Re: Electrum server discussion thread
Post by: slush on October 12, 2012, 06:44:09 PM
hm, there's "raw output script", which is buffer object. Something is broken here. Are you using latest git?


Title: Re: Electrum server discussion thread
Post by: duncant on October 12, 2012, 06:50:20 PM
hm, there's "raw output script", which is buffer object. Something is broken here. Are you using latest git?

Yes. I actually wrote an Archlinux PKGBUILD (http://pastebin.com/jRab1K3d) that clones git://github.com/spesmilo/electrum-server.git


Title: Re: Electrum server discussion thread
Post by: slush on October 12, 2012, 06:59:57 PM
Hm, raw output script should be in hex form. It looks like this variable is filled directly from the database (https://github.com/spesmilo/electrum-server/blob/master/backends/abe/__init__.py), so maybe this is related to version of Abe and/or postgresql driver in Abe?

I know that Abe is doing wild variable conversions for keeping compatibility with wide area of databases, so maybe this is question to Abe developers, more than Electrum developers...


Title: Re: Electrum server discussion thread
Post by: duncant on October 12, 2012, 07:05:01 PM
Hm, raw output script should be in hex form. It looks like this variable is filled directly from the database (https://github.com/spesmilo/electrum-server/blob/master/backends/abe/__init__.py), so maybe this is related to version of Abe and/or postgresql driver in Abe?

I know that Abe is doing wild variable conversions for keeping compatibility with wide area of databases, so maybe this is question to Abe developers, more than Electrum developers...

Oh! I set "binary-type = pg-bytea" in abe.conf. I'll bet that if I set it back to "binary-type = hex" it'll get fixed.


Title: Re: Electrum server discussion thread
Post by: slush on October 12, 2012, 07:47:36 PM
Good luck by reindexing blockchain again ;)


Title: Re: Electrum server discussion thread
Post by: duncant on October 15, 2012, 05:31:43 PM
The server has been running for ~48 hours with no problems, so I'm willing to declare this problem solved. In case anyone comes across this problem in the future, setting "binary-type = hex" in abe.conf did the trick.


Title: Re: Electrum server discussion thread
Post by: slush on October 15, 2012, 06:09:09 PM
The server has been running for ~48 hours with no problems, so I'm willing to declare this problem solved. In case anyone comes across this problem in the future, setting "binary-type = hex" in abe.conf did the trick.

So Abe on Postgre won't work with default Abe config? Maybe we should do some workaround in Electrum and expect binary data there. Converting binary data to hex isn't so hard and I bet that storing binary data in database will save lot of storage space...


Title: Re: Electrum server discussion thread
Post by: duncant on October 15, 2012, 06:22:59 PM
So Abe on Postgre won't work with default Abe config? Maybe we should do some workaround in Electrum and expect binary data there. Converting binary data to hex isn't so hard and I bet that storing binary data in database will save lot of storage space...

The default is for binary-type to be unset. I don't know what Abe does in that case. By setting "binary-type = pg-bytea", you force Abe to use Postgresql's BYTEA storage type. Setting "binary-type = hex" does the opposite and forces Abe to use hex strings instead.

The module binascii has a function hexlify that will convert buffer objects to hex strings.


Title: Re: Electrum server discussion thread
Post by: ThomasV on October 17, 2012, 07:40:47 PM
I pushed SSL support to the repo; it will be used by the next release of the client.
if you have a server, please upgrade  :)


Title: Re: Electrum server discussion thread
Post by: ThomasV on October 20, 2012, 11:09:42 AM
Two server upgrades this morning:

 - the protocol version is now 0.2. this indicates servers that have get_header and get_merkle

 - the server now uses 'getrawmempool' (bitcoind 0.7); with this version, you do not need to patch bitcoind anymore in order to run a server.


Title: Re: Electrum server discussion thread
Post by: slush on October 20, 2012, 09:33:23 PM
Thomas, what is wrong with getrawmempool in 0.7.0 ? On my server (renamed from california.stratum.bitcoin.cz to electrum.bitcoin.cz because of IRC limitation in name length), I'm using "getrawmempool" with 0.7.1 without any (obvious?) issues.

Btw thanks to my server update, electrum.bitcoin.cz now supports SSL!


Title: Re: Electrum server discussion thread
Post by: flatfly on October 20, 2012, 10:11:43 PM
Thomas, what is wrong with getrawmempool in 0.7.0 ? On my server (renamed from california.stratum.bitcoin.cz to electrum.bitcoin.cz because of IRC limitation in name length), I'm using "getrawmempool" with 0.7.1 without any (obvious?) issues.

Btw thanks to my server update, electrum.bitcoin.cz now supports SSL!

Confirmed, I'm now connected through SSL (using client 1.1) :)  Great stuff!

[EDIT] It seems the client is briefly losing its connection every minute or so (then spontaneously reconnects after a few seconds.)  I'm also getting this error message in the console:

 SSLError: The read operation timed out

https://i.imgur.com/LkIWB.png


Title: Re: Electrum server discussion thread
Post by: duncant on October 21, 2012, 01:50:12 AM
I updated uncle-enzo.mit.edu to the latest version of the server. I can't connect using TCP/SSL, though. Port 50002 is open, but I still get the "Failed to connect uncle-enzo.mit.edu:50002" message when I try to connect. I'm using a self-signed certificate, would that cause problems?


Title: Re: Electrum server discussion thread
Post by: ThomasV on October 26, 2012, 01:36:45 PM
I updated uncle-enzo.mit.edu to the latest version of the server. I can't connect using TCP/SSL, though. Port 50002 is open, but I still get the "Failed to connect uncle-enzo.mit.edu:50002" message when I try to connect. I'm using a self-signed certificate, would that cause problems?
no, you can use a self-signed certificate


Title: Re: Electrum server discussion thread
Post by: ThomasV on October 26, 2012, 01:38:56 PM
Today I updated the server source again, with a slight modification of the protocol (spv-related calls)
The current version of the protocol is 0.4 (visible in your server's irc "real name")
Please upgrade your server if you have not done so.


Title: Re: Electrum server discussion thread
Post by: ThomasV on November 04, 2012, 09:34:28 AM
I pushed another server update: version 0.5

This version requires the latest version of bitcoind (currently in git head), compiled with a new patch that is in the directory "patch"

This new protocol sends serialized transactions directly to the client, and will be required by electrum 1.3 clients.
So, please update your servers; I know it is a pain to have to patch bitcoind again, but this is necessary for spv.


Title: Re: Electrum server discussion thread
Post by: Raize on November 14, 2012, 04:16:48 PM
Is the HOWTO located below still accurate?
https://gitorious.org/electrum/server/blobs/master/HOWTO

Thanks.


Title: Re: Electrum server discussion thread
Post by: ThomasV on November 14, 2012, 05:13:55 PM
Is the HOWTO located below still accurate?
https://gitorious.org/electrum/server/blobs/master/HOWTO

Thanks.

not really.
the best source of feedback is IRC

I have been working on a new sever backend, that uses only bitcoind and not Abe.
it is almost ready. I'll catch up with the docs after that


Title: Re: Electrum server discussion thread
Post by: Red Emerald on November 14, 2012, 06:09:03 PM
Is the HOWTO located below still accurate?
https://gitorious.org/electrum/server/blobs/master/HOWTO

Thanks.

not really.
the best source of feedback is IRC

I have been working on a new sever backend, that uses only bitcoind and not Abe.
it is almost ready. I'll catch up with the docs after that
I'll test this the moment it's out! No libbitcoin or Abe?


Title: Re: Electrum server discussion thread
Post by: ThomasV on November 14, 2012, 06:27:02 PM

I'll test this the moment it's out! No libbitcoin or Abe?

no libbitcoin, no abe
you can already test it, it is in the repo.

you need to 'backend=bitcoind' to your configuration file, and to update it frequently, because I am still making changes to it


Title: Re: Electrum server discussion thread
Post by: ThomasV on November 20, 2012, 10:32:24 AM
we now have two pruning servers up and running:

ecdsa.org and electrum.novit.ro

if you restore your wallet from seed on one of those servers, your history will be pruned.
the 1.4 client does not display correctly the pruned history, but the version of the client in github does.
I will make a new release soon, to include this change.


Title: Re: Electrum server discussion thread
Post by: Red Emerald on November 22, 2012, 07:41:48 PM
I'm still playing with this with my local VMs.

Hopefully I'll have a real server soon.


Title: Re: Electrum server discussion thread
Post by: Pontius on November 23, 2012, 03:56:49 PM
ThomasV, a few questions:

Code:
./server.py info
type    address        sub  version  time
 TCP    <ip>           280      1.5  6.89
 TCP    <ip>             6      1.4  40529.56
 TCP    <ip>             7      1.4  9.17
 TCP    <ip>             9      1.4  9.19
 TCP    <my own ip>      0  unknown  0.00

First, could you explain what the column "sub" represents?
Second, any idea about tha last line? What is that?
And last - see the time value on the second line? I have such clients on a regular basis. Sometimes multiple at once. Any chance to limit the resources for a single client?


Title: Re: Electrum server discussion thread
Post by: ThomasV on November 23, 2012, 04:08:05 PM
ThomasV, a few questions:

Code:
./server.py info
type    address        sub  version  time
 TCP    <ip>           280      1.5  6.89
 TCP    <ip>             6      1.4  40529.56
 TCP    <ip>             7      1.4  9.17
 TCP    <ip>             9      1.4  9.19
 TCP    <my own ip>      0  unknown  0.00

First, could you explain what the column "sub" represents?
Second, any idea about tha last line? What is that?
And last - see the time value on the second line? I have such clients on a regular basis. Sometimes multiple at once. Any chance to limit the resources for a single client?

sub = number of subscriptions
last line = the connection you make when you run the 'info' command
time is a ping time. the client sends a ping every minute. there is no timeout server side atm.


Title: Re: Electrum server discussion thread
Post by: Pontius on November 23, 2012, 05:56:24 PM
time is a ping time. the client sends a ping every minute. there is no timeout server side atm.

Ah, I thought "time" would be "cpu time".  :D
Then they heavy load on the system it was just coincidence.

Btw, the new "leveldb" backend is just great. Nice work!



Title: Re: Electrum server discussion thread
Post by: slush on November 23, 2012, 06:06:19 PM
Electrum server made great progress. I'm running latest version on electrum.bitcoin.cz for few days and everything works perfectly, plus RAM requirement dropped to half...


Title: Re: Electrum server discussion thread
Post by: BkkCoins on December 09, 2012, 09:28:32 AM
I've been trying to setup and run an electrum server using the leveldb backend. I've followed the README.levedb and some details from the HOWTO.md but having a problem that seems to not be explained in anything I've read.

Code:
Warning: it looks like you are using a 32bit system. You may experience crashes caused by mmap
Traceback (most recent call last):
  File "/bin/electrum", line 113, in <module>
    ssl_certfile = config.get('server', 'ssl_certfile')
  File "/usr/lib/python2.7/ConfigParser.py", line 618, in get
    raise NoOptionError(option, section)
ConfigParser.NoOptionError: No option 'ssl_certfile' in section: 'server'

Obviously it's looking for a certificate but this is the only mention of that I've come across.

I'd like to just test it out first before dealing with a cert if possible. If not I can create a self signed one but where can I get real info, that isn't missing stuff like this, on how to get the server running.



Title: Re: Electrum server discussion thread
Post by: Tachikoma on December 09, 2012, 09:45:28 AM
This is a new addition in the latest server updates. It means you can run a connection from the client to the server over SSL. Just generate a self-signed certificate and add the config option to /etc/electrum.conf


Title: Re: Electrum server discussion thread
Post by: BkkCoins on December 09, 2012, 09:52:07 AM
This is a new addition in the latest server updates. It means you can run a connection from the client to the server over SSL. Just generate a self-signed certificate and add the config option to /etc/electrum.conf
Will a self signed one work? Presumably the client would need a root cert as well to verify or is it only used for encryption and not identity?

I manage my own root authority with TinyCA so it's easy enough for me to create one but generally in my web apps I always need to give my root to the app so it will accept it.


Title: Re: Electrum server discussion thread
Post by: Tachikoma on December 09, 2012, 10:33:27 AM
I used a self signed one and as far as I know it's working fine. Good question though Thomas will probably enlighten us.


Title: Re: Electrum server discussion thread
Post by: BkkCoins on December 09, 2012, 01:01:44 PM
Ok. So I created a cert/key and that seems to be working. No errors yet.

But now when I start electrum (server) it asks me for

Enter username for jsonrpc at localhost:8332: electrum
Enter password for electrum in jsonrpc at localhost:8332:

I've already configured this in /etc/electrum.conf so why is it asking? I also have the same values in bitcoin.conf.

Anyway, when I type in the values again it just keeps asking again... wha?

edit - forget it. I see the problem.

electrum didn't accept a blank user so I made one up and edited bitcoin.conf.
Didn't realize had to stop bitdoind first so it could start with new user name.
Now done and started fine. Now playing catch up.
I can see this will take a while... la di da.


Title: Re: Electrum server discussion thread
Post by: StatelessSweety on December 15, 2012, 06:25:01 PM
My electrum bitcoin wallet 1.4 is saying "Not connected" and my balance isn't showing. I'm a newb to the technology, not transacting.

Can anyone suggest anything?


Title: Re: Electrum server discussion thread
Post by: BkkCoins on December 15, 2012, 08:36:14 PM
My electrum bitcoin wallet 1.4 is saying "Not connected" and my balance isn't showing. I'm a newb to the technology, not transacting.

Can anyone suggest anything?
You can try connecting to a different server. On the "classic" gui there is a round icon bottom right. Try that. It's also fairly likely you will need to upgrade because many recent changes could cause an older version to not connect. Current now I think is 1.5.6.

After changing server you should expect in 5-10 seconds that it starts synchronizing. If not and several servers respond the same then I'd say upgrade.



Title: Re: Electrum server discussion thread
Post by: MoonShadow on December 19, 2012, 09:39:31 PM
Okay, I've been trying out Electrum as a portable solution, but find I seem to be inhibited in many public places.  I presume due to firewalls that prohibit high number/non-standard ports.  Is there a public server that can fake being a standard webserver using port 80?  Can this even ben done?


Title: Re: Electrum server discussion thread
Post by: Red Emerald on December 19, 2012, 09:56:29 PM
Okay, I've been trying out Electrum as a portable solution, but find I seem to be inhibited in many public places.  I presume due to firewalls that prohibit high number/non-standard ports.  Is there a public server that can fake being a standard webserver using port 80?  Can this even ben done?
Theres comments in the config file for doing exactly this and I seem to recall seeing a partial readme for it.  I don't know if any servers have done this though.

Once I get my server up publicly, I'll have it listening on 80 and 443


Title: Re: Electrum server discussion thread
Post by: EagleTM on December 19, 2012, 11:35:43 PM
electrum.no-ip.org is listening on 80 and 443 specifically for this reason. Feel free to use it, just select HTTP or HTTPS and the server from the list.

I've added the report_* config options a while back (see sample config and README.IRC) to be able to have the server report a different port on IRC than it's bound to locally. This is useful to run the server as an unprivileged user and then to NAT, rinetd or haproxy, the standard high port (8081 for example) to 80.


Edit: spelling and clarification


Title: Re: Electrum server discussion thread
Post by: BkkCoins on December 20, 2012, 12:12:10 AM
I've added the report_* config options a while back (see sample config and README.IRC) to be able to have the server report a different port on IRC than it's bound to locally. This is useful to run the server as an unprivileged user and then to NAT, rinetd or haproxy, the standard high port (8081 for example) to 80.
Does this support reporting multiple different hosts and also multiple ports? Both would be very useful and IMO needed. Reporting a secondary name would be useful for running a Tor hidden service alongside a normal one. Reporting more than one port would be useful for more flexible access. eg. port 80 and 110. Or configuring a tunnel to hop thru a proxy/firewall for certain users, exposing a secondary access location.

Or perhaps clients don't support more than one port since currently it doesn't present as a dropdown box for port number. I suppose port # could be manually configured as "special knowledge" but I still see multiple hosts as very useful.


Title: Re: Electrum server discussion thread
Post by: EagleTM on December 20, 2012, 12:31:47 AM
Does this support reporting multiple different hosts and also multiple ports? Both would be very useful and IMO needed. Reporting a secondary name would be useful for running a Tor hidden service alongside a normal one. Reporting more than one port would be useful for more flexible access. eg. port 80 and 110. Or configuring a tunnel to hop thru a proxy/firewall for certain users, exposing a secondary access location.

Each server joins #electrum with a unique nickname prefixed by E_ and publishes its info in its name field which can be queried /whois . The limit here is the IRC name field - which has a maximum of 50 chars. Already at this time if your hostname is too long the ports for TCP, TLS, HTTP, HTTPS don't fit in.

Adding multiple hostnames and ports would be fairly complicated - moreover the clients would need to decode this and so forth. The KISS approach is one server instance, one user on IRC, one hostname and a specific set of ports.

What could certainly be done (but no priority) is mutliple server instances sharing one leveldb database with one master instance updating the db while the others just use the same and talk to bitcoind to send out tx.


Title: Re: Electrum server discussion thread
Post by: BkkCoins on December 20, 2012, 01:27:12 AM
Does this support reporting multiple different hosts and also multiple ports? Both would be very useful and IMO needed. Reporting a secondary name would be useful for running a Tor hidden service alongside a normal one. Reporting more than one port would be useful for more flexible access. eg. port 80 and 110. Or configuring a tunnel to hop thru a proxy/firewall for certain users, exposing a secondary access location.

Each server joins #electrum with a unique nickname prefixed by E_ and publishes its info in its name field which can be queried /whois . The limit here is the IRC name field - which has a maximum of 50 chars. Already at this time if your hostname is too long the ports for TCP, TLS, HTTP, HTTPS don't fit in.

Adding multiple hostnames and ports would be fairly complicated - moreover the clients would need to decode this and so forth. The KISS approach is one server instance, one user on IRC, one hostname and a specific set of ports.

What could certainly be done (but no priority) is mutliple server instances sharing one leveldb database with one master instance updating the db while the others just use the same and talk to bitcoind to send out tx.
Or couldn't the server code just join IRC as a new user for each different host name? So when parsing the config it joins IRC once for each report line it encounters, with maybe some suffix on nickname.
eg. nick E_<name>_1 etc.

I don't know much at all about IRC so maybe there's some limitation preventing that but this seems like fairly KISS as well. I never logged into #electrum but doing this just now I was wondering what name my server would use when I don't set a nickname in the config?

edit: Oh, I found myself. It's just some random gibberish name. Maybe I'll go add a proper nick then.
edit2: Hmm. Maybe this is why my https port doesn't show up - not enough space. Isn't there a better way to do this?


Title: Re: Electrum server discussion thread
Post by: Red Emerald on December 20, 2012, 02:09:09 AM
Does this support reporting multiple different hosts and also multiple ports? Both would be very useful and IMO needed. Reporting a secondary name would be useful for running a Tor hidden service alongside a normal one. Reporting more than one port would be useful for more flexible access. eg. port 80 and 110. Or configuring a tunnel to hop thru a proxy/firewall for certain users, exposing a secondary access location.

Each server joins #electrum with a unique nickname prefixed by E_ and publishes its info in its name field which can be queried /whois . The limit here is the IRC name field - which has a maximum of 50 chars. Already at this time if your hostname is too long the ports for TCP, TLS, HTTP, HTTPS don't fit in.

Adding multiple hostnames and ports would be fairly complicated - moreover the clients would need to decode this and so forth. The KISS approach is one server instance, one user on IRC, one hostname and a specific set of ports.

What could certainly be done (but no priority) is mutliple server instances sharing one leveldb database with one master instance updating the db while the others just use the same and talk to bitcoind to send out tx.
Or couldn't the server code just join IRC as a new user for each different host name? So when parsing the config it joins IRC once for each report line it encounters, with maybe some suffix on nickname.
eg. nick E_<name>_1 etc.

I don't know much at all about IRC so maybe there's some limitation preventing that but this seems like fairly KISS as well. I never logged into #electrum but doing this just now I was wondering what name my server would use when I don't set a nickname in the config?

edit: Oh, I found myself. It's just some random gibberish name. Maybe I'll go add a proper nick then.
edit2: Hmm. Maybe this is why my https port doesn't show up - not enough space. Isn't there a better way to do this?
I know some IRC servers have limits on the number of connections allowed from a single IP.


Title: Re: Electrum server discussion thread
Post by: EagleTM on December 20, 2012, 08:33:12 AM
I don't know much at all about IRC so maybe there's some limitation preventing that but this seems like fairly KISS as well. I never logged into #electrum but doing this just now I was wondering what name my server would use when I don't set a nickname in the config?

edit: Oh, I found myself. It's just some random gibberish name. Maybe I'll go add a proper nick then.
edit2: Hmm. Maybe this is why my https port doesn't show up - not enough space. Isn't there a better way to do this?

Good idea - yes you could implement the irc thread to open multiple connections. It'd need a smart way of reading / iterating this from the server config without having to define lots of defaults. The limit IRC servers place for connections by IP is somewhere around 4-5 and it applies to a single server - connecting to irc.freenode.net will spread the connection to various servers. I'd assume most operators only need at most one secondary nick (currently no one else has this requirement). As for Tor - this would yet again need more thought because publishing a Tor node on public IRC will give people a bad experience by trying to connect to it outside of Tor. I don't really see the necessity either - people can and do connect to public servers from Tor and this works just fine. You could just publish the Tor address in your server info tab.

About the space issue: If you switch to Port 80 and 443 you will save a couple of chars. You're currently lacking 5.  Changing h8080 to h80 gives you two, so you might need to change t50001 or s50002 to a lower port number or try to shorten your hostname. There was the idea to make port numbers implicit - i.e. if they are not published the client assumes it's t50001 for example but this needs to be implemented in the server and all servers need to update their codebase in a relatively short timeframe to make this work.

Edit: Note about Tor address publishing on info tab, server propagation for implicit port names (not client, they don't query IRC)


Title: Re: Electrum server discussion thread
Post by: BkkCoins on December 20, 2012, 09:54:45 AM
I'd assume most operators only need at most one secondary nick (currently no one else has this requirement). As for Tor - this would yet again need more thought because publishing a Tor node on public IRC will give people a bad experience by trying to connect to it outside of Tor. I don't really see the necessity either - people can and do connect to public servers from Tor and this works just fine. You could just publish the Tor address in your server info tab.
I think probably one would be enough. I can't think of another reason for having multiple names off hand. My idea with publishing a Tor address was that it would only show up in the list if a socks proxy was enabled. That way any client wanting to use Tor would choose socks mode and immediately see a list of available onions. Maybe even better, add a Tor proxy mode (HTTP, SOCKS4, SOCKS5, TOR) that is just the same as SOCKS5 but only lists onions. This makes it dead easy for someone wanting to connect this way. I guess this is a pretty small tweak as those keen to do this can probably manually enter onion addresses - it's just kind of nice if the one you use goes down to be able to choose an alternate from a list without going out to research it.

About the space issue: If you switch to Port 80 and 443 you will save a couple of chars. You're currently lacking 5.  Changing h8080 to h80 gives you two, so you might need to change t50001 or s50002 to a lower port number or try to shorten your hostname.
I have a shorter domain name available so I may just switch back to that one. It's too bad there isn't another field available in IRC to store some user comment or data. Perhaps an alternate approach would be if no port info is present the client could hit the server itself with an rpc call that provides details. In fact, this could provide an onion name if available. (Or maybe not as that would mean every client hitting a server and thus potentially a significant load).

Anyway these are just ideas for consideration as development advances. I've provided pull requests in the past on the client and if there was some general agreement that an idea is worth doing then I'd be happy to implement it and send a pull on the server as well. I'm trying to get to a backlog of features I have I'd like to sync with the new version client and then send pulls for them. Soon I hope.


Title: Re: Electrum server discussion thread
Post by: ThomasV on January 28, 2013, 03:46:12 PM
on january 13th, a silent bug was introduced in the server code.
I fixed it today.
please pull the new code if you upgraded after this date!


Title: Re: Electrum server discussion thread
Post by: Red Emerald on January 28, 2013, 04:29:39 PM
on january 13th, a silent bug was introduced in the server code.
I fixed it today.
please pull the new code if you upgraded after this date!
Oops. Sorry about that.

After I get some time, I'll get a PR in for my logging branch.  Then I'll work on unit tests.


Title: Re: Electrum server discussion thread
Post by: ThomasV on January 28, 2013, 06:53:18 PM
another bugfix: if your bitcoind is older than this commit, please update/rebase :

https://github.com/bitcoin/bitcoin/commit/cd7fb7d1deece9da15d7750b3e05f729555a2cbe


Title: Re: Electrum server discussion thread
Post by: ThomasV on January 29, 2013, 11:59:51 AM
one more bugfix commited this morning, this time for abe servers:
https://github.com/spesmilo/electrum-server/commit/4d465a7b3cb02c668440c03dd71d82b98f947637



Title: Re: Electrum server discussion thread
Post by: Red Emerald on February 05, 2013, 01:44:36 PM
will you loose any coins?

can you explain your question?
When I update it, will I still have my coins afterword?
Updating the server will do nothing to your coins.


Title: Re: Electrum server discussion thread
Post by: piuk on February 08, 2013, 12:46:38 PM
Thomas, please could you have a look at https://github.com/spesmilo/electrum-server/pull/23


Title: Re: Electrum server discussion thread
Post by: ajze on February 17, 2013, 06:54:06 AM
I'm having issues getting Electrum server to sync with bitcoind.  It works fine for a short time then says this:

Code:
17/02/2013-05:20:34] catch_up: block 23100 (0.639s)
[17/02/2013-05:20:34] catch_up: block 23200 (0.638s)
Traceback (most recent call last):
  File "/home/bitcoind/electrum/electrum-server/backends/bitcoind/blockchain_processor.py",$
    respdata = urllib.urlopen(self.bitcoind_url, postdata).read()
  File "/usr/lib/python2.7/urllib.py", line 88, in urlopen
    return opener.open(url, data)
  File "/usr/lib/python2.7/urllib.py", line 209, in open
    return getattr(self, name)(url, data)
  File "/usr/lib/python2.7/urllib.py", line 344, in open_http
    h.endheaders(data)
  File "/usr/lib/python2.7/httplib.py", line 954, in endheaders
    self._send_output(message_body)
  File "/usr/lib/python2.7/httplib.py", line 814, in _send_output
    self.send(msg)
  File "/usr/lib/python2.7/httplib.py", line 776, in send
    self.connect()
  File "/usr/lib/python2.7/httplib.py", line 757, in connect
    self.timeout, self.source_address)
  File "/usr/lib/python2.7/socket.py", line 571, in create_connection
 raise err
IOError: [Errno socket error] [Errno 110] Connection timed out
[17/02/2013-05:20:56] Stopping Stratum
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 755, in run
    self.function(*self.args, **self.kwargs)
  File "/home/bitcoind/electrum/electrum-server/backends/bitcoind/blockchain_processor.py",$
    threading.Timer(0, lambda: self.catch_up(sync=False)).start()
  File "/home/bitcoind/electrum/electrum-server/backends/bitcoind/blockchain_processor.py",$
    next_block_hash = self.bitcoind('getblockhash', [self.height + 1])
  File "/home/bitcoind/electrum/electrum-server/backends/bitcoind/blockchain_processor.py",$
    r = loads(respdata)
UnboundLocalError: local variable 'respdata' referenced before assignment

Looks like a time out issue.  I have it running on a virtual server that may be the source of the delays in communicating w/ bitcoind.

I don't speak python, but this seems to magically make the time out 60s instead of 1s:

electrum-server/backends/bitcoind/blockchain_processor.py line 87:

was:
Code:
        try:
            respdata = urllib.urlopen(self.bitcoind_url, postdata).read()
        except:
            traceback.print_exc(file=sys.stdout)
            self.shared.stop()

Changed to:
Code:
       try:
            respdata = urllib.urlopen(self.bitcoind_url, postdata).read()
        except:
            try:
                respdata = urllib.urlopen(self.bitcoind_url, postdata).read()
            except:
                traceback.print_exc(file=sys.stdout)
                self.shared.stop()


After changing this, it runs much longer before it dies with the same message.  I'm sure there's a much better way to do this.  Maybe some who knows about this stuff can fix it or at least change the time out to a value that will survive the server being overloaded temporarily.

[Edit]
Moved leveldb to shm to see if it helped performance.  It didn't.  The issue appears to be caused by high cpu usage.


Title: Re: Electrum server discussion thread
Post by: phantastisch on February 17, 2013, 03:05:04 PM
I'm having issues getting Electrum server to sync with bitcoind.  It works fine for a short time then says this:

Code:
17/02/2013-05:20:34] catch_up: block 23100 (0.639s)
[17/02/2013-05:20:34] catch_up: block 23200 (0.638s)
Traceback (most recent call last):
  File "/home/bitcoind/electrum/electrum-server/backends/bitcoind/blockchain_processor.py",$
    respdata = urllib.urlopen(self.bitcoind_url, postdata).read()
  File "/usr/lib/python2.7/urllib.py", line 88, in urlopen
    return opener.open(url, data)
  File "/usr/lib/python2.7/urllib.py", line 209, in open
    return getattr(self, name)(url, data)
  File "/usr/lib/python2.7/urllib.py", line 344, in open_http
    h.endheaders(data)
  File "/usr/lib/python2.7/httplib.py", line 954, in endheaders
    self._send_output(message_body)
  File "/usr/lib/python2.7/httplib.py", line 814, in _send_output
    self.send(msg)
  File "/usr/lib/python2.7/httplib.py", line 776, in send
    self.connect()
  File "/usr/lib/python2.7/httplib.py", line 757, in connect
    self.timeout, self.source_address)
  File "/usr/lib/python2.7/socket.py", line 571, in create_connection
 raise err
IOError: [Errno socket error] [Errno 110] Connection timed out
[17/02/2013-05:20:56] Stopping Stratum
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 755, in run
    self.function(*self.args, **self.kwargs)
  File "/home/bitcoind/electrum/electrum-server/backends/bitcoind/blockchain_processor.py",$
    threading.Timer(0, lambda: self.catch_up(sync=False)).start()
  File "/home/bitcoind/electrum/electrum-server/backends/bitcoind/blockchain_processor.py",$
    next_block_hash = self.bitcoind('getblockhash', [self.height + 1])
  File "/home/bitcoind/electrum/electrum-server/backends/bitcoind/blockchain_processor.py",$
    r = loads(respdata)
UnboundLocalError: local variable 'respdata' referenced before assignment

Looks like a time out issue.  I have it running on a virtual server that may be the source of the delays in communicating w/ bitcoind.

I don't speak python, but this seems to magically make the time out 60s instead of 1s:

electrum-server/backends/bitcoind/blockchain_processor.py line 87:

was:
Code:
        try:
            respdata = urllib.urlopen(self.bitcoind_url, postdata).read()
        except:
            traceback.print_exc(file=sys.stdout)
            self.shared.stop()

Changed to:
Code:
       try:
            respdata = urllib.urlopen(self.bitcoind_url, postdata).read()
        except:
            try:
                respdata = urllib.urlopen(self.bitcoind_url, postdata).read()
            except:
                traceback.print_exc(file=sys.stdout)
                self.shared.stop()


After changing this, it runs much longer before it dies with the same message.  I'm sure there's a much better way to do this.  Maybe some who knows about this stuff can fix it or at least change the time out to a value that will survive the server being overloaded temporarily.

[Edit]
Moved leveldb to shm to see if it helped performance.  It didn't.  The issue appears to be caused by high cpu usage.

I have the same problem on a dedicated server with a lot of power and there is no cpu usage. I was able to sync up to the latest blocks since of 15:51 then this started happening.


Title: Re: Electrum server discussion thread
Post by: EagleTM on February 18, 2013, 12:49:51 AM
The crash message looks like bitcoind quit or is busy answering which will in turn make electrum server bail out...

Make sure you're running the latest bitcoind from git and let bitcoind sync up first before running electrum. If it still doesn't work then, we'll have to give it a close look.


Title: Re: Electrum server discussion thread
Post by: ThomasV on February 18, 2013, 09:01:34 AM
bitcoind quit or is busy answering which will in turn make electrum server bail out...

yes, please note that this is expected behaviour.
the Electrum server shuts itself down in order to avoid sending lagging information to its clients


Title: Re: Electrum server discussion thread
Post by: phantastisch on February 22, 2013, 05:10:37 PM
So it is me again ,

I am trying to run an electrum server on my node but i can not get irc to work.

If I set it to yes in the options I get 100% CPU load on 1 Core and no peers.

There are no ports closed, i asked my hosting provider and i made sure to disable the firewall.

I am able to connect to it with Electrum 1.6.2 at electrum.cpsh.me per tcp 50001 and http 8081

When i run electrum peers i get this message in the log :
Quote
[22/02/2013-17:55:22] Starting Electrum server on electrum.cpsh.me
[22/02/2013-17:55:22] hist [('0000000000000113d3646e4eb83c7392c046d7145bd6b80a1f2ee4b5aa650310', 222560, 0)]
[22/02/2013-17:55:22] catching up missing headers: 222516 222560
[22/02/2013-17:55:23] blockchain is up to date.
[22/02/2013-17:55:24] TCP server started.
[22/02/2013-17:55:24] HTTP server started.
[22/02/2013-17:55:35] blockchain: 222560 (0.028s)
[22/02/2013-17:56:26] blockchain: 222561 (10.456s)
[22/02/2013-18:04:01] unknown method {u'params': [u'secret'], u'id': 2, u'method': u'server.peers'}

Things I already investigated :
  • changed the connection to the irc server on another port accordingly to freenode servers manually in the irc init file.
  • monitored the ports
  • reverted the last commit

things i suspect :
  • the hostname

the hostname file says : electrum.cpsh.me

the hosts file says : <IpeditedoutbyMe> electrum.cpsh.me

I would appreciate any help,

thank you


Title: Re: Electrum server discussion thread
Post by: BkkCoins on March 02, 2013, 05:15:27 AM
I'm having trouble getting electrum-server to run with the latest bitcoind from github.

I keep getting this,
Code:
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 755, in run
    self.function(*self.args, **self.kwargs)
  File "/usr/local/src/electrum-server/backends/bitcoind/blockchain_processor.py", line 72, in <lambda>
    threading.Timer(0, lambda: self.catch_up(sync=False)).start()
  File "/usr/local/src/electrum-server/backends/bitcoind/blockchain_processor.py", line 652, in catch_up
    next_block_hash = self.bitcoind('getblockhash', [self.height + 1])
  File "/usr/local/src/electrum-server/backends/bitcoind/blockchain_processor.py", line 95, in bitcoind
    raise BaseException(r['error'])
BaseException: {u'message': u'Block number out of range.', u'code': -1}

"Block number out of range" - what?

I updated my bitcoind today and it starts ok but electrum doesn't want to play with it.

edit: Just noticed that blocks being logged in bitcoin/debug.log are from 2011. Is this right - the new version has to reload the whole blockchain or something? It was up to date with previous pre-0.8 beta and I thought it would be a good idea to catch up with new release.

edit again: Oh. Well, now that the blockchain has fully re-indexed/downloaded it does work ok. For anyone about to update note that going from bitcoind 0.7.1 to 0.8.0 does this and took quite a few hours on my server.

BTW I changed my server URL from electrum.spiderfish.net back to electrum.tk (a name I briefly used before). I like spiderfish better but the name is too long to allow the SSL/HTTPS details to be passed via IRC. Not sure why that changed today as SSL was working before, and then today it stopped, until I restarted with the shorter name. I updated electrum server as well so maybe some changes occurred.


Title: Re: Electrum server discussion thread
Post by: EagleTM on March 02, 2013, 10:25:09 PM
Electrum won't start O_O

You're probably referring to the client and not the server. Please use the other thread for discussing this, make sure you run the latest stable version and feel free to join us on IRC #electrum on freenode to try and help you fix this.


Title: Re: Electrum server discussion thread
Post by: ThomasV on March 04, 2013, 07:40:18 AM
bad news for pruning servers:

I had to make modifications to the database structure of pruning servers.
The goal of this change is to handle p2sh addresses.

If you git pull, you'll see a message telling you that your database is deprecated.
you will need to create a new database and reimport the blockchain.

sorry about that.

note that this change is indicated by a new version number (0.7)


Title: Re: Electrum server discussion thread
Post by: tnkflx on March 04, 2013, 08:38:47 AM
bad news for pruning servers:

I had to make modifications to the database structure of pruning servers.
The goal of this change is to handle p2sh addresses.

If you git pull, you'll see a message telling you that your database is deprecated.
you will need to create a new database and reimport the blockchain.

sorry about that.

note that this change is indicated by a new version number (0.7)

So there will be 2 electrum-server versions running (0.6 for full & 0.7 for pruning)?


Title: Re: Electrum server discussion thread
Post by: ThomasV on March 04, 2013, 09:21:39 AM
bad news for pruning servers:

I had to make modifications to the database structure of pruning servers.
The goal of this change is to handle p2sh addresses.

If you git pull, you'll see a message telling you that your database is deprecated.
you will need to create a new database and reimport the blockchain.

sorry about that.

note that this change is indicated by a new version number (0.7)

So there will be 2 electrum-server versions running (0.6 for full & 0.7 for pruning)?

the full servers will have the same version number.
however, a full server using 0.7 code will not support p2sh addresses, afaik (unless they were added to ABE recently, I don't know)


Title: Re: Electrum server discussion thread
Post by: barrymac on March 07, 2013, 03:53:41 PM
I've added this question to the stackexchange site which is asking what the security considerations are for running an electrum server.

http://bitcoin.stackexchange.com/questions/8214/what-are-the-security-considerations-for-hosting-your-own-electrum-server

I'm also curious whether anyone has run this code on a JVM in say Jython or something like that? I'm interested in a Java based implementation.


Title: Re: Electrum server discussion thread
Post by: Tachikoma on March 07, 2013, 04:55:39 PM
I don't think anybody tried to run a JVM implementation. There is a ruby port of the electrum code which could in theory be ran as JRuby though. Please let us know your findings if you are going to experiment :)


Title: Re: Electrum server discussion thread
Post by: barrymac on March 07, 2013, 09:57:59 PM
Well for that matter there's also Javascript implementations ! :-P


Title: Re: Electrum server discussion thread
Post by: stepkrav on March 25, 2013, 04:26:27 PM
I'm thinking about setting up an electrum server in order to help users. Any documentation on that?


Title: Re: Electrum server discussion thread
Post by: ThomasV on March 25, 2013, 04:30:33 PM
I'm thinking about setting up an electrum server in order to help users. Any documentation on that?

there are documentation files in the repo.
I suggest that you start with a pruning server, it is easier


Title: Re: Electrum server discussion thread
Post by: stepkrav on March 30, 2013, 01:22:32 PM
I'm half the way of setting this server up. I must say that compiling bitcoind was fun.  :D But bicoind needs a lot of resources, my little 512 RAM vps can't do it i guess? Opinions?


Title: Re: Electrum server discussion thread
Post by: eja on March 30, 2013, 02:04:21 PM
It is probably close to the limit. For reference below is the resource usage on mine (1GB ram) after a couple of days running.

  PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND           
 2188 bitcoin   20   0  353m 200m 3708 S    3 20.2 310:23.68 bitcoind           
 4320 bitcoin   20   0  306m 108m 2732 S   35 10.9 729:14.69 python 


Title: Re: Electrum server discussion thread
Post by: Tachikoma on March 31, 2013, 09:18:24 AM
I'm half the way of setting this server up. I must say that compiling bitcoind was fun.  :D But bicoind needs a lot of resources, my little 512 RAM vps can't do it i guess? Opinions?

I think it should be possible if you monitor the bitcoind process and reboot it every other day.


Title: Re: Electrum server discussion thread
Post by: stepkrav on March 31, 2013, 12:19:55 PM
To improve installation notes at github perhaps you could add the packages needed for debian servers :

Code:
apt-get install python make build-essential python-leveldb libboost-all-dev libdb++-dev libminiupnpc-dev python-setuptools python-openssl

Some of them already referred but perhaps it's better to have them all in one command/place.


Title: Re: Electrum server discussion thread
Post by: inaltoasinistra on April 18, 2013, 02:54:58 PM
I'm half the way of setting this server up. I must say that compiling bitcoind was fun.  :D But bicoind needs a lot of resources, my little 512 RAM vps can't do it i guess? Opinions?

I think it should be possible if you monitor the bitcoind process and reboot it every other day.

bitcoind is using the 43% of my 1GB of RAM x.x

I have a problem lauching the server: (the bitcoin chain is updated)
Code:
[18/04/2013-16:42:33] 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
[18/04/2013-16:42:34] 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 783, in catch_up
    next_block = self.bitcoind('getblock', [next_block_hash, 1])
  File "/home/bitcoin/src/electrum-server/backends/bitcoind/blockchain_processor.py", line 105, in bitcoind
    raise BaseException(r['error'])
BaseException: {u'message': u'getblock <hash>\nReturns details of a block with given block-hash.', u'code': -1}


Title: Re: Electrum server discussion thread
Post by: ThomasV on April 28, 2013, 07:42:36 AM
many electrum servers became unusable tonight, because of very large transactions in the memory pool.
I figured out the mempool code was not efficient, and I fixed it.
Please upgrade your servers!


Title: Re: Electrum server discussion thread
Post by: Pontius on April 28, 2013, 08:18:53 AM
[...] Please upgrade your servers!

Done (and worked for me). Thank you, Thomas.


Title: Re: Electrum server discussion thread
Post by: inaltoasinistra on May 06, 2013, 01:20:19 PM
SLL/HTPPS connections increase the security?
They are needed only to hide the electrum service to the network, aren't they?
Thanks


Title: Re: Electrum server discussion thread
Post by: stepkrav on May 06, 2013, 01:29:26 PM
SSL/HTTPS ecrypts the data between your client and the server. They're only "hiding" the data from a third party inspecting the connection.


Title: Re: Electrum server discussion thread
Post by: MoonShadow on May 06, 2013, 02:10:14 PM
I've been thinking of an idea, but I lack the skills to follow through, so I'm going to lay it out here and let anyone who wishes take it up.

I would like to have an android client that can connect to any given electrum server, but also via TOR.  I'd also like the client to have the ability to create transactions offline using confirmed transactions for which it is already aware, and connect to other clients like itself via a shared wifi hotspot like a piratebox. (http://wiki.daviddarts.com/PirateBox_DIY)  In this fashion, the android client can develop a set of transactions in optimal amounts that would allow it to create several transactions without the need to reuse it's own change inputs for a time wherever the transacting parties have a piratebox (or any other accesspoint) with or without a live connection to an electrum server and whenever trust isn't an issue.  The use case here is like the cash you carry in your wallet.  There is only so much there, and it doesn't require live internet to work.


Title: Re: Electrum server discussion thread
Post by: sdp on May 16, 2013, 01:24:51 PM
I see that bitcoin-abe and electrum/server have been updated. Should I go ahead an upgrade or should I wait until everything is stable?

Well, I went ahead and upgraded (after making a backup of the database). The server is outputting messages like those below. Should I be worried/should I restore from backup and downgrade?

Code:
block number: 184242
WARNING: missing tx_in for tx 3977349
WARNING: missing tx_out for tx 3977349
block number: 184243
WARNING: missing tx_in for tx 3977352
block number: 184244
WARNING: missing tx_in for tx 3977356
block number: 184245
WARNING: missing tx_in for tx 3977404
block number: 184246
WARNING: missing tx_in for tx 3977413
block number: 184247
WARNING: missing tx_in for tx 3977461
block number: 184248
no, don't worry. I added these warnings after the last schema change in abe, but they seem to be harmless.

Couldn't these be coin generation transactions?  They are the only transactions that do not have a tx_in.  There should be one for each block as is listed in the error there.


Title: Re: Electrum server discussion thread
Post by: ThomasV on May 16, 2013, 02:35:22 PM
Couldn't these be coin generation transactions?  They are the only transactions that do not have a tx_in.  There should be one for each block as is listed in the error there.
I don't know.
I have stopped using Abe for a long time, and no longer support it


Title: Re: Electrum server discussion thread
Post by: roy7 on May 22, 2013, 05:38:54 PM
Does Electrum server generally work with alt coins if you apply the bitcoind patch to <altcoin>d?


Title: Re: Electrum server discussion thread
Post by: Tachikoma on May 23, 2013, 09:11:27 AM
Generally; no. Only if they are up-to-date with bitcoind.


Title: Re: Electrum server discussion thread
Post by: ThomasV on May 30, 2013, 06:36:38 AM
server ops please upgrade your bitcoind
see: https://bitcointalk.org/index.php?topic=100502.msg2315447#msg2315447


Title: Re: Electrum server discussion thread
Post by: tnkflx on May 30, 2013, 09:00:26 AM
server ops please upgrade your bitcoind
see: https://bitcointalk.org/index.php?topic=100502.msg2315447#msg2315447

Done. Electrum.be has been upgraded.


Title: Re: Electrum server discussion thread
Post by: Tachikoma on May 30, 2013, 10:21:54 AM
Electrum server at electrum.bysh.me is upgraded as well and safe for use.


Title: Re: Electrum server discussion thread
Post by: Pontius on May 30, 2013, 01:38:14 PM
Did the upgrade already about 10 days ago; no problems with 0.8.2(rc1) so far...


Title: Re: Electrum server discussion thread
Post by: stepkrav on May 30, 2013, 04:57:36 PM
E_stepkrav has been upgraded too.


Title: Re: Electrum server discussion thread
Post by: Vantix on June 03, 2013, 08:46:47 AM
Hi all, i use this guide to start my electrum server: https://github.com/spesmilo/electrum-server/blob/master/HOWTO.md

But when i try to strat with comand electrum-server
consolle give me this error:
Code:
[bitcoin@satoshidiamond ~]$ electrum-server
Traceback (most recent call last):
  File "/home/bitcoin/bin/electrum-server", line 146, in <module>
    from backends.bitcoind import BlockchainProcessor
  File "/home/bitcoin/src/electrum/server/backends/bitcoind/__init__.py", line 1, in <module>
    from blockchain_processor import BlockchainProcessor
  File "/home/bitcoin/src/electrum/server/backends/bitcoind/blockchain_processor.py", line 4, in <module>
    import leveldb
ImportError: No module named leveldb

Someone can help me?


Title: Re: Electrum server discussion thread
Post by: Tachikoma on June 03, 2013, 08:53:32 AM
You will have to install leveldb.


Title: Re: Electrum server discussion thread
Post by: tnkflx on June 03, 2013, 08:54:43 AM
Hi all, i use this guide to start my electrum server: https://github.com/spesmilo/electrum-server/blob/master/HOWTO.md

But when i try to strat with comand electrum-server
consolle give me this error:
Code:
[bitcoin@satoshidiamond ~]$ electrum-server
Traceback (most recent call last):
  File "/home/bitcoin/bin/electrum-server", line 146, in <module>
    from backends.bitcoind import BlockchainProcessor
  File "/home/bitcoin/src/electrum/server/backends/bitcoind/__init__.py", line 1, in <module>
    from blockchain_processor import BlockchainProcessor
  File "/home/bitcoin/src/electrum/server/backends/bitcoind/blockchain_processor.py", line 4, in <module>
    import leveldb
ImportError: No module named leveldb

Someone can help me?

Did you install the python leveldb module?


Title: Re: Electrum server discussion thread
Post by: BkkCoins on June 03, 2013, 09:00:14 AM
From my now ancient tutorial thread  (https://bitcointalk.org/index.php?topic=130533.0)on setting up the server,

sudo apt-get update
sudo apt-get install git htop build-essential libssl-dev libboost-all-dev libdb5.1++-dev python-leveldb python-setuptools


Title: Re: Electrum server discussion thread
Post by: Vantix on June 03, 2013, 09:01:34 AM
Hi all, i use this guide to start my electrum server: https://github.com/spesmilo/electrum-server/blob/master/HOWTO.md

But when i try to strat with comand electrum-server
consolle give me this error:
Code:
[bitcoin@satoshidiamond ~]$ electrum-server
Traceback (most recent call last):
  File "/home/bitcoin/bin/electrum-server", line 146, in <module>
    from backends.bitcoind import BlockchainProcessor
  File "/home/bitcoin/src/electrum/server/backends/bitcoind/__init__.py", line 1, in <module>
    from blockchain_processor import BlockchainProcessor
  File "/home/bitcoin/src/electrum/server/backends/bitcoind/blockchain_processor.py", line 4, in <module>
    import leveldb
ImportError: No module named leveldb

Someone can help me?

Did you install the python leveldb module?

Yes i install leveldb with root, but electrum server run with another user "bitcoin" i have to install with user bitcoin?


Title: Re: Electrum server discussion thread
Post by: Vantix on June 03, 2013, 09:14:37 AM
Ok i don't install python-leveldb, when try to do that consolle tell me this:

Code:
[root@satoshidiamond ~]# yum install git htop build-essential libssl-dev libboost-all-dev libdb5.1++-dev python-leveldb python-setuptools
Loaded plugins: fastestmirror, security
Loading mirror speeds from cached hostfile
 * base: mirror.crazynetwork.it
 * epel: mirror.fraunhofer.de
 * extras: mirror.crazynetwork.it
 * remi: mirror5.layerjet.com
 * remi-test: mirror5.layerjet.com
 * updates: mirror.crazynetwork.it
Setting up Install Process
Package git-1.7.1-3.el6_4.1.x86_64 already installed and latest version
Package htop-1.0.1-2.el6.x86_64 already installed and latest version
No package build-essential available.
No package libssl-dev available.
No package libboost-all-dev available.
No package libdb5.1++-dev available.
No package python-leveldb available.
Package python-setuptools-0.6.10-3.el6.noarch already installed and latest version
Nothing to do

I have CentOS


Title: Re: Electrum server discussion thread
Post by: BkkCoins on June 03, 2013, 09:21:12 AM
Ok i don't install python-leveldb, when try to do that consolle tell me this:

Code:
[root@satoshidiamond ~]# yum install git htop build-essential libssl-dev libboost-all-dev libdb5.1++-dev python-leveldb python-setuptools
Loaded plugins: fastestmirror, security
Loading mirror speeds from cached hostfile
 * base: mirror.crazynetwork.it
 * epel: mirror.fraunhofer.de
 * extras: mirror.crazynetwork.it
 * remi: mirror5.layerjet.com
 * remi-test: mirror5.layerjet.com
 * updates: mirror.crazynetwork.it
Setting up Install Process
Package git-1.7.1-3.el6_4.1.x86_64 already installed and latest version
Package htop-1.0.1-2.el6.x86_64 already installed and latest version
No package build-essential available.
No package libssl-dev available.
No package libboost-all-dev available.
No package libdb5.1++-dev available.
No package python-leveldb available.
Package python-setuptools-0.6.10-3.el6.noarch already installed and latest version
Nothing to do

I have CentOS
They likely have different names on Red Hat variants. You will need to do a search/lookup to match them up, or maybe someone here using yum can give you a specific list.


Title: Re: Electrum server discussion thread
Post by: Vantix on June 03, 2013, 09:32:42 AM
oK, and if i install now leveldb electrum server will start? or i have re-install all?


Title: Re: Electrum server discussion thread
Post by: tnkflx on June 03, 2013, 10:38:29 AM
I was not immediately able to find a python leveldb package for CentOS 6... You will probably have to install it from source.

Have a look here: http://code.google.com/p/py-leveldb/source/browse/trunk/README (http://code.google.com/p/py-leveldb/source/browse/trunk/README)


Title: Re: Electrum server discussion thread
Post by: ergofobe on June 06, 2013, 12:02:38 AM
bitcoind is using the 43% of my 1GB of RAM x.x

I have a problem lauching the server: (the bitcoin chain is updated)
Code:
[18/04/2013-16:42:33] 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
[18/04/2013-16:42:34] 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 783, in catch_up
    next_block = self.bitcoind('getblock', [next_block_hash, 1])
  File "/home/bitcoin/src/electrum-server/backends/bitcoind/blockchain_processor.py", line 105, in bitcoind
    raise BaseException(r['error'])
BaseException: {u'message': u'getblock <hash>\nReturns details of a block with given block-hash.', u'code': -1}

I'm having the same problem.  I tried monkeying with the code at line 794 (which is where the problem line lives in the current version), and i got it past this error by removing the
Code:
, 1
from the array, but that apparently opened up a host of new problems.  I'm not a python coder, so I could debug it any further..  Using the latest electrum-server code (as of today), and bitcoind-0.8.2.  I was running bitcoind-0.8.1 and also got this error.. Upgrading bitcoind did not help.


Title: Re: Electrum server discussion thread
Post by: BkkCoins on June 06, 2013, 12:53:25 AM
Make sure you installed the electrum-server patch for bitcoind. It changes the way getblock handles multiple params.

patch -p1 <../electrum-server/patch/patch

before you make bitcoind. I checked the patch source and it has code that alters that msg. so I'm guessing it's connected.


Title: Re: Electrum server discussion thread
Post by: stepkrav on June 06, 2013, 01:27:31 AM
i constantly use above 1GB of RAM. Don't know if you'll make it...


Title: Re: Electrum server discussion thread
Post by: killerstorm on June 15, 2013, 08:12:31 AM
Is it still possible to use abe as a backend? I've read that it is deprecated, but I kinda want it this way...


Title: Re: Electrum server discussion thread
Post by: Tachikoma on June 15, 2013, 08:19:24 AM
As far as I'm aware it's still possible it's just no longer supported.


Title: Re: Electrum server discussion thread
Post by: DigitalHermit on August 11, 2013, 06:31:38 PM
FYI: Recent electrum servers are reported to have gotten stuck when attempting to parse Block 251526.

https://bitcointalk.org/index.php?topic=271761

This is preventing clients from seeing or processing any new transactions. No workaround reported yet.


Title: Re: Electrum server discussion thread
Post by: EagleTM on August 11, 2013, 11:11:46 PM
To all server ops:

All servers are stuck on block 251526 because of a bug in the deserializer.
Pleae see https://bitcointalk.org/index.php?topic=271761.0
Please stop your server, git pull to the latest head and restart.

From simple tests it looks as though that's all that is required to get a clean database with 251526 indexed. This isn't final yet, so there's still the chance we need to re-index from a backup... I'll let you know if that's the case but for now it doesn't appear to be necessary.


Title: Re: Electrum server discussion thread
Post by: Pontius on August 12, 2013, 06:32:27 AM
To all server ops:

All servers are stuck on block 251526 because of a bug in the deserializer.
Pleae see https://bitcointalk.org/index.php?topic=271761.0
Please stop your server, git pull to the latest head and restart.

From simple tests it looks as though that's all that is required to get a clean database with 251526 indexed. This isn't final yet, so there's still the chance we need to re-index from a backup... I'll let you know if that's the case but for now it doesn't appear to be necessary.


electrum.pdmc.net patched & restarted.


Title: Re: Electrum server discussion thread
Post by: aquarius on August 13, 2013, 01:34:26 PM
To all server ops:

All servers are stuck on block 251526 because of a bug in the deserializer.
Pleae see https://bitcointalk.org/index.php?topic=271761.0
Please stop your server, git pull to the latest head and restart.

From simple tests it looks as though that's all that is required to get a clean database with 251526 indexed. This isn't final yet, so there's still the chance we need to re-index from a backup... I'll let you know if that's the case but for now it doesn't appear to be necessary.


electrum.pdmc.net patched & restarted.

awesome! :)

+1 internets


Title: Re: Electrum server discussion thread
Post by: SnowDog2003 on September 03, 2013, 02:28:34 AM
Trying to set up an Electrum Server and am having an issue:

* The client will not connect to it. It returns Errno: 111 Connection Refused.

The block chain is caught up. I am specifically trying to connect the client to the server using TCP, <IP Address>, 50001.

These are my open ports:

22           tcp   0.0.0.0/0   
8081-8082   tcp   0.0.0.0/0   
8333           tcp   0.0.0.0/0   
50001-50002   tcp   0.0.0.0/0   
0-65535   tcp   127.0.0.0/8   
0-65535   udp   127.0.0.0/8   
0           icmp   127.0.0.0/8   

Electrum Server host file is as follows.
** Note that I do not know what the 'password' is supposed to be. I have not been able to find a reference for that.

[server]
host = localhost
#report_host =                                                                                                                                  
native_port=50000
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                                                                                                            
password = secret
banner = Welcome to Electrum!
irc = no
cache=yes
#irc_nick = <yournickname>                                                                                                                      
#ssl_certfile = /path/to/electrum-server.crt                                                                                                    
ssl_certfile = /etc/ssl/electrum.crt
ssl_keyfile = /etc/ssl/electrum.key

# default backend is leveldb (pruning server)                                                                                                  
backend = leveldb

[leveldb]
path = /home/ubuntu/db/electrum-leveldb-100
# for each address, history will be pruned if it is longer than this limit                                                                      
pruning_limit = 100

[bitcoind]
host = localhost
port = 8332
# user and password from bitcoin.conf                                                                                                          
user=bitcoinrpc
password=<pw>

Any thoughts?


Title: Re: Electrum server discussion thread
Post by: SnowDog2003 on September 03, 2013, 03:23:31 AM
It connects locally through tcp, http, ssl, and even https. I just tested that. I just can't connect remotely. I did uncomment stratum_tcp_ssl_port and stratum_http_ssl_port.


Title: Re: Electrum server discussion thread
Post by: tnkflx on September 03, 2013, 07:27:23 AM
Firewall? NAT?


Title: Re: Electrum server discussion thread
Post by: SnowDog2003 on September 03, 2013, 10:00:25 AM
Firewall? NAT?

I'm running on an Amazon EC2 server. The ports listed above, are the open ports.

My local client that I'm using to test it, is my laptop, and it connects fine to the other electrum servers. I'm using the IP port to specify the name of my server, and this works when I attach locally and use 127.0.0.1. It just doesn't work when I'm connecting from my laptop and using the IP of the Amazon server.

The 'password=secret' is the only thing that bugs me, from the server's electrum.conf file. I don't know understand it. What is it a password to?

It's frustrating because this setup went so well. I had the whole thing ready to download the block chain in about 2 hours, since I already had the bitcoind up and running; only to be stumped by a port issue. :)


Title: Re: Electrum server discussion thread
Post by: tnkflx on September 03, 2013, 10:22:02 AM
Firewall? NAT?

I'm running on an Amazon EC2 server. The ports listed above, are the open ports.

My local client that I'm using to test it, is my laptop, and it connects fine to the other electrum servers. I'm using the IP port to specify the name of my server, and this works when I attach locally and use 127.0.0.1. It just doesn't work when I'm connecting from my laptop and using the IP of the Amazon server.

The 'password=secret' is the only thing that bugs me, from the server's electrum.conf file. I don't know understand it. What is it a password to?

It's frustrating because this setup went so well. I had the whole thing ready to download the block chain in about 2 hours, since I already had the bitcoind up and running; only to be stumped by a port issue. :)

And electrum-server is started correctly?

I have no experience with EC2 :(


Title: Re: Electrum server discussion thread
Post by: SnowDog2003 on September 03, 2013, 10:30:27 AM

And electrum-server is started correctly?

I have no experience with EC2 :(

I'm starting it and stopping it with the 'start' and 'stop' scripts in ~/src/electrum/server, and seems to run fine and connect when I run a local electrum client. It brings up the transactions and the balances just fine.

What are these two parameters from the electrum.conf server file?

host=localhost (?? Is this correct? Since this is the Electrum server, then isn't this correct?)

password=secret (??? This bugs me a lot. Do I just make something up for the password, or is this supposed to somehow be used?)

From 'electrum.conf' file:

[server]
host = localhost
#report_host =                                                                                                                                 
native_port=50000
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                                                                                                             
password = secret



Title: Re: Electrum server discussion thread
Post by: tnkflx on September 03, 2013, 10:36:10 AM

And electrum-server is started correctly?

I have no experience with EC2 :(

I'm starting it and stopping it with the 'start' and 'stop' scripts in ~/src/electrum/server, and seems to run fine and connect when I run a local electrum client. It brings up the transactions and the balances just fine.

What are these two parameters from the electrum.conf server file?

host=localhost (?? Is this correct? Since this is the Electrum server, then isn't this correct?)

password=secret (??? This bugs me a lot. Do I just make something up for the password, or is this supposed to somehow be used?)

From 'electrum.conf' file:

[server]
host = localhost
#report_host =                                                                                                                                 
native_port=50000
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                                                                                                             
password = secret

For me, host is set to electrum.be:
Code:
host = electrum.be
Electrum.be resolves to the public ip of my server. In your case, this will resolve to 127.0.0.1 (via /etc/hosts). So this is 1 problem.

Password should be set to the password of bitcoin.conf.


Title: Re: Electrum server discussion thread
Post by: SnowDog2003 on September 03, 2013, 10:47:38 AM

For me, host is set to electrum.be:
Code:
host = electrum.be
Electrum.be resolves to the public ip of my server. In your case, this will resolve to 127.0.0.1 (via /etc/hosts). So this is 1 problem.

Password should be set to the password of bitcoin.conf.

Thank you! I think that solved it. I changed from 'host=localhost' to 'host=0.0.0.0', and I commented out the 'password=secret'. This isn't the bitcoind section, so I don't think it's the bitcoin password. I DO have the bitcoin password set in the bitcoind section.

Anyway, now I can connect REMOTELY using TCP, SSL, HTTP, and HTTPS.

Cool... If this works, I'll be running another public electrum server soon. Electrum is really the ONLY wallet that doesn't suck in some way.
[I hope Thomas doesn't take offense to this. This is my highest compliment.]




Title: Re: Electrum server discussion thread
Post by: EagleTM on September 05, 2013, 12:02:09 AM
To server ops: You can upgrade to bitcoind 0.8.4 without any problems with the current electrum-server code. Just apply the known patch and compile.

I've updated the howto accordingly: https://github.com/spesmilo/electrum-server/blob/master/HOWTO.md


Title: Re: Electrum server discussion thread
Post by: neoranga on September 08, 2013, 06:41:40 PM
Yeah! I've just got my server to work on a linux VM with the help from the IRC channel and now I was wondering if I can make it run on windows.
Is there anything that will prevent me from compiling and running the electrum server on a windows machine?


Title: Re: Electrum server discussion thread
Post by: soapmodem on September 26, 2013, 06:18:15 PM
Does anyone have a Windows compile of the latest Electrum server?


Title: Re: Electrum server discussion thread
Post by: tnkflx on September 26, 2013, 07:17:37 PM
It's python, no compile AFAIK. (I haven't tried running server on Windows though...)


Title: Re: Electrum server discussion thread
Post by: ThomasV on September 30, 2013, 12:26:49 PM
Hello,

I just introduced SSL certificate validation in the client code.
The client does accepts self-signed certificates.
However, it rejects expired certificates.

I noticed that a few servers have expired certificates, and are rejected by the client.
If that is your case, please create a new certificate for your server; you may set its expiration date in 10 years.



Title: Re: Electrum server discussion thread
Post by: ThomasV on October 23, 2013, 10:04:09 AM
we just detected and fixed a bug with the servers:
https://github.com/spesmilo/electrum-server/commit/4a82994032a48db0fc4be814091215c69891ab17

if you are running an Electrum server, please do a git pull;
(servers that have not updated their code are stuck at block 265457).



Title: Re: Electrum server discussion thread
Post by: czaanja on October 26, 2013, 06:47:58 PM
Hello, im trying to setup my own electrum server, everything seems to be ok. I downloaded the leveldb database file and synchronized to current. Server has started, but if I try to connect to it with my wallet, it got stuck on Synchronizing.
In the server log I can see:
Code:
[26/10/2013-19:53:08] SSL  217.112.174.177  1BXYiMpoWZVwfxHGrh34FYghKrDtEJdD41  30 1.7.3
But my local wallet got frozen and displays "Synchronizing..." on the status bar. There is not much load on the server, so I dont know what went wrong? When I connect to any other public server with my wallet, everything is ok.
The server is running further and processing blocks, but wallet is still saying "Synchronizing..."
Can anyone help, please?


Title: Re: Electrum server discussion thread
Post by: iceTwy on November 11, 2013, 11:11:10 PM
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512

Hey, I've just finished setting up my own Electrum server. It will remain public.

The server is electrum.icetwy.re. Onion address for Tor users: electrum2vikbmxv.onion

Ports: 8081 (HTTP), 8082 (HTTPS), 50001 (TCP), 50002 (TCP+SSL).

More info is available in the console upon connecting to the server. Enjoy ;)

(Edited on Dec. 21st 2013: 2aspcrrdseyvlaod.onion => electrum2vikbmxv.onion, see here (http://"https://bitcointalk.org/index.php?topic=85475.msg4078995#msg4078995"))
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.22 (GNU/Linux)

iQQcBAEBCgAGBQJSthYBAAoJED6/9j8CnxFqDK0f/jsJ0oehVwTsiLmk37GZdgq3
F8/gtA2V3Ridvy032rl1UDSMpTYUfTTAuiLC9iAAsK2rCZd2ww99NurHi/PK9puC
lfVSBuFJx24X9n6kONWvnahYHjUeoIhujiVRhLo+9mNHCfW/eeODKgIS2y0Hff/r
8F5NX/tf4GtNA8TuuQoeR24a/7dWbP/+nZI1favYcdyoSj4gG6hPbBsu3RN3FITC
ko+VuCMn+vbeKjA+3QEqh3VFWvXKE/KQQQeuliZVKo5E9uA15+fMq9+JH4u0bfat
VpwVX8ZO6hDiHPO9f2Smj/W/gc4a+dvLFYphYLQE2uUf6zoe1lp8lgDZm2zoV20y
/9p3rKpO1Icb4fk5qIG9GsrAnuGlqET+koWPWOOxrIfWUmXr3p3jktapSqsvWiNn
4sfbTSAZi5RWMqNZ0o92gsctT8WQtwWiCklPl+Ufl5mNGq+0/Nojwr0HRKl+KP1H
pKgVLNVGhTTV+WR9JHKUYDYFvrmSDpxTvGzVd+by2eMe4I3DrWZEsvSo77wVwamx
KB2TqWBlZE+lJ9fzjfRHA1TmhzSXoUtYhwZpMAmCX1de20jUYHpFXMb0HSi10Kor
9fswbL05ia8IfgGAQ0OeVQA+dJexmPmxE4/JtSGK8PRaQwcB97CJmDC0l5jBm3VS
i8FtBLaD+SA9KVpydu/IcSWRecNbWt2Yc2QEJJz9Fll+y1/GO3xhz0es+OG4ngZJ
ahZzUs9YQOav5sWWZLkBmS2mdon1WfrSv3z98sAyZml3xPtDRc7qhrwwZ0i0FJ92
Osj3cT6492Zxxiloy1pB/dNDqghZ3QR/wuqBZehsvPwHLwTPR+yeL/4lbAfl21Rc
ND7an2wMiUCDm10fSiKCt3bUUpUFOtwPDe41eCGJ4kznfN8urNhmh3ObLPj36pHX
ZjU+Yv7SZ2JpnHVMFQJStGmogNe0gQIvjjZHcwYMx8xYLQGz5bSrMvb/g1CS57aC
uECjieTeRxdExFF/WSKCZLDazYh1C9X7667U+sN8QgjABD48VYF2aHdlhd54en2v
fLBk3fC9429tOTVwFxpPT3n9Jgl4X9jrrkx9ooQMVtksLlErpgGM6yg3gutBkTyT
Zl2C7yjSaTNpxdCMbB7QzuaYHNL8C+/H7rZLE0S7JYxidqXRy0j5aYlb5EULoZ1/
vX93qF0UwC0pvG+5ODGVY68RF5C3XkZqDFaW+qe/J/63o3YUY9666/7vlO8TBrHJ
XSXM0K0hBcvH4UcXSyu4TBTii+2gSc7rLOjT+Uh6FEQUXZhNB1MAbSHHHJBpEzx6
ZLlerm2IQodKwfjSrHC+GBd158u7EIpCjron/PaVWSLN3wy1ZG78ImwT8ehU7RY=
=kicY
-----END PGP SIGNATURE-----


Title: Re: Electrum server discussion thread
Post by: ThomasV on November 26, 2013, 07:00:09 AM
Two memory leaks were fixed sunday and yesterday.
These leaks had been there for a long time, but were revealed by the release of the 1.9 client and its multiple connections.

Please git pull!


Title: Re: Electrum server discussion thread
Post by: jellies on November 28, 2013, 04:28:31 AM
What are the average disk, cpu load and bandwidth requirements?

Someone said about 1gb of memory is used, I guess the block chain is what it is currently. So what about bandwidth and cpu?

OT:

After getting hit with the bitcoin-qt OSX block database corruption bugs, for months, with no obvious solution or even acknowledgement on the forums, and having the same corruption issues in a ubuntu VM if it wasn't treated with kid gloves, then switching to multi-bit and getting a little concerned over the Issues list on github, and the "magic" involved that apparently means it can ignore the full block chain, then using blockchain.info but watching how the reward for hacking these online wallets rises almost exponentially. Finally I'm on electrum and feel instantly comfortable with it!


Title: Re: Electrum server discussion thread
Post by: mpjetta on November 29, 2013, 10:41:49 PM
I have setup a public server to help out.

hostname: electrum.cryptopush.com
network: IPv4 and IPv6
ports: 8081,8082,50001,50002
prune: 10000
location: NY,NY USA

I have also subscribed to this thread to keep up with new server developments.

Enjoy!


Title: Re: Electrum server discussion thread
Post by: EagleTM on December 06, 2013, 02:17:26 PM
There were quite a few more improvements to the server code in the past week! OPs are encouraged to git pull.

If you haven't pulled in a while: The server does no longer require bitcoind to be patched. You need run bitcoind with txindex=1 instead and may need to reindex once if you're adding the setting. Please see the HOWTO which is up2date: https://github.com/spesmilo/electrum-server/blob/master/HOWTO.md


Title: Re: Electrum server discussion thread
Post by: iceTwy on December 21, 2013, 10:08:22 PM
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512

Important: The onion address for electrum.icetwy.re has changed. This is a purely cosmetic modification, in order to have an onion address starting with "electrum".

New address: electrum2vikbmxv.onion
Previous address: 2aspcrrdseyvlaod.onion

The change has already been in effect for a few weeks now. Thanks to the user who reminded me of this!

I've signed this message and the original one with my PGP key, 0x029F116A (http://"http://pgp.mit.edu:11371/pks/lookup?search=0x3EBFF63F029F116A") (see my blog (http://"https://blog.icetwy.re/gnu/linux/privacy/2013/10/19/gpg-8192-bit-key-and-keychange.html")).
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.22 (GNU/Linux)

iQQcBAEBCgAGBQJSthZbAAoJED6/9j8CnxFqUsIf/2mswGD6vFMiYEumgHIDjBKi
JWj3iUGRzHpB3dU+aj4RMXX8Y/Ix/yVDxAz7SACg3ABbK2iZmsxSJ2TTXE9f4v3/
foB6cfQYwWfEcB6gAYfwtz//2fEjgpgKAZnHZUlDhFUz9Yw3tel5w/hvmovXkm9w
s32UegVAmL6xhhgZ1TQW2RHAOkQrQPRESXDekOrDT+oK6rndwbxs3VboQsDZWit/
pySVJoGhq7oidj4qJzSEqqsTs0gU0sZXGj//++NvymStiTfiMKPsZ1ZobJvtK9jX
458N5LI/d/iK8tNW8xWxlHv+rdEoBQb3pzK5MyoHqdKjpK08TWv4B/pNiUGdZqr7
JC1T1TFAqqZE9lwSXoWom24y7IScA3xQgzl6YYgVKGBE/q5Gb8ATjIiBfsUJGh3z
W41oJZr2TdGlfm9NRp5VBlCboFW77ZGaesCScOnV3EA4AfYDzh2qDoi7A2cD18zo
WwJLx1/3pCwkysZIn71EATMUxrAWZGp54sQ4qTYNtM0rcgyrjxeAExafAV6GinoU
u4dIzQS/wbCtIEfXX+6EDjGZcDYL20/pElXNuT32sXaaSWQLuPWWPOyMrKfuosYM
Jem1e4a1eUwwXrZRl0SbzHJBrdxukJlPSL7jXha+8UYxcmGNEu9UlL4NqszTJR7z
oCBhgByJfs+7yeTHIj0fIRBMkHc2PLlReUKG6KjKtFtFxNOGcOVSl8nnuN2U0lm2
XQ2Z4HJH9EtEm/ovnR0UKCr63O+bSKC9pe4FP97ygZSX8ihuOUPieaUfvy7PaAHW
tFTMlC8vcUPqiwM45J7Kcc/M+cl7vjz4Axs+lkANI/2I04jtDP8dI1mofg33vJwk
phZbhfsctz18rzFzeeeRGCTK3LG4LwADVKjq6l/5hX9I4JzODfsZMc7jq4coFXXS
pNEFbfBdAzGZuFkKDDGgfkB1zJdFkHyKNY39GPCgkxTo+QGZ1fZo3TF/YPy9q7Dg
NEspnQWYdOzaXXD5mz7Eu37D/GoH+Dr/A04WPWRN1jio7/rUS3jsl7HVxt7HxdPT
VxLl8CaAJlDj5OhyfAR0WaLejn0qngFmJEbsxXhiz1pEP20xSGUPln1quc/a7eZu
+ne07ooUmpXSPmkMpuUg2bUpGoIMmvugkErb14dPcDQE46VPdfU3iBcczS981hQm
rVRfct4DKkG4IRvjSkv/Xsfc0T+uq2YEGE8fKQGe6mshH3cbPDbJ50qcPtRfnJ8P
RTIjUMb8sO4uuiLGByc/Ah5Gf3phCYHxX9OGuWCOUM1krBRGuFXPfLNnyRjiUMk3
uU2Lf+XshJRqYNoWQv6m97SgfDpVmwocE41HZF+t4p4qtpRf0OuzogwSfaeadlE=
=tx2b
-----END PGP SIGNATURE-----


Title: Re: Electrum server discussion thread
Post by: orso on February 22, 2014, 10:18:12 AM
Hello i have sucessfully instaled and around two months testing our electrum server
electrum.psko.net
network:IPv4
ports: 8081,8082,50001,50002
location: Modra,Slovakia


Title: Re: Electrum server discussion thread
Post by: ThomasV on February 24, 2014, 05:17:41 PM
please note that the branch "fulltree" was merged to "master".
this means that if you pull, you will need to recreate your database, or import it from the foundry.
you will also need to install plyvel.
use the 'start' and 'stop' scripts to start and stop the server.


Title: Re: Electrum server discussion thread
Post by: fireduck on March 03, 2014, 06:20:45 PM
please note that the branch "fulltree" was merged to "master".
this means that if you pull, you will need to recreate your database, or import it from the foundry.
you will also need to install plyvel.
use the 'start' and 'stop' scripts to start and stop the server.


Cool.

Is turning on irc in the config the thing to do to advertise your node?

Will there be foundry release of fulltree with a pruning limit of greater than 100? 


Title: Re: Electrum server discussion thread
Post by: fireduck on March 04, 2014, 04:55:29 PM
please note that the branch "fulltree" was merged to "master".
this means that if you pull, you will need to recreate your database, or import it from the foundry.
you will also need to install plyvel.
use the 'start' and 'stop' scripts to start and stop the server.


Cool.

Is turning on irc in the config the thing to do to advertise your node?

Will there be foundry release of fulltree with a pruning limit of greater than 100? 

Just in case someone is having the same trouble as me.  When I ran the foundry fulltree version from Feb I got an error saying it was deprecated.  I imagine something in the format changed.  Anyways, I am building a db with 10000 pruning limit with fulltree.  It is going and when it is done I'll tar it up and post it for others.  I only have it going at an acceptable speed by using a high memory Google Compute Engine node and having it all in RAM.  Even so, it is not fast.

If someone wants me to, I can continue to tar and make available these snapshots.

[04/03/2014-16:28:35] catch_up: block 187000 (6.610s 399.142s) d14d45e45081f4cc72ecce4d0e6ca2f3a038f8e2a3d61e63c7a9646ceef225d3



Title: Re: Electrum server discussion thread
Post by: Pontius on March 04, 2014, 07:27:27 PM
Just in case someone is having the same trouble as me.  When I ran the foundry fulltree version from Feb I got an error saying it was deprecated.  I imagine something in the format changed.  [...]

Here's the format change which makes the foundry full tree version (from Feb 17th) unusable:
https://github.com/spesmilo/electrum-server/commit/7164e2928d341fe197b68a9966542e7be1e26709
https://github.com/spesmilo/electrum-server/commit/2a8c19f5f3bdae38e9ef89bf7515dc10a7bb1893

And there's already somebody building a 10k db. I guess you'll be better of if you just wait for his db.


Title: Re: Electrum server discussion thread
Post by: fireduck on March 04, 2014, 08:27:52 PM
Just in case someone is having the same trouble as me.  When I ran the foundry fulltree version from Feb I got an error saying it was deprecated.  I imagine something in the format changed.  [...]

Here's the format change which makes the foundry full tree version (from Feb 17th) unusable:
https://github.com/spesmilo/electrum-server/commit/7164e2928d341fe197b68a9966542e7be1e26709
https://github.com/spesmilo/electrum-server/commit/2a8c19f5f3bdae38e9ef89bf7515dc10a7bb1893

And there's already somebody building a 10k db. I guess you'll be better of if you just wait for his db.

Just to be clear, do you mean someone other than me is already on it?


Title: Re: Electrum server discussion thread
Post by: Pontius on March 05, 2014, 10:42:34 AM
Just to be clear, do you mean someone other than me is already on it?

grnbrg (in IRC/#electrum) is buildung a 10k db.


Title: Re: Electrum server discussion thread
Post by: sd on April 06, 2014, 07:19:16 AM
I'm setting up an electrum server by following the instructions in HOWTO.md. I have some minor comments.

Unless I missed something 'start' can't find server.py.
  ln -s ~/src/electrum/server/start ~/bin/electrum-server
Should be something like:
  ln -s ~/src/electrum/server/server.py ~/bin/
  cp ~/src/electrum/server/stop ~/bin
  cp ~/src/electrum/server/start ~/bin

I needed to change the last line of the start file to log to somewhere I could write to.

The message electrum gives when starting is different from the message in the instructions. The first time I started the process I thought it didn't start right because of this.

Some guidance on what kind of disks I need for day to day operations would be good. Obviously the initial load needs a big ramdisk but once that is done are cheap SATA disks OK? or do I need expensive SAS or SSD disks? You don't recommend using tmpfs permanently do you?


Great work on electrum guys! Light clients are definitely the future.

EDIT:

Am I taking too long to process blocks here?
[07/04/2014-08:01:27] blockchain: 294612 (43.155s)
[07/04/2014-08:44:22] blockchain: 294613 (129.569s)
[07/04/2014-09:31:46] blockchain: 294614 (393.087s)
[07/04/2014-10:10:55] blockchain: 294615 (208.884s)
[07/04/2014-10:24:46] blockchain: 294618 (545.485s)
[07/04/2014-10:35:29] blockchain: 294619 (181.850s)


Title: Re: Electrum server discussion thread
Post by: C. Bergmann on April 07, 2014, 04:31:35 PM
Is there any electrum server which updatet to bitcon core (0.9.0) and enables transactions to be propagated with 0.00001 btc fee / kb?


Title: Re: Electrum server discussion thread
Post by: fireduck on April 09, 2014, 05:32:24 PM
Is there any electrum server which updatet to bitcon core (0.9.0) and enables transactions to be propagated with 0.00001 btc fee / kb?

I think mine meets those requirements.  b.1209k.com with the normal ports.

bitcoind getinfo
{
    "version" : 99900,
    "protocolversion" : 70002,


Title: Re: Electrum server discussion thread
Post by: Pontius on April 10, 2014, 08:27:43 AM
Is there any electrum server which updatet to bitcon core (0.9.0) and enables transactions to be propagated with 0.00001 btc fee / kb?

I've upgraded e2.pdmc.net (http://electrum.pdmc.net/) to 0.9.1 yesterday and adjusted the minimum fee accordingly.


Title: Re: Electrum server discussion thread
Post by: filchef on April 11, 2014, 04:32:49 PM
Is there any electrum server which updatet to bitcon core (0.9.0) and enables transactions to be propagated with 0.00001 btc fee / kb?

I've upgraded e2.pdmc.net (http://electrum.pdmc.net/) to 0.9.1 yesterday and adjusted the minimum fee accordingly.
Your server is not good configured when I connect to him hi don't show limit of users for all servers and when I change it with another hi disappear  from the list of servers.


Title: Re: Electrum server discussion thread
Post by: Pontius on April 13, 2014, 03:30:26 PM
Your server is not good configured when I connect to him hi don't show limit of users for all servers and when I change it with another hi disappear  from the list of servers.
Hmm, I wouldn't call that "not good configured" - the server just lost its connection to IRC. After restarting it everything is back to normal.
Anyway thank you for the hint!


Title: Re: Electrum server discussion thread
Post by: filchef on April 13, 2014, 09:42:52 PM
Your server is not good configured when I connect to him hi don't show limit of users for all servers and when I change it with another hi disappear  from the list of servers.
Hmm, I wouldn't call that "not good configured" - the server just lost its connection to IRC. After restarting it everything is back to normal.
Anyway thank you for the hint!

Again lost connection to IRC so I didnt try to use low fee 0.00001/kb with your server but with another servers ho use bitcoind  0.9.1 I try to send without suggest are you chek it is working with your server because I try with  <mr_burdell> from #electrum IRC chanel to fix him server without suggest - I send to him 0.0003 btc with fee 0.00001 but in him log there is dust error.


Title: Re: Electrum server discussion thread
Post by: raindex on April 21, 2014, 09:25:13 PM
Can anyone give me a hint on what might be going wrong with my server. Any time it catches up with the blockchain, it crashes. The exception error message suggests that bind() fails, however I can't see the reason for that happening, as all ports assigned in the configuration file are unused. Here is what I get in the log file:

Code:
[21/04/2014-12:37:56] Database version 3
[21/04/2014-12:37:56] Blockchain height 296956
[21/04/2014-12:37:56] UTXO tree root hash: 469a5e3385265bc67a0f9479cc26f012d31b6544728148faf594140411d964d3
[21/04/2014-12:37:56] Coins in database: 1267617386701994
[21/04/2014-12:37:56] catching up missing headers: 296934 296956
[21/04/2014-13:24:55] catch_up: block 297000 (4.029s 2814.156s) 36ce5c0b18d7b84140e4b87c8d0334046c267c024d1ef51fe34b43573a97d54f
[21/04/2014-14:04:53] Blockchain is up to date.
[21/04/2014-14:05:40] utxo not in database; postponing mempool update
[21/04/2014-14:05:40] Memory pool initialized.
[21/04/2014-14:05:40] TCP server started on port 50001
[21/04/2014-14:05:40] SSL server started on port 50002
[21/04/2014-14:05:40] Stopping Stratum
Exception in thread Thread-8:
Traceback (most recent call last):
  File "/usr/lib64/python2.7/threading.py", line 811, in __bootstrap_inner
    self.run()
  File "/home/bitcoin/src/electrum/server/transports/stratum_tcp.py", line 168, in run
    sock.bind((self.host, self.port))
  File "/usr/lib64/python2.7/socket.py", line 224, in meth
    return getattr(self._sock,name)(*args)
error: [Errno 99] Cannot assign requested address

Exception in thread Thread-7:
Traceback (most recent call last):
  File "/usr/lib64/python2.7/threading.py", line 811, in __bootstrap_inner
    self.run()
  File "/home/bitcoin/src/electrum/server/transports/stratum_tcp.py", line 168, in run
    sock.bind((self.host, self.port))
  File "/usr/lib64/python2.7/socket.py", line 224, in meth
    return getattr(self._sock,name)(*args)
error: [Errno 99] Cannot assign requested address

Exception in thread Thread-9:
Traceback (most recent call last):
  File "/usr/lib64/python2.7/threading.py", line 811, in __bootstrap_inner
    self.run()
  File "/home/bitcoin/src/electrum/server/transports/stratum_http.py", line 375, in run
    self.server = StratumThreadedServer((self.host, self.port))
  File "/home/bitcoin/src/electrum/server/transports/stratum_http.py", line 294, in __init__
    SocketServer.TCPServer.__init__(self, addr, requestHandler, bind_and_activate)
  File "/usr/lib64/python2.7/SocketServer.py", line 419, in __init__
    self.server_bind()
  File "/usr/lib64/python2.7/SocketServer.py", line 430, in server_bind
    self.socket.bind(self.server_address)
  File "/usr/lib64/python2.7/socket.py", line 224, in meth
    return getattr(self._sock,name)(*args)
error: [Errno 99] Cannot assign requested address

Exception in thread Thread-10:
Traceback (most recent call last):
  File "/usr/lib64/python2.7/threading.py", line 811, in __bootstrap_inner
    self.run()
  File "/home/bitcoin/src/electrum/server/transports/stratum_http.py", line 370, in run
    self.server = StratumThreadedServer((self.host, self.port), self.certfile, self.keyfile)
  File "/home/bitcoin/src/electrum/server/transports/stratum_http.py", line 327, in __init__
    SSLTCPServer.__init__(self, addr, certfile, keyfile, requestHandler, bind_and_activate)
  File "/home/bitcoin/src/electrum/server/transports/stratum_http.py", line 263, in __init__
    self.server_bind()
  File "/usr/lib64/python2.7/SocketServer.py", line 430, in server_bind
    self.socket.bind(self.server_address)
  File "/usr/lib64/python2.7/socket.py", line 224, in meth
    return getattr(self._sock,name)(*args)
error: [Errno 99] Cannot assign requested address

[21/04/2014-14:05:50] Stopping timer
[21/04/2014-14:05:50] Closing database...
[21/04/2014-14:05:50] Database is closed
[21/04/2014-14:05:50] Electrum Server stopped


Title: Re: Electrum server discussion thread
Post by: raindex on April 22, 2014, 06:01:24 AM
Got it. In the configuration file, host should resolve to the address of an interface where the server should listen for new connections. For public server it should probably be 0.0.0.0. The name used by clients and peers to connect to the server should be defined in report_host.


Title: Re: Electrum server discussion thread
Post by: s4 on April 23, 2014, 05:56:41 PM

Hi all,

I just got my electrum server up and running today. All seems to be operating fine, but I am receiving this mesage in the logs:

KICK E_f6ee30c3ff:wrong_hash

This looks to be something to do with the IRC server for finding peers. Is this something to be concerned about?


Title: Re: Electrum server discussion thread
Post by: raindex on April 23, 2014, 11:30:35 PM
I'm having the same problem. Folks at IRC suggested to redownload the DB from foundry.


Title: Re: Electrum server discussion thread
Post by: ThomasV on April 24, 2014, 06:33:54 AM
Electrum servers build and maintain a merkle hash tree of the set of UTXOs in the blockchain.
Your server will be kicked from IRC if it does not advertise the correct root hash.


Title: Re: Electrum server discussion thread
Post by: raindex on April 25, 2014, 12:36:08 AM
Redownloading latest DB indeed fixed the problem.

Now I wonder what the following lines mean. Is this normal?

[24/04/2014-00:33:26] utxo not in database; postponing mempool update
[24/04/2014-00:33:37] utxo not in database; postponing mempool update


Title: Re: Electrum server discussion thread
Post by: s4 on April 25, 2014, 07:53:13 PM

Fixed it for me as well.

I was able to reproduce the problem by starting the server without setting an appropriate limit for maximum open files. After an exception was thrown for too many open files, correcting the maximum open files and restarting the server caused my server to be kicked from IRC.



Title: Re: Electrum server discussion thread
Post by: ThomasV on April 28, 2014, 03:44:30 PM
Four Electrum servers need to be updated:

 E_SLUSH
 E_206I
 E_CryptoPusH
 E_mg

They are running with the old 0.8 protocol (not used by recent clients), and they often get rejected from the IRC channel due to excess flood (this bug has been corrected for a while).
Please upgrade!



Title: Re: Electrum server discussion thread
Post by: Martok88 on May 22, 2014, 08:48:57 PM
Hi everyone. I've got my server up and running, and I'm able to connect to it using a copy of Electrum running on the same machine. However I'm unable to connect to it from my windows PC on the same network. I've tried each of the protocols and double checked the config, everything looks fine as far as I can tell. Any help would be appreciated.

Edit: I tried using both the server's LAN IP and its hostname to connect.

Edit2: I read through some previous posts and fixed the probelm by setting host to 0.0.0.0 in electrum.conf

If I'm able to store either the blockchain or Electrum's leveldb on an SSD, but not both, which would be better?


Title: Re: Electrum server discussion thread
Post by: Pontius on July 07, 2014, 01:51:47 PM
Third time in 2 or 3 months that the database of my server e2.pdmc.net broke ("wrong_hash"). Is this just me or are other operators experiencing this as well?
Anyway, I'll take my server offline for now and bring it back online once I find enough time to move it faster hardware (probably in August).


Title: Re: Electrum server discussion thread
Post by: it-zone on July 07, 2014, 02:17:47 PM
Third time in 2 or 3 months that the database of my server e2.pdmc.net broke ("wrong_hash"). Is this just me or are other operators experiencing this as well?
Anyway, I'll take my server offline for now and bring it back online once I find enough time to move it faster hardware (probably in August).

I have the same, I moved to Samsung 840 SSD but database is still breaking sometimes, without a clear reason.

S.


Title: Re: Electrum server discussion thread
Post by: raindex on July 07, 2014, 05:19:29 PM
Third time in 2 or 3 months that the database of my server e2.pdmc.net broke ("wrong_hash"). Is this just me or are other operators experiencing this as well?
Anyway, I'll take my server offline for now and bring it back online once I find enough time to move it faster hardware (probably in August).

I have the same, I moved to Samsung 840 SSD but database is still breaking sometimes, without a clear reason.

I never had this problem, while running the server on a very old and busy box.

Do both of you want to share particulars of your setup to see if there are any similarities?


Title: Re: Electrum server discussion thread
Post by: it-zone on July 08, 2014, 01:30:18 AM
I have nothing extraordinary in the config to show :)


Title: Re: Electrum server discussion thread
Post by: grnbrg on July 08, 2014, 03:04:23 AM
Third time in 2 or 3 months that the database of my server e2.pdmc.net broke ("wrong_hash"). Is this just me or are other operators experiencing this as well?
Anyway, I'll take my server offline for now and bring it back online once I find enough time to move it faster hardware (probably in August).

Do you have the open files limit set sufficiently high? 

Code:
ulimit -n

should show 16k or higher.



grnbrg.


Title: Re: Electrum server discussion thread
Post by: Pontius on July 08, 2014, 06:39:32 AM
Do you have the open files limit set sufficiently high? 
Code:
ulimit -n
should show 16k or higher.

That shouldn't be the problem - nofile is set to 32k in the upstart script.

My setup:
Ubuntu 12.04 LTS (kernel 3.2.0) w/Python 2.7.3; latest Electrum server from git; leveldb 1.9.0; plyvel 0.8



Title: Re: Electrum server discussion thread
Post by: grnbrg on July 08, 2014, 01:24:17 PM
Do you have the open files limit set sufficiently high? 
Code:
ulimit -n
should show 16k or higher.

That shouldn't be the problem - nofile is set to 32k in the upstart script.

My setup:
Ubuntu 12.04 LTS (kernel 3.2.0) w/Python 2.7.3; latest Electrum server from git; leveldb 1.9.0; plyvel 0.8



What does the ulimit command show for the userid running the server, though?  On most Linuxes, max open files is set to 1024, and this limit can not be raised by non-root users.

You probably need to add a line to /etc/security/limits.conf to give your server user a higher soft/hard limit. ie:

Code:
electrum    soft    nofile    16384
electrum    hard   nofile    16384


grnbrg.


Title: Re: Electrum server discussion thread
Post by: Pontius on July 09, 2014, 05:08:51 AM
What does the ulimit command show for the userid running the server, though?  On most Linuxes, max open files is set to 1024, and this limit can not be raised by non-root users.

As said the 'ulimit' is not the problem:
Code:
$ ps -efa|grep server.py |grep -v grep
electrum 24942     1  0 06:59 ?        00:00:00 /usr/bin/python -u server.py

$ cat /proc/24942/limits
Limit                     Soft Limit           Hard Limit           Units
Max cpu time              unlimited            unlimited            seconds
Max file size             unlimited            unlimited            bytes
Max data size             unlimited            unlimited            bytes
Max stack size            8388608              unlimited            bytes
Max core file size        0                    unlimited            bytes
Max resident set          unlimited            unlimited            bytes
Max processes             15862                15862                processes
Max open files            32768                32768                files
Max locked memory         65536                65536                bytes
Max address space         unlimited            unlimited            bytes
Max file locks            unlimited            unlimited            locks
Max pending signals       15862                15862                signals
Max msgqueue size         819200               819200               bytes
Max nice priority         0                    0
Max realtime priority     0                    0
Max realtime timeout      unlimited            unlimited            us


Title: Re: Electrum server discussion thread
Post by: g0dcompl3x on July 14, 2014, 10:47:55 PM
I don't know how to edit/create/activate any server on my Electrum. I use a Window and any expert could just put a link here where I can learn about it. I know what you're thinking, but it's effortless to help me out here. Thanks


Title: Re: Electrum server discussion thread
Post by: grnbrg on July 15, 2014, 01:01:43 AM
I don't know how to edit/create/activate any server on my Electrum. I use a Window and any expert could just put a link here where I can learn about it. I know what you're thinking, but it's effortless to help me out here. Thanks

At the risk of being rude, https://github.com/spesmilo/electrum-server/blob/master/HOWTO.md

If this is not sufficient to get you going, you probably shouldn't be running an Electrum server.


grnbrg.


Title: Re: Electrum server discussion thread
Post by: sd on July 25, 2014, 08:16:34 PM
I'm running the most recent electrum server from GIT. The logfile seems to be missing blocks, is the following normal?

Code:
[25/07/2014-20:48:22] blockchain: 312457 (82.964s)
[25/07/2014-20:58:35] blockchain: 312458 (194.778s)
[25/07/2014-21:02:21] blockchain: 312460 (128.478s)
[25/07/2014-21:10:27] blockchain: 312462 (250.398s)
[25/07/2014-21:16:38] blockchain: 312463 (166.109s)
[25/07/2014-21:22:49] blockchain: 312464 (212.260s)
[25/07/2014-21:51:48] blockchain: 312466 (670.598s)
[25/07/2014-21:56:06] blockchain: 312468 (168.989s)
[25/07/2014-22:04:08] blockchain: 312469 (166.773s)

Why do I not get a log message for every block?


Title: Re: Electrum server discussion thread
Post by: ThomasV on August 08, 2014, 06:59:44 PM
I'm running the most recent electrum server from GIT. The logfile seems to be missing blocks, is the following normal?

Code:
[25/07/2014-20:48:22] blockchain: 312457 (82.964s)
[25/07/2014-20:58:35] blockchain: 312458 (194.778s)
[25/07/2014-21:02:21] blockchain: 312460 (128.478s)
[25/07/2014-21:10:27] blockchain: 312462 (250.398s)
[25/07/2014-21:16:38] blockchain: 312463 (166.109s)
[25/07/2014-21:22:49] blockchain: 312464 (212.260s)
[25/07/2014-21:51:48] blockchain: 312466 (670.598s)
[25/07/2014-21:56:06] blockchain: 312468 (168.989s)
[25/07/2014-22:04:08] blockchain: 312469 (166.773s)

Why do I not get a log message for every block?

if several blocks are available, it processes them together, before it prints a log line.
I agree that it can be confusing, it should probably print a message on each block


Title: Re: Electrum server discussion thread
Post by: sd on August 14, 2014, 05:28:58 PM
Thomas,

You put a lot of great work into Electrum but it's all a bit lost if people can't easily get the server running. Can you update the install instructions? Right now HOWTO.md references start and stop scripts that don't exist. The TLDR section at the top of INSTALL doesn't result in a running server, nor do the full instruction in that file.

I tried to do it myself and send a pull request but I've no idea what the instructions should be. Whatever I try 'python setup.py install' won't install the src module on ubuntu 14.04 so electrum_server.py won't run. It was all working so nicely until I upgraded.

If you want people to run servers it should be as easy as possible for those guys.


Title: Re: Electrum server discussion thread
Post by: it-zone on August 14, 2014, 05:35:10 PM
Can you update the install instructions? Right now HOWTO.md references start and stop scripts that don't exist. The TLDR section at the top of INSTALL doesn't result in a running server, nor do the full instruction in that file.

Give Thomas few days, it is completely new version of the server :) I will install it soon and I might be able to improve the docs.


Title: Re: Electrum server discussion thread
Post by: sd on August 14, 2014, 06:40:19 PM
Give Thomas few days, it is completely new version of the server :) I will install it soon and I might be able to improve the docs.

I got it running with some minor hacks. I didn't see any tags in the repo. Release tags might be a good idea so if something doesn't work I can just go back to the last tag.

EDIT: Actually, no I didn't get it running. It's choking on a futex.


Title: Re: Electrum server discussion thread
Post by: ThomasV on August 15, 2014, 06:58:21 AM
Give Thomas few days, it is completely new version of the server :) I will install it soon and I might be able to improve the docs.

I got it running with some minor hacks. I didn't see any tags in the repo. Release tags might be a good idea so if something doesn't work I can just go back to the last tag.

EDIT: Actually, no I didn't get it running. It's choking on a futex.


I fixed setup.py yesterday.. let me know


Title: Re: Electrum server discussion thread
Post by: sd on August 15, 2014, 08:12:31 AM
I fixed setup.py yesterday.. let me know

I get different problems now.
Code:
zipimport.ZipImportError: bad local file header in /usr/local/lib/python2.7/dist-packages/electrum_server-0.9-py2.7.egg

This apparently means there is a syntax error somewhere, possibly python code that only works with a higher version. The error message makes it look like a ZIP error, which it isn't. If I run 'python setup.py install' again it seems to work and it seems to run. I can't connect but that may be because it's updating.

I really need to test this on a clean machine.


Title: Re: Electrum server discussion thread
Post by: Martok88 on August 17, 2014, 02:33:38 PM
Is it possible to patch the memory allocation bug manually, in the previous version of electrum-server? I attempted to update to the new version but ran into problems, including permission errors.


Title: Re: Electrum server discussion thread
Post by: sd on August 23, 2014, 08:58:54 AM
Is it possible to patch the memory allocation bug manually, in the previous version of electrum-server? I attempted to update to the new version but ran into problems, including permission errors.

I really think what this project needs is a release cycle. The version on github is a development version. That's fine but we are going to get frustrated if we try and use it as a production version. I gave up running the new server, if there was a stable tag I would have gone back to that.

I did think of taking a known good version, scripting all setup, and putting it in a docker container. That way setting up a new server would be as easy as 'docker run blahblah/electrum-server' and waiting until it set itself up.


Title: Re: Electrum server discussion thread
Post by: tnkflx on August 23, 2014, 10:30:06 PM
Is it possible to patch the memory allocation bug manually, in the previous version of electrum-server? I attempted to update to the new version but ran into problems, including permission errors.

I really think what this project needs is a release cycle. The version on github is a development version. That's fine but we are going to get frustrated if we try and use it as a production version. I gave up running the new server, if there was a stable tag I would have gone back to that.

I did think of taking a known good version, scripting all setup, and putting it in a docker container. That way setting up a new server would be as easy as 'docker run blahblah/electrum-server' and waiting until it set itself up.

I've been running an Electrum server for almost 2 years now and to be honest it's been running very stable. Yes, there are the occasional bugs, but they are solved quickly by Thomas. You should hang out in the IRC channel though to follow up on the latest developments..


Title: Re: Electrum server discussion thread
Post by: tl121 on November 21, 2014, 12:38:48 AM
Has anybody profiled the Python code for electrum server?  It seems slow to me, about four times slower than bitcoind.  Not a problem right now keeping up with blocks, but if the block size gets expanded and transaction rate continues to increase then there is likely to be a problem.  I am using the latest code from github.  I am running a private server on a 1.4 GHz Haswell based atom server with 8 GB of RAM and an SSD.  A recent 1 MB block took about 200 seconds to process according to the log. This had 99% CPU utilization while processing the large block.

Perhaps there are some tuning suggestions around, but I wasn't able to find any.







Title: Re: Electrum server discussion thread
Post by: ingrownpocket on December 04, 2014, 06:52:54 PM
What's the disk size required at the moment to run an Electrum server?


Title: Re: Electrum server discussion thread
Post by: molecular on December 04, 2014, 07:24:40 PM
What's the disk size required at the moment to run an Electrum server?

On my host, in addition to bitcoind data, it currently uses 16GB (pruning_limit=10000)


Title: Re: Electrum server discussion thread
Post by: ingrownpocket on December 04, 2014, 07:38:48 PM
What's the disk size required at the moment to run an Electrum server?
On my host, in addition to bitcoind data, it currently uses 16GB (pruning_limit=10000)
Was hoping I could run an Electrum server on a $10 VPS on DigitalOcean. I'll have to find another host then. Thanks.


Title: Re: Electrum server discussion thread
Post by: jack_jin on December 23, 2014, 08:52:04 AM
  I have a trouble when i installed the electrum server.
every thing 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 key word "_ZN6snappy13RawUncompressEPKcmP". i found a reference in this page("https://github.com/wbolster/plyvel/issues/5"). I do as this page said, but finally failed.
my leveldb is 1.9, i install the liblevedb1,libleveldb-dev,plyvel.

can somebody help me with this big problem.thanks a lot!
 :(


Title: Re: Electrum server discussion thread
Post by: BadAss.Sx on February 24, 2015, 01:31:27 PM
electrum.badass.sx (p10000) is added with no logging (/dev/null).

On my host, in addition to bitcoind data, it currently uses 16GB (pruning_limit=10000)


Don't forget, you need the BTC blockchain also which is 37GB atm.


Title: electrum-server does not respond
Post by: fex on April 03, 2015, 05:13:26 PM
Hi,

I'm setting up an electrum server and have a problem getting the run_electrum_server running correctly - this process does not seem to respond.

Steps taken:
- installed electrum server using the provided python script
- setup a user account and specified it in /etc/electrum.conf
- increased allowed file handels for user in /etc/security/limits.conf
- downloaded a leveldb dump, set ownership of all files to user

- start server:
Code:
> sudo electrum-server start
Starting server as daemon
bash: line 0: ulimit: open files: cannot modify limit: Operation not permitted
nohup: redirecting stderr to stdout

- log says:
Code:
[03/04/2015-19:01:15] Starting Electrum server on XXX.XXX.XXX.XXX
[03/04/2015-19:01:15] Database version 3
[03/04/2015-19:01:15] Blockchain height 350446
[03/04/2015-19:01:15] UTXO tree root hash: b8bcc0587c80e07e3fd56da7e85faf2676d8dc35da1b1094f236936af1eeb958
[03/04/2015-19:01:15] Coins in database: 1400838008059941
[03/04/2015-19:01:15] TCP server started on XXX.XXX.XXX.XXX:50001

Now if I try "sudo electrum-server getinfo" the electrum-server process blocks and nothing happens. The log does not show anything. Process cpu usage is at ~100%.

Any suggestions on how to debug this?


Title: Re: Electrum server discussion thread
Post by: JWU42 on April 03, 2015, 09:28:52 PM
@fex,

The electrum-server DB has to catch-up.  It isn't a verbose process but seeing the CPU usage will assure you it is working.  The log will only update after passing every 1000 blocks.  Note it can take an hour or two to catch-up just 10-12 hours (on a modern CPU with an SSD).



Title: Re: Electrum server discussion thread
Post by: Lexiko on April 17, 2015, 12:48:51 PM
Hi! Does anybody have any working sample of using Electrum RPC daemon using curl?

I'm trying to use such request (this was taken from bitcoind rpc server sample):

Code:
curl --data-binary '{ "id": 0, "method": "server.version", "params": [ "1.9.5", "0.6" ] }'  -H 'content-type: text/plain;' http://127.0.0.1:8000/

... but as a result I have an answer:

Code:
<value><string>&lt;class 'xml.parsers.expat.ExpatError'&gt;:not well-formed (invalid token): line 1, column 0</string></value>


Title: Re: electrum-server does not respond
Post by: fex on April 27, 2015, 09:19:40 PM
Now if I try "sudo electrum-server getinfo" the electrum-server process blocks and nothing happens. The log does not show anything. Process cpu usage is at ~100%.

Any suggestions on how to debug this?
@fex,

The electrum-server DB has to catch-up.  It isn't a verbose process but seeing the CPU usage will assure you it is working.  The log will only update after passing every 1000 blocks.  Note it can take an hour or two to catch-up just 10-12 hours (on a modern CPU with an SSD).

Yes, I found this to be the case, but there was another thing.

I finally had some time to look into the problem: there were too many files open. I did change the limit for this in /etc/security/limits.conf as described on github, however, two things to note:

1. If you put an entry like "<bitcoinuser> hard nofile 65536" in limits.conf, it will only work if <bitcoinuser> is really logged in. It does not work (at least on Ubuntu 14.10) when another user account loggs in and then uses "su" to get into the <bitcoinuser> account. This might be a problem when using "electrum-server" binary as it seems to use "su". To solve this, I added limits.conf-entries for the "really logged in" user account that starts the "electrum-server" binary.

Maybe this information could be added to the readme on Github somehow.

2. The error indicating that too many files were open was burried under a stack trace that I got when I was running run_electrum_server directly (instead of "electrum-server start"). It did not show up in the log file.



Regards,

Felix


Title: Re: Electrum server discussion thread
Post by: ThomasV on April 28, 2015, 07:30:20 AM
It happens a lot that my server (electrum.0x0000.de) gets kicked from the list.

I'm thinking it might be because it takes quite a while for it to digest new blocks and it's marked as "lagging".

Is that possible?

No, a server does not get kicked because it is lagging.
It happens because your database is corrupted, and your server fails to produce the correct root hash.

database corruption may occur if you do not shutdown your server cleanly.


Title: Re: Electrum server discussion thread
Post by: molecular on April 29, 2015, 04:17:10 PM
It happens a lot that my server (electrum.0x0000.de) gets kicked from the list.

I'm thinking it might be because it takes quite a while for it to digest new blocks and it's marked as "lagging".

Is that possible?

No, a server does not get kicked because it is lagging.
It happens because your database is corrupted, and your server fails to produce the correct root hash.

database corruption may occur if you do not shutdown your server cleanly.

Well, it's on and off the list without me doing anything.

If the root hash is wrong, is the db automatically repaired or something?


Title: Re: Electrum server discussion thread
Post by: JWU42 on April 30, 2015, 09:10:44 PM

If the root hash is wrong, is the db automatically repaired or something?


Nope, need to download a new version from the foundry (http://foundry.electrum.org/leveldb-dump/).  I wouldn't suggest building a new one as it will take over a month (I know, doing it now)


Title: Re: Electrum server discussion thread
Post by: molecular on May 31, 2015, 06:57:53 AM
just pulled newest master from https://github.com/spesmilo/electrum-server.git

Not sure if It's new, but I'm seeing this in the log:

Code:
INFO:electrum:joining IRC
Exception in thread Thread-6:
Traceback (most recent call last):
  File "/usr/lib/python2.7/threading.py", line 552, in __bootstrap_inner
    self.run()
  File "/home/nick/electrum-server/src/ircthread.py", line 118, in run
    client = irc.client.Reactor()
AttributeError: 'module' object has no attribute 'Reactor'

my wild guess: my python-irclib is outdated? I'm on debian:

Code:
user@null:~/electrum-server$ apt-cache show python-irclib
Package: python-irclib
Version: 0.4.8-1

EDIT: problem now obsolete. I had to migrate to a different server (now ssd ;-) for harddrive failure reasons and the problem doesn't occur there. I also again have more than 10 session. I guess my irc stuff was borked all along.


Title: Re: Electrum server discussion thread
Post by: ozboy2014 on June 01, 2015, 08:19:28 AM
Hi, can you please take a look and assist if you can. Thanks.

https://bitcointalk.org/index.php?topic=1053864.msg11494471#msg11494471


Title: Re: Electrum server discussion thread
Post by: JWU42 on June 01, 2015, 10:42:11 AM
Hi, can you please take a look and assist if you can. Thanks.

https://bitcointalk.org/index.php?topic=1053864.msg11494471#msg11494471

Electrum for DOGE?!?



Title: Re: Electrum server discussion thread
Post by: Dogedarkdev on June 01, 2015, 04:40:36 PM
Hi, can you please take a look and assist if you can. Thanks.

https://bitcointalk.org/index.php?topic=1053864.msg11494471#msg11494471

Electrum for DOGE?!?



DOGED*

the client is complete, we are just having some issues with the back end (electrum server)

https://bitcointalk.org/index.php?topic=1053864.msg11504413#msg11504413


Title: Re: electrum-server does not respond
Post by: jadedjack on June 05, 2015, 04:32:46 AM
Now if I try "sudo electrum-server getinfo" the electrum-server process blocks and nothing happens. The log does not show anything. Process cpu usage is at ~100%.

Any suggestions on how to debug this?
@fex,

The electrum-server DB has to catch-up.  It isn't a verbose process but seeing the CPU usage will assure you it is working.  The log will only update after passing every 1000 blocks.  Note it can take an hour or two to catch-up just 10-12 hours (on a modern CPU with an SSD).

Yes, I found this to be the case, but there was another thing.

I finally had some time to look into the problem: there were too many files open. I did change the limit for this in /etc/security/limits.conf as described on github, however, two things to note:

1. If you put an entry like "<bitcoinuser> hard nofile 65536" in limits.conf, it will only work if <bitcoinuser> is really logged in. It does not work (at least on Ubuntu 14.10) when another user account loggs in and then uses "su" to get into the <bitcoinuser> account. This might be a problem when using "electrum-server" binary as it seems to use "su". To solve this, I added limits.conf-entries for the "really logged in" user account that starts the "electrum-server" binary.

Maybe this information could be added to the readme on Github somehow.

2. The error indicating that too many files were open was burried under a stack trace that I got when I was running run_electrum_server directly (instead of "electrum-server start"). It did not show up in the log file.



Regards,

Felix


This page describes how to increase the open files limit for a user
https://github.com/spesmilo/electrum-server/blob/master/HOWTO.md#step-10-tweak-your-system-for-running-electrum (https://github.com/spesmilo/electrum-server/blob/master/HOWTO.md#step-10-tweak-your-system-for-running-electrum)

Code:
 sudo echo "bitcoin hard nofile 65536" >> /etc/security/limits.conf
 sudo echo "bitcoin soft nofile 65536" >> /etc/security/limits.conf

In Ubuntu 14.04 you must also edit /etc/pam.d/common-session
Code:
sudo nano  /etc/pam.d/common-session

Add this to the end of the file
Code:
session required pam_limits.so





Title: Re: Electrum server discussion thread
Post by: kamk on June 05, 2015, 08:08:19 AM
It happened yesterday, from /var/log/electrum.log:

[04/06/2015-18:35:52] addr not in tree 1c0b8f470c0b7a32792c6cbacf3a9b00e72d93b1e516b1d2de130ab4a4e2be1dde3570be097e005 f0ebacca65b21aa859bfa4f1a01000000 13ZHmZ15qKNLbttUFZoTYDdwhqfpfjZGmP !7l<NP><NUL><NUL><NUL><NUL>s{<NUL>

The server then stopped catching up with bitcoind and I had to download snapshot from foundry. I checked syslog but found no errors reported regarding the disk.


Title: Re: Electrum server discussion thread
Post by: btcash on June 09, 2015, 08:02:58 PM
Thomas could you please post your opinion on this issue:

http://www.reddit.com/r/Electrum/comments/38qi2m/20_mb_blocks_the_end_of_electrum/


Title: Re: Electrum server discussion thread
Post by: tl121 on June 09, 2015, 10:16:01 PM
Thomas could you please post your opinion on this issue:

http://www.reddit.com/r/Electrum/comments/38qi2m/20_mb_blocks_the_end_of_electrum/

It seems likely that only a small change will be needed to the server code to handle larger blocks.  However, there is a more serious problem related to the traffic load of the bitcoin network.  The Electrum server code is inefficient and with a slow processor can often fall behind the Bitcoin network.  Even with the present size blocks if a large block hits the network immediately followed by a second block then the server will be two blocks back and the client will report that the server is lagging.

I run a private Electrum server on an Atom (Haswell) based Intel NUC, with 8 GB RAM and an SSD. Bitcoind has no problem keeping up with the network, using only a few percent of the CPU load and this slow machine would have a chance of keeping up with 20MB blocks, given that it is running at about 3 percent CPU loading today.  However, the Electrum server uses about seven times as much CPU time per block as bitcoind, so there is zero chance it will handle a large expansion in network transaction rate. Actually, I consider this server code to be marginal with present network traffic, because I get occasional "server lagging" messages with my clients. Incidentally, one of the things that put me off from Electrum a few years ago were these "server lagging" messages, which I took to be an indication that something was wrong with the Electrum system.  People want to start their client and immediately do a transaction without any network delays or other BS. (In this regard even with the typical "lagging" delays, quick start up with Electrum is still better than Multibit if the client has been off-line for several days, at least with my network access speed.  If bitcoind is not kept online 24/7 then its start up performance is worse than hopeless.)

I assume that the Electrum server code could be tweaked or rewritten to make it run substantially faster.  I can think of no good reason why the Electrum server should use any more processor time than Bitcoin while keeping up with the network. Indeed, on my system the unavoidable use of processor time is probably doing signature checking by bitcoind. It don't believe there is anything that the Electrum Server needs to do that is remotely as CPU intensive.  If I had limited RAM or a spinning rust disk then perhaps there would be a hard reason why the Electrum server was slow.

I'm not complaining at present, but I think some work is needed and is possible to cover future increases in network traffic.






Title: Re: Electrum server discussion thread
Post by: ThomasV on July 01, 2015, 08:06:26 AM
if you run an electrum server, it is time to upgrade!

Two fixes were added recently:
 - support for arbitrary p2sh scripts (will be required by electrum 2.4 client)
 - memory pool efficiency fix, added after the recent 'stress test' (servers without this patch are too slow)

note: 2.4 clients will only connect to servers that have upgraded


Title: Re: Electrum server discussion thread
Post by: tl121 on July 02, 2015, 05:51:42 PM
if you run an electrum server, it is time to upgrade!

Two fixes were added recently:
 - support for arbitrary p2sh scripts (will be required by electrum 2.4 client)
 - memory pool efficiency fix, added after the recent 'stress test' (servers without this patch are too slow)

note: 2.4 clients will only connect to servers that have upgraded

Thanks for the update.  It was quick and easy to install.

The server seems to run smoother between blocks.  However, when a new full block shows up the server still takes a long time to process the block, over two minutes for a full 1 MB block. In the past 12 hours electrum-server has consumed more than four times as much CPU time as bitcoin core. The server machine is completely CPU bound while processing a new block. The machine hardware is a Haswell Atom machine, running with 8 GB of RAM and SSD.


Title: Re: Electrum server discussion thread
Post by: BadAss.Sx on July 04, 2015, 06:22:24 PM
Hi, how do i upgrade...is there a simple method?

Sorry for asking if it is too much asked :)


Title: Re: Electrum server discussion thread
Post by: JWU42 on July 04, 2015, 07:22:35 PM
Assumes you are starting in your home directory and the server is in ~/electrum-server
Code:
cd electrum-server
git pull
sudo python setup.py install


Title: Re: Electrum server discussion thread
Post by: BadAss.Sx on July 04, 2015, 07:45:49 PM
I did that and all went fine without errors, but now i read this in my log and can't connect to my server:

Quote
[04/07/2015-21:38:48] Signal handler called with signal 15
[04/07/2015-21:38:48] Stopping Stratum
[04/07/2015-21:38:49] Closing database...
[04/07/2015-21:38:49] Database is closed
[04/07/2015-21:38:49] Electrum Server stopped
[04/07/2015-21:40:10] Starting Electrum server on electrum.badass.sx
[04/07/2015-21:40:17] Database version 3
[04/07/2015-21:40:17] Blockchain height 363830
[04/07/2015-21:40:17] UTXO tree root hash: d229909f0021c67165fd317a9bb519125996b68335b2aff3ef4651339d5174d7
[04/07/2015-21:40:17] Coins in database: 1434314010655316
[04/07/2015-21:40:17] TCP server started on 94.102.50.70:50001
[04/07/2015-21:40:17] SSL server started on 94.102.50.70:50002
[04/07/2015-21:40:17] bitcoind still warming up...
[04/07/2015-21:40:27] bitcoind still warming up...
[04/07/2015-21:40:37] bitcoind still warming up...
[04/07/2015-21:40:47] bitcoind still warming up...
[04/07/2015-21:40:57] bitcoind still warming up...
[04/07/2015-21:41:07] bitcoind still warming up...
[04/07/2015-21:41:17] bitcoind still warming up...
[04/07/2015-21:41:27] bitcoind still warming up...
[04/07/2015-21:41:37] bitcoind still warming up...
[04/07/2015-21:41:47] bitcoind still warming up...

Any idea what is going on? In top i don't see anything strange.

When i do bitcoin-cli getblockchaininfo

Quote
{
    "chain" : "main",
    "blocks" : 363834,
    "headers" : 363834,
    "bestblockhash" : "0000000000000000011cef43d1c689b097bd15410151f6b2666a6f683a7ff659",
    "difficulty" : 49402014931.22746277,
    "verificationprogress" : 0.99999607,
    "chainwork" : "00000000000000000000000000000000000000000008295a3c16c8d1fb7190dc"
}

But when i read the electrum-server log

Quote
[04/07/2015-21:57:55] Starting Electrum server on electrum.badass.sx
[04/07/2015-21:57:56] Database version 3
[04/07/2015-21:57:56] Blockchain height 363830
[04/07/2015-21:57:56] UTXO tree root hash: d229909f0021c67165fd317a9bb519125996b68335b2aff3ef4651339d5174d7
[04/07/2015-21:57:56] Coins in database: 1434314010655316
[04/07/2015-21:57:56] TCP server started on 94.102.50.70:50001
[04/07/2015-21:57:56] SSL server started on 94.102.50.70:50002

It looks like the blockchain height isn't synchronising properly because it says 363830 instead of 363834.

EDIT: changed the file limits to 64k to see what that does, but i had it already static in limits.conf, but when i did ulimit -n it told me 1024. Because electrum-server needs to be run under root i have added the same lines for root also in the limits.conf. Now it is syncing i guess, because cpu load it around 20% all the time, but no specific new lines in the log...so i wait until it is done with its job and see what happens then.


Title: Re: Electrum server discussion thread
Post by: JWU42 on July 04, 2015, 09:08:53 PM
Now it is syncing i guess, because cpu load it around 20% all the time, but no specific new lines in the log...so i wait until it is done with its job and see what happens then.

The log only outputs every 1000 blocks.

You can do...

Code:
electrum-server getinfo

To get an output of what block it is working on...


Title: Re: Electrum server discussion thread
Post by: BadAss.Sx on July 04, 2015, 09:12:33 PM
Thanks, it is working now....apparently is was the size limits issue, because server came online and i can connect now with my client


Title: Re: Electrum server discussion thread
Post by: BadAss.Sx on July 05, 2015, 03:56:13 PM
Have a new problem:

Quote
[05/07/2015-17:43:36] Starting Electrum server on electrum.badass.sx
[05/07/2015-17:43:37] Database version 3
[05/07/2015-17:43:37] Blockchain height 363959
[05/07/2015-17:43:37] UTXO tree root hash: 83d729bc609764ee6bfd7f8e33ece94e33d68aada186554fe1c9579b622f2bc9
[05/07/2015-17:43:37] Coins in database: 1434845972693919
[05/07/2015-17:43:37] TCP server started on 94.102.50.70:50001
[05/07/2015-17:43:37] SSL server started on 94.102.50.70:50002
[05/07/2015-17:43:39] blockchain reorg 363959 000000000000000010f14e0687867ae37dafce2a918cdf3f9eccdfa992445eb5 00000000000000001262efe584ec7ac039dba15b56d6ed239249c483636b15ef

How can i pass this? Doesn't matter if i restart the server, the problem remains and electrum server isn't public.


Title: Re: Electrum server discussion thread
Post by: JWU42 on July 05, 2015, 08:07:41 PM
Have a new problem:

Quote
[05/07/2015-17:43:36] Starting Electrum server on electrum.badass.sx
[05/07/2015-17:43:37] Database version 3
[05/07/2015-17:43:37] Blockchain height 363959
[05/07/2015-17:43:37] UTXO tree root hash: 83d729bc609764ee6bfd7f8e33ece94e33d68aada186554fe1c9579b622f2bc9
[05/07/2015-17:43:37] Coins in database: 1434845972693919
[05/07/2015-17:43:37] TCP server started on 94.102.50.70:50001
[05/07/2015-17:43:37] SSL server started on 94.102.50.70:50002
[05/07/2015-17:43:39] blockchain reorg 363959 000000000000000010f14e0687867ae37dafce2a918cdf3f9eccdfa992445eb5 00000000000000001262efe584ec7ac039dba15b56d6ed239249c483636b15ef

How can i pass this? Doesn't matter if i restart the server, the problem remains and electrum server isn't public.

Not a problem - it hit my log as well.  Reorg's happen...

Code:
[05/07/2015-15:25:23] blockchain reorg 363959 000000000000000010f14e0687867ae37dafce2a918cdf3f9eccdfa992445eb5 00000000000000001262efe584ec7ac039dba15b56d6ed239249c483636b15ef


Title: Re: Electrum server discussion thread
Post by: TheButterZone on July 05, 2015, 09:30:45 PM
Submitted
https://github.com/spesmilo/electrum-server/issues/98
for
https://bitcointalk.org/index.php?topic=1109497.0


Title: Re: Electrum server discussion thread
Post by: memvola on July 06, 2015, 11:43:12 AM
Hi!

Unfortunately my server couldn't get past the reorg; seems like it can't revert. bitcoind running fine, updated to the latest version, regenerated/imported blockchain_headers to no avail. Any ideas?

Code:
electrum-server[2001]: INFO:electrum:blockchain reorg 363959 000000000000000010f14e0687867ae37dafce2a918cdf3f9eccdfa992445eb5 00000000000000001262efe584ec7ac039dba15b56d6ed239249c483636b15e
electrum-server[2001]: Exception in thread Thread-4:
electrum-server[2001]: Traceback (most recent call last):
electrum-server[2001]: File "/usr/lib/python2.7/threading.py", line 810, in __bootstrap_inner
electrum-server[2001]: self.run()
electrum-server[2001]: File "/usr/lib/python2.7/threading.py", line 763, in run
electrum-server[2001]: self.__target(*self.__args, **self.__kwargs)
electrum-server[2001]: File "/usr/lib/python2.7/site-packages/electrumserver/blockchain_processor.py", line 76, in do_catch_up
electrum-server[2001]: self.catch_up(sync=False)
electrum-server[2001]: File "/usr/lib/python2.7/site-packages/electrumserver/blockchain_processor.py", line 658, in catch_up
electrum-server[2001]: self.import_block(block, self.storage.last_hash, self.storage.height, sync, revert=True)
electrum-server[2001]: File "/usr/lib/python2.7/site-packages/electrumserver/blockchain_processor.py", line 408, in import_block
electrum-server[2001]: self.storage.revert_transaction(txid, tx, block_height, touched_addr, undo)
electrum-server[2001]: File "/usr/lib/python2.7/site-packages/electrumserver/storage.py", line 602, in revert_transaction
electrum-server[2001]: self.revert_add_to_history(addr, txid, x.get('index'), x.get('value'), block_height)
electrum-server[2001]: File "/usr/lib/python2.7/site-packages/electrumserver/storage.py", line 511, in revert_add_to_history
electrum-server[2001]: self.delete_address(key + txo)
electrum-server[2001]: File "/usr/lib/python2.7/site-packages/electrumserver/storage.py", line 416, in delete_address
electrum-server[2001]: items.pop(letter)
electrum-server[2001]: KeyError: '7'


Title: Re: Electrum server discussion thread
Post by: JWU42 on July 06, 2015, 11:55:01 AM
Hi!

Unfortunately my server couldn't get past the reorg; seems like it can't revert. bitcoind running fine, updated to the latest version, regenerated/imported blockchain_headers to no avail. Any ideas?

Code:
electrum-server[2001]: INFO:electrum:blockchain reorg 363959 000000000000000010f14e0687867ae37dafce2a918cdf3f9eccdfa992445eb5 00000000000000001262efe584ec7ac039dba15b56d6ed239249c483636b15e
electrum-server[2001]: Exception in thread Thread-4:
electrum-server[2001]: Traceback (most recent call last):
electrum-server[2001]: File "/usr/lib/python2.7/threading.py", line 810, in __bootstrap_inner
electrum-server[2001]: self.run()
electrum-server[2001]: File "/usr/lib/python2.7/threading.py", line 763, in run
electrum-server[2001]: self.__target(*self.__args, **self.__kwargs)
electrum-server[2001]: File "/usr/lib/python2.7/site-packages/electrumserver/blockchain_processor.py", line 76, in do_catch_up
electrum-server[2001]: self.catch_up(sync=False)
electrum-server[2001]: File "/usr/lib/python2.7/site-packages/electrumserver/blockchain_processor.py", line 658, in catch_up
electrum-server[2001]: self.import_block(block, self.storage.last_hash, self.storage.height, sync, revert=True)
electrum-server[2001]: File "/usr/lib/python2.7/site-packages/electrumserver/blockchain_processor.py", line 408, in import_block
electrum-server[2001]: self.storage.revert_transaction(txid, tx, block_height, touched_addr, undo)
electrum-server[2001]: File "/usr/lib/python2.7/site-packages/electrumserver/storage.py", line 602, in revert_transaction
electrum-server[2001]: self.revert_add_to_history(addr, txid, x.get('index'), x.get('value'), block_height)
electrum-server[2001]: File "/usr/lib/python2.7/site-packages/electrumserver/storage.py", line 511, in revert_add_to_history
electrum-server[2001]: self.delete_address(key + txo)
electrum-server[2001]: File "/usr/lib/python2.7/site-packages/electrumserver/storage.py", line 416, in delete_address
electrum-server[2001]: items.pop(letter)
electrum-server[2001]: KeyError: '7'


It seems the best option for now is grabbing a new DB from foundry...

https://foundry.electrum.org/


Title: Re: Electrum server discussion thread
Post by: ThomasV on July 06, 2015, 12:00:18 PM
Hi!

Unfortunately my server couldn't get past the reorg; seems like it can't revert. bitcoind running fine, updated to the latest version, regenerated/imported blockchain_headers to no avail. Any ideas?

...

This traceback means that your database was corrupted.
There is a robot, 'electra', that detects servers with a corrupted DB, and kicks them from the irc channel.
Unfortunately this robot is temporarily broken (I will try to fix it this week), and it seems that a few servers have been running with db corruption without noticing it.
This reorg made the job that electra usually does :)


Title: Re: Electrum server discussion thread
Post by: memvola on July 06, 2015, 12:32:09 PM
There is a robot, 'electra', that detects servers with a corrupted DB, and kicks them from the irc channel.
Unfortunately this robot is temporarily broken (I will try to fix it this week), and it seems that a few servers have been running with db corruption without noticing it.

Is there a way to check for corruption locally?


Title: Re: Electrum server discussion thread
Post by: BadAss.Sx on July 06, 2015, 04:51:44 PM
There was an orphan block at height 363959 (https://blockchain.info/block-height/363959).  Your bitcoind should have rejected the orphan block, if you are using Bitcoin-core v0.9.5 and above - which version are you using?

I used 0.10.0, but have upgraded now to 0.10.2. Also redownloaded the db, because mine was corrupt and couldn't get past the orphaned block.


Title: Re: Electrum server discussion thread
Post by: tl121 on July 08, 2015, 05:24:19 PM
My private Electrum server is having trouble keeping up with the present network activity,  being up to 11 blocks behind.  The bitcoin node on the same machine has no trouble keeping up and the CPU time used by electrum-server is now 7 times greater than that used by bitcoind.

Worse, when I use an Electrum client to access the node I observe that the client reports an erroneous number of blocks lagging (more blocks than actual).  In addition, it does not pull out a new unconfirmed received transactions that have been in the mempool for over an hour.  (Switching the client to another server does show this unconfirmed transaction.)  This is a private server and only one client is accessing it.  Perhaps a better balance in thread priority can be taken between resources spent tracking the network and updating the database vs. providing timely interaction to clients.

Looking at the logs, it looks like one block gave the server serious cramps:

[08/07/2015-12:24:49] utxo not in database; postponing mempool update
[08/07/2015-12:24:49] blockchain: 364428 (5284.813s)
[08/07/2015-12:25:15] mempool_update 16.0112478733

The machine has a Haswell Atom processor, but it has 8 GB of RAM and an SSD.  Running Ubuntu 14.04, Electrum Server updated from github yesterday.


Title: Re: Electrum server discussion thread
Post by: molecular on July 08, 2015, 06:47:52 PM
Worse, when I use an Electrum client to access the node I observe that the client reports an erroneous number of blocks lagging (more blocks than actual).

Does a client restart fix this particular issue?

If so, maybe you're looking at this issue (https://github.com/spesmilo/electrum/issues/1351) instead.


Title: Re: Electrum server discussion thread
Post by: tl121 on July 08, 2015, 07:23:58 PM
Worse, when I use an Electrum client to access the node I observe that the client reports an erroneous number of blocks lagging (more blocks than actual).

Does a client restart fix this particular issue?

If so, maybe you're looking at this issue (https://github.com/spesmilo/electrum/issues/1351) instead.

Thanks for the suggestion. 

Because I had previously experienced the problem that you linked, I had already tried a number of client restarts. They didn't help.  At present my server is only 3 blocks behind (according to getinfo via SSH) and this is consistent with what my Electrum client  reports.  However, the unconfirmed transaction has been sitting for three hours (presumably due to the "test").  Blockchain.info has had the transaction for three hours, but my Electrum client still doesn't show it.  (It will show it if I connect it to a different Electrum server, so I know that this is server related. After changing servers, I restarted the client and it reverted back to showing the transaction unconfirmed.  I will have to wait until my server catches up and then I will see if it picks up the unconfirmed transaction.)

I believe it should be high priority for the Electrum system to show unconfirmed payments as rapidly as possible, so as to make for a Newbie friendly user experience.



Title: Re: Electrum server discussion thread
Post by: molecular on July 08, 2015, 09:00:14 PM
I believe it should be high priority for the Electrum system to show unconfirmed payments as rapidly as possible, so as to make for a Newbie friendly user experience.

I agree to an extent. However I think the problem is mitigated for "newbie users" because they will likely use "auto connect" and I'm assuming lagging servers will not be autoconnected to.

Of course the electrum server software could probably be made to perform better, but I'm guessing it'd be quite a bit of work.

Until then and although it's a bit sad and maybe even mildly concerning (centralization), maybe your little atom (not to discredit it, but I assume it's the bottleneck in your system when electrum is digesting transactions) will have to leave the work to faster machines regarding servicing the masses?


Title: Re: Electrum server discussion thread
Post by: tl121 on July 09, 2015, 12:19:24 AM
I believe it should be high priority for the Electrum system to show unconfirmed payments as rapidly as possible, so as to make for a Newbie friendly user experience.

I agree to an extent. However I think the problem is mitigated for "newbie users" because they will likely use "auto connect" and I'm assuming lagging servers will not be autoconnected to.

Of course the electrum server software could probably be made to perform better, but I'm guessing it'd be quite a bit of work.

Until then and although it's a bit sad and maybe even mildly concerning (centralization), maybe your little atom (not to discredit it, but I assume it's the bottleneck in your system when electrum is digesting transactions) will have to leave the work to faster machines regarding servicing the masses?

A couple of years ago, I played around with Electrum and rejected it because of the "server lagging" issues and the unreliability of connections to the servers.  It seemed dodgy.  These problems are not new and not the fault of my particular server hardware. At the time I was not running a server and was using the auto selection feature.

I chose the little Atom deliberately, so that it would be a canary in the coal mine.  My little machine is not servicing the masses.  It's just servicing me.  If tracking the block chain can not be done efficiently, then the future of Electrum is at risk. I would say the future of bitcoin as well as a decentralized system, except that the little Atom manages to keep up with the present load using only a few percent of CPU time to run bitcoind.

Electrum-server used 5832 seconds to process one block!  This is a bug.  Not a slow processor. 


Title: Re: Electrum server discussion thread
Post by: it-zone on July 09, 2015, 02:19:43 AM
Electrum-server used 5832 seconds to process one block!  This is a bug.  Not a slow processor. 

Unfortunately I must agree, the architecture of electrum server is screwed. If we use power of the internet to make electrum possible, we should share resources between electrum servers.

But there is no clear solution. Which Key-Value database engine is able work on the WAN scale?


Title: Re: Electrum server discussion thread
Post by: tl121 on July 09, 2015, 03:28:51 PM

Electrum-server used 5832 seconds to process one block!  This is a bug.  Not a slow processor.  


I wouldn't say that it is a bug, but instead, not optimized for slow processors, or bloated blocks, full of useless UTXOs that the Bitcoin spammer is currently injecting in the network today...

... over 50k transactions are in the waiting room at the moment, waiting to be included into a block... https://chain.so/BTC (https://chain.so/BTC)

If senders didn't put at least 0.0005 BTC per kb, as transaction fees, the waiting time to be included into a block is... 16h

One of those transactions is mine.  I sent it from my Bitcoin Core 10.2 wallet with the default transaction cost.  I believe this was a bug, with less than 1000 Satoshi's as fee.  It has been sitting unconfirmed for 24 hours.   I am sure that lots of other people are in the same boat.  About the only way to put it is, "Bitcoin is experimental.  It is not ready for production use by normal people."  These problems will either be fixed or bitcoin will cease to exist.






Title: Re: Electrum server discussion thread
Post by: BadAss.Sx on July 09, 2015, 05:49:58 PM
I believe there is a 48hours timeout...so if you haven't confirmed them yet, they should come back into your wallet.


Title: Re: Electrum server discussion thread
Post by: tl121 on July 09, 2015, 08:13:39 PM
I believe there is a 48hours timeout...so if you haven't confirmed them yet, they should come back into your wallet.

Thanks.  I'm not worried.  One way or another, I'll get the bitcoins back since I sent them from my bitcoin core wallet to my Electrum wallet.  And they were pocket change, compared to the amount I've previously lost thanks to scamming bitcoin miner companies...   :(


Title: Re: Electrum server discussion thread
Post by: kamk on July 10, 2015, 05:23:15 AM
It looks like the leveldb dumps are not updated in the foundry:
http://foundry.electrum.org/leveldb-dump/?C=M;O=D

Last dump is from July 8.


Title: Re: Electrum server discussion thread
Post by: BadAss.Sx on July 10, 2015, 06:56:11 AM
Mostly it is done once a week


Title: Re: Electrum server discussion thread
Post by: JWU42 on July 10, 2015, 10:54:52 AM
It looks like the leveldb dumps are not updated in the foundry:
http://foundry.electrum.org/leveldb-dump/?C=M;O=D

Last dump is from July 8.


It used to be daily...

I update the 1000 limit weekly (on Saturday).


Title: Re: Electrum server discussion thread
Post by: mustyoshi on July 22, 2015, 02:26:43 PM
I believe I am correctly running a public Electrum node at btc.mustyoshi.com:50001


Title: Re: Electrum server discussion thread
Post by: tnkflx on July 22, 2015, 03:33:59 PM
I believe I am correctly running a public Electrum node at btc.mustyoshi.com:50001

You server doesn't seem to be connected on IRC... So no, you're not correctly running a public Electrum node :)


Title: Re: Electrum server discussion thread
Post by: mustyoshi on July 23, 2015, 04:29:58 AM
I believe I am correctly running a public Electrum node at btc.mustyoshi.com:50001

You server doesn't seem to be connected on IRC... So no, you're not correctly running a public Electrum node :)
How do I fix that? I thought I had the config file setup right.
EDIT: So apparently report_host can't be the same as host.


Title: Re: Electrum server discussion thread
Post by: JWU42 on July 23, 2015, 11:03:29 AM
I believe I am correctly running a public Electrum node at btc.mustyoshi.com:50001

You server doesn't seem to be connected on IRC... So no, you're not correctly running a public Electrum node :)
How do I fix that? I thought I had the config file setup right.
EDIT: So apparently report_host can't be the same as host.

host is the IP of the server
report_host is the FQDN of the server


Title: Re: Electrum server discussion thread
Post by: mustyoshi on July 27, 2015, 03:51:05 AM
So now I'm in the process of rebuilding the server's db because apparently mine was incorrect, it was giving the wrong hash.

But the server hangs during block import every few blocks and I have to kill and restart it.


Title: Re: Electrum server discussion thread
Post by: molecular on July 27, 2015, 05:27:02 AM
So now I'm in the process of rebuilding the server's db because apparently mine was incorrect, it was giving the wrong hash.

But the server hangs during block import every few blocks and I have to kill and restart it.

Are you sure it hangs? Can you look at cpu and io load during the "hang"?

First time I built the db I thought it was hung a couple of time, too. But it really wasn't, just taking very long.

I ended up using a db download.


Title: Re: Electrum server discussion thread
Post by: JWU42 on July 27, 2015, 11:10:21 PM
First time I built the db I thought it was hung a couple of time, too. But it really wasn't, just taking very long.

I ended up using a db download.


I built a DB (1000 limit) from scratch back in April - it took 5 weeks  ::)

Much better to DL one  ;D


Title: Re: Electrum server discussion thread
Post by: mustyoshi on July 28, 2015, 07:19:18 PM
First time I built the db I thought it was hung a couple of time, too. But it really wasn't, just taking very long.

I ended up using a db download.


I built a DB (1000 limit) from scratch back in April - it took 5 weeks  ::)

Much better to DL one  ;D
2 days and I'm at block 170k
Everytime I download it fails the md5 check.


Title: Re: Electrum server discussion thread
Post by: JWU42 on July 28, 2015, 11:45:41 PM
First time I built the db I thought it was hung a couple of time, too. But it really wasn't, just taking very long.

I ended up using a db download.


I built a DB (1000 limit) from scratch back in April - it took 5 weeks  ::)

Much better to DL one  ;D
2 days and I'm at block 170k
Everytime I download it fails the md5 check.

The first 170K is fine - the next 200K will take forever  ;D


Title: Re: Electrum server discussion thread
Post by: santzi on August 05, 2015, 12:54:23 PM
Hi,

I have just finished Electrum LTC server up and running, but I have" small" issue left.

All working fine when I connected to Electrum client from localhost.
But I like to get work also as public server.

The problem is that, TCP and SSL sockets could not open...I don't know why.

[05/08/2015-15:36:26] Blockchain height 828417
[05/08/2015-15:36:26] UTXO tree root hash: dd4cdb5b61e1d92b50b745b3d758b62c98bb2fc9b28925033cb6c8c0667aa8ca
[05/08/2015-15:36:26] Coins in database: 4141945190326061
[05/08/2015-15:36:26] could not open TCP socket on zz.xx.cc.vv:50001
[05/08/2015-15:36:26] could not open SSL socket on zz.xx.cc.vv.:50002
[05/08/2015-15:36:26] Blockchain is up to date.
[05/08/2015-15:36:26] Memory pool initialized.
[05/08/2015-15:36:26] blockchain: 828418 (0.005s)
[05/08/2015-15:36:26] litecoind is responding
[05/08/2015-15:36:27] joining IRC

IRC connect is OK.
"electrum-ltc-server peers" -command prints my nick name correctly.
Port forwarding has done to these two ports (50001 and 50002) and iptables should be ok. Also ports 50001 and 50002 are open.

Could someone help me with this issue?

Thank you!


Title: Re: Electrum server discussion thread
Post by: santzi on August 05, 2015, 03:10:42 PM
Hi,

I have just finished Electrum LTC server up and running, but I have" small" issue left.

All working fine when I connected to Electrum client from localhost.
But I like to get work also as public server.

The problem is that, TCP and SSL sockets could not open...I don't know why.

[05/08/2015-15:36:26] Blockchain height 828417
[05/08/2015-15:36:26] UTXO tree root hash: dd4cdb5b61e1d92b50b745b3d758b62c98bb2fc9b28925033cb6c8c0667aa8ca
[05/08/2015-15:36:26] Coins in database: 4141945190326061
[05/08/2015-15:36:26] could not open TCP socket on zz.xx.cc.vv:50001
[05/08/2015-15:36:26] could not open SSL socket on zz.xx.cc.vv.:50002
[05/08/2015-15:36:26] Blockchain is up to date.
[05/08/2015-15:36:26] Memory pool initialized.
[05/08/2015-15:36:26] blockchain: 828418 (0.005s)
[05/08/2015-15:36:26] litecoind is responding
[05/08/2015-15:36:27] joining IRC

IRC connect is OK.
"electrum-ltc-server peers" -command prints my nick name correctly.
Port forwarding has done to these two ports (50001 and 50002) and iptables should be ok. Also ports 50001 and 50002 are open.

Could someone help me with this issue?

Thank you!

Problem solved.
Configuration problem on /etc/electrum-ltc.conf -file.

Should be:
"host = 192.168.1.33"
not FQDN address.


Title: Re: Electrum server discussion thread
Post by: tnkflx on August 05, 2015, 04:26:32 PM
Hi,

I have just finished Electrum LTC server up and running, but I have" small" issue left.

All working fine when I connected to Electrum client from localhost.
But I like to get work also as public server.

The problem is that, TCP and SSL sockets could not open...I don't know why.

[05/08/2015-15:36:26] Blockchain height 828417
[05/08/2015-15:36:26] UTXO tree root hash: dd4cdb5b61e1d92b50b745b3d758b62c98bb2fc9b28925033cb6c8c0667aa8ca
[05/08/2015-15:36:26] Coins in database: 4141945190326061
[05/08/2015-15:36:26] could not open TCP socket on zz.xx.cc.vv:50001
[05/08/2015-15:36:26] could not open SSL socket on zz.xx.cc.vv.:50002
[05/08/2015-15:36:26] Blockchain is up to date.
[05/08/2015-15:36:26] Memory pool initialized.
[05/08/2015-15:36:26] blockchain: 828418 (0.005s)
[05/08/2015-15:36:26] litecoind is responding
[05/08/2015-15:36:27] joining IRC

IRC connect is OK.
"electrum-ltc-server peers" -command prints my nick name correctly.
Port forwarding has done to these two ports (50001 and 50002) and iptables should be ok. Also ports 50001 and 50002 are open.

Could someone help me with this issue?

Thank you!

Problem solved.
Configuration problem on /etc/electrum-ltc.conf -file.

Should be:
"host = 192.168.1.33"
not FQDN address.


Also, there's no support whatsoever for Electrum and altcoins here...


Title: Re: Electrum server discussion thread
Post by: fronti on August 11, 2015, 08:59:06 AM
First time I built the db I thought it was hung a couple of time, too. But it really wasn't, just taking very long.

I ended up using a db download.


I built a DB (1000 limit) from scratch back in April - it took 5 weeks  ::)

Much better to DL one  ;D
2 days and I'm at block 170k
Everytime I download it fails the md5 check.

The first 170K is fine - the next 200K will take forever  ;D

yes.. i noticed by myself.
even on a 30 GB Ramdisk and fast CPU..

What is the main point which takes that long?
Request from bitcoind? generate the DB?..


Title: Re: Electrum server discussion thread
Post by: tl121 on September 02, 2015, 02:15:15 AM
The September Bitcoin test/demonstration/spam attack/DDoS attack has begun.  Now is the time for all Electrum Server operators to check how their node is standing up, including looking at the processor loading used by Electrum and Bitcoind.



Title: Re: Electrum server discussion thread
Post by: JWU42 on September 06, 2015, 01:16:09 PM
All server ops - please update your servers.  A new patch was pushed a few days ago...

Code:
#cd to electrum-server directory then do...
git pull
sudo python setup.py install

Then you should be good to go!


Title: Re: Electrum server discussion thread
Post by: molecular on September 08, 2015, 07:10:24 PM
All server ops - please update your servers.  A new patch was pushed a few days ago...

Code:
#cd to electrum-server directory then do...
git pull
sudo python setup.py install

Then you should be good to go!

because of this?

Code:
commit be63d5fc48e0a95a800e95b2a8622109c2e3e549
Merge: f6bb080 a187370
Author: ThomasV <thomasv@electrum.org>
Date:   Fri Sep 4 08:36:21 2015 +0200

    Merge pull request #122 from fireduck64/master

    Change to make address history sorted and deterministic

https://i.imgur.com/zXEs8YP.png (https://i.imgur.com/zXEs8YP.png)

hmm. Seems overkill to prompt everybody to update for this. What am I missing?


Title: Re: Electrum server discussion thread
Post by: JWU42 on September 09, 2015, 01:08:50 AM
All server ops - please update your servers.  A new patch was pushed a few days ago...

Code:
#cd to electrum-server directory then do...
git pull
sudo python setup.py install

Then you should be good to go!

because of this?

Code:
commit be63d5fc48e0a95a800e95b2a8622109c2e3e549
Merge: f6bb080 a187370
Author: ThomasV <thomasv@electrum.org>
Date:   Fri Sep 4 08:36:21 2015 +0200

    Merge pull request #122 from fireduck64/master

    Change to make address history sorted and deterministic

https://i.imgur.com/zXEs8YP.png (https://i.imgur.com/zXEs8YP.png)

hmm. Seems overkill to prompt everybody to update for this. What am I missing?


@Molecular,

I simply passed on the request from the devs to encourage all server ops to update.  Yes, it is due to the patch you reference.


Title: Re: Electrum server discussion thread
Post by: molecular on September 09, 2015, 04:31:32 PM

@Molecular,

I simply passed on the request from the devs to encourage all server ops to update.  Yes, it is due to the patch you reference.
Why such a simple upgrade shouldn't  achieve concensus easily ?

Lol.

I don't oppose the patch. Just not going to update my running server for every little change


Title: Re: Electrum server discussion thread
Post by: fydel on October 11, 2015, 01:28:32 PM
I have set up an electrum-server but the ssl connection is not working.

I followed the instructions in the how-to but I keep getting this error:

Quote
[11/10/2015-14:31:47] cannot start TCP session[Errno 336265218] _ssl.c:351: error:140B0002:SSL routines:SSL_CTX_use_PrivateKey_file:system lib ('109.x.x.81', 51527)

What does this error message mean?

Edit: This is my SSL configuration:

Quote
>openssl req -new -key server.key -out server.csr

Country Name (2 letter code) [AU]:DE
State or Province Name (full name) [Some-State]:NRW
Locality Name (eg, city) []:Cologne
Organization Name (eg, company) [Internet Widgits Pty Ltd]:.
Organizational Unit Name (eg, section) []:.
Common Name (e.g. server FQDN or YOUR name) []:einfachmalnettsein.de
Email Address []:marc@tinyint.de

Please enter the following 'extra' attributes
to be sent with your certificate request
A challenge password []:
An optional company name []:.


>openssl x509 -req -days 730 -in server.csr -signkey server.key -out server.crt

Signature ok
subject=/C=DE/ST=NRW/L=Cologne/CN=einfachmalnettsein.de/emailAddress=marc@tinyint.de
Getting Private key

This is my log:

Quote
[11/10/2015-17:07:24] Starting Electrum server on 0.0.0.0
[11/10/2015-17:07:26] Database version 3.
[11/10/2015-17:07:26] Pruning limit for spent outputs is 10000.
[11/10/2015-17:07:26] Blockchain height 378441
[11/10/2015-17:07:26] UTXO tree root hash: 363913361787b003187a5628440fdf48377beb0a1e56c7f21126e2cca7718f5e
[11/10/2015-17:07:26] Coins in database: 1470823448062842
[11/10/2015-17:07:26] TCP server started on 0.0.0.0:50001
[11/10/2015-17:07:26] SSL server started on 0.0.0.0:50002
[11/10/2015-17:07:26] Blockchain is up to date.
[11/10/2015-17:11:24] utxo not in database; postponing mempool update
[11/10/2015-17:11:25] Memory pool initialized.
[11/10/2015-17:12:28] block 378442 (1954 63.45s) 02c76e47b2e90ee1bf610ba8107b104e3e1fe81339ac02ab7d519c1a7a3a17f4 (30.80tx/s, 63.45s/block)
[11/10/2015-17:12:54] block 378443 (711 26.16s) 90012c37feb4ea11316021b4c613643358710bb696e240b224d553da82491643 (29.73tx/s, 44.62s/block)
[11/10/2015-17:12:58] mempool_update 3.49787020683 18473 8238
[11/10/2015-17:12:58] bitcoind is responding
[11/10/2015-17:12:58] joining IRC
[11/10/2015-17:12:58] cannot start TCP session[Errno 336265218] _ssl.c:351: error:140B0002:SSL routines:SSL_CTX_use_PrivateKey_file:system lib ('188.xx.x.143', 6907)
[11/10/2015-17:12:58] cannot start TCP session[Errno 336265218] _ssl.c:351: error:140B0002:SSL routines:SSL_CTX_use_PrivateKey_file:system lib ('188.x.143', 55134)
[11/10/2015-17:12:58] cannot start TCP session[Errno 336265218] _ssl.c:351: error:140B0002:SSL routines:SSL_CTX_use_PrivateKey_file:system lib ('106.x.x.160', 42757)




UPDATE: It works now. I had a typo in the keyfile. Thanks #electrum for helping.


Title: Re: Electrum server discussion thread
Post by: mdelfin on December 21, 2015, 03:53:37 PM
I just lauched an electrum server (electrum.stoff-sammlung.de).
(Are there really only 47 servers online?)

I'm a bit puzzled about the tuning.
tmpfs is mentioned to speed up the server (and my hard drives are busy now).
But that means, that the leveldb files are lost at every reboot, right?

I assume seeding the tmpfs is nescessary and saving the leveldb files to permantent storage would be a good idea.

Is there any template for such a setup?

Martin


Title: Re: Electrum server discussion thread
Post by: JWU42 on December 22, 2015, 11:20:22 AM
The instructions on github are a bit outdated.

You should download the DB from the foundry.  Building the DB would take 2+ months (assuming modern processor and SSD), so again, just download a snapshot and start from there.

As far as the number of servers.  47 is quite a large number.  It had been in the lower 20's for quite some time and we have seen several new servers start recently.  The more important factor is consistency of servers (i.e., high availability and still running 12 months from now).

The IRC channel #electrum on freenode is also a good resource.


Title: Re: Electrum server discussion thread
Post by: torusJKL on December 31, 2015, 03:41:51 PM
Hi everyone

I installed electrum-server.
It is still syncing to the latest block.

But I get an error "could not open TCP socket on 5.9.29.151:50001"

See the log:
Code:
[31/12/2015-17:32:17] Starting Electrum server on electrum2.ueo.ch
[31/12/2015-17:32:28] Database version 3.
[31/12/2015-17:32:28] Pruning limit for spent outputs is 10000.
[31/12/2015-17:32:28] Blockchain height 390737
[31/12/2015-17:32:28] UTXO tree root hash: 5ac363c9e4f63f1d2387ba079779a5b54c4519f2f0fd816f917024e31b74eff4
[31/12/2015-17:32:28] Coins in database: 1501563237657201
[31/12/2015-17:32:28] catching up missing headers: 390736 390737
[31/12/2015-17:32:31] could not open TCP socket on 5.9.29.151:50001

I also tried port 50010 and even disabled the firewall to no avail.

Thanks.


Title: Re: Electrum server discussion thread
Post by: dan91 on December 31, 2015, 03:49:58 PM
Did you specify that IP address in the config file? Did you try just using 0.0.0.0 and see if it would bind then?


Title: Re: Electrum server discussion thread
Post by: torusJKL on December 31, 2015, 04:47:06 PM
Did you specify that IP address in the config file? Did you try just using 0.0.0.0 and see if it would bind then?

I defined host = with the  FQDN and it took the IP from this information.
If I use localhost then I don't have any error but from what I understand than none can connect.


Title: Re: Electrum server discussion thread
Post by: dan91 on December 31, 2015, 05:28:37 PM
try using

host = 0.0.0.0


Title: Re: Electrum server discussion thread
Post by: torusJKL on January 01, 2016, 05:45:12 PM
try using

host = 0.0.0.0

Well that gives no error but now it won't be available from the outside, right? :-(


Title: Re: Electrum server discussion thread
Post by: dan91 on January 01, 2016, 05:52:18 PM
Yeh it will 0.0.0.0 means bind to all address' that are available.


Title: Re: Electrum server discussion thread
Post by: torusJKL on January 01, 2016, 06:17:39 PM
It now works.
I had to set
Code:
host = 0.0.0.0
report_host=fqdn
Thanks to dan91 and hsmiths on #electrum


A new electrum server node says hello world!

hostname: e1.ueo.ch
network: IPv4
ports: 50001
prune: 10000
location: Germany


I will add more ports in the near future.


Title: Re: Electrum server discussion thread
Post by: Selavi on January 21, 2016, 09:30:52 AM
Public SSL Cert Bug?

To experiment with some inspiration from this thread (https://bitcointalk.org/index.php?topic=1320358.0), I got a public SSL cert from Let's Encrypt and I hit a slight glitch. The client wouldn't sync after switching to the public cert, and deleting the cached cert fixed it. I've since reverted back to self-signed to prevent collateral damage until this issue is hashed out.

I haven't spent much time debugging as it's late for me, and a quick skim through the code doesn't get me anything. So far I've found that only Electrum 2.0+ is supported in the server setup guide.

Thoughts?


Title: Re: Electrum server discussion thread
Post by: shsmith on January 30, 2016, 02:16:13 AM
Quote
Public SSL Cert Bug?
There is currently no way to replace a self-signed certificate because it is pinned by all the clients who ever connected.

To go to a CA-signed certificate you need to also change your DNS name so that your server will have a new identity.

About a day ago I did this with one of my electrum servers, and though it is taking connections, the traffic is much lower than it used to be. This is partly because Electrum clients prior to 2.0 cannot connect at all with a CA-signed certificate, but mostly because it takes a while for everyone to discover the new server.

BTW, I got my cert from StartSSL and to make it work I had to append the intermediate CA bundle to the end of my .crt file.


Title: Re: Electrum server discussion thread
Post by: molecular on January 31, 2016, 08:46:14 AM
BTW, I got my cert from StartSSL and to make it work I had to append the intermediate CA bundle to the end of my .crt file.

Just as a side-note: I used to use StartSSL, too. But compared to the new letsencrypt it's a lot of hassle and seems complicated in comparison.


Title: Re: Electrum server discussion thread
Post by: Deth on February 04, 2016, 01:06:23 PM
Are there any news about server re-write, with faster block processing?


Title: Re: Electrum server discussion thread
Post by: dan91 on February 04, 2016, 04:44:55 PM
Are there any news about server re-write, with faster block processing?

Been a couple of pull requests that have gone through from JAuthor that have increased the speed a little bit.


Title: Re: Electrum server discussion thread
Post by: shsmith on February 05, 2016, 11:25:30 PM
Just as a side-note: I used to use StartSSL, too. But compared to the new letsencrypt it's a lot of hassle and seems complicated in comparison.
Please explain how you used letsencrypt with electrum-server.


Title: Re: Electrum server discussion thread
Post by: shsmith on February 05, 2016, 11:28:05 PM
Are there any news about server re-write, with faster block processing?
Fireduck re-wrote electrum-server in Java and it processes blocks much faster than the original Python version.
See https://bitcointalk.org/index.php?topic=726338.0


Title: Re: Electrum server discussion thread
Post by: molecular on February 10, 2016, 04:33:02 PM
Are there any news about server re-write, with faster block processing?
Fireduck re-wrote electrum-server in Java and it processes blocks much faster than the original Python version.
See https://bitcointalk.org/index.php?topic=726338.0

thanks for the info/link... might come in handy.


Title: Re: Electrum server discussion thread
Post by: GODLIKE on March 22, 2016, 05:11:12 PM
The fact that there are less than 50 servers scares me quite a bit.
What happens if all the Electrum servers go offline?


Title: Re: Electrum server discussion thread
Post by: tnkflx on March 22, 2016, 05:36:54 PM
The fact that there are less than 50 servers scares me quite a bit.
What happens if all the Electrum servers go offline?

If all 50 servers disappear, you can still set up your own :)


Title: Re: Electrum server discussion thread
Post by: GODLIKE on March 22, 2016, 05:49:37 PM
The fact that there are less than 50 servers scares me quite a bit.
What happens if all the Electrum servers go offline?

If all 50 servers disappear, you can still set up your own :)

And with that one I can then send my BTC to a non-light wallet, by making a last transfer from Electrum to another BTC address, right?


Title: Re: Electrum server discussion thread
Post by: tnkflx on March 22, 2016, 05:57:58 PM
The fact that there are less than 50 servers scares me quite a bit.
What happens if all the Electrum servers go offline?

If all 50 servers disappear, you can still set up your own :)

And with that one I can then send my BTC to a non-light wallet, by making a last transfer from Electrum to another BTC address, right?
Indeed.


Title: Re: Electrum server discussion thread
Post by: GODLIKE on March 22, 2016, 06:47:34 PM
The fact that there are less than 50 servers scares me quite a bit.
What happens if all the Electrum servers go offline?

If all 50 servers disappear, you can still set up your own :)

And with that one I can then send my BTC to a non-light wallet, by making a last transfer from Electrum to another BTC address, right?
Indeed.

OK, thank you :)
However, aren't 50 server a bit few?
I mean, I didn't have performance problems up to now, but in the future?


Title: Re: Electrum server discussion thread
Post by: sdp on March 22, 2016, 07:13:14 PM
If you want a network that will pay the w nodes rather than only the miners.   Then you have dash.   Otherwise we can fork the client source code to pay to the electrum server as well as the miner fee.  Only people who are both savvy enough to use github and who care about the electrum server count enough would ever use such a client though.  There are other light clients out there that don't use electrum servers.   These clients have to do more work.

I am concerned about transactions with 0.1mBTC for a transaction not getting through.  If the user must add another 0.1mBTC, the users might decide to go with some other light client.   

sdp


Title: Re: Electrum server discussion thread
Post by: tnkflx on March 22, 2016, 07:13:48 PM
The fact that there are less than 50 servers scares me quite a bit.
What happens if all the Electrum servers go offline?

If all 50 servers disappear, you can still set up your own :)

And with that one I can then send my BTC to a non-light wallet, by making a last transfer from Electrum to another BTC address, right?
Indeed.

OK, thank you :)
However, aren't 50 server a bit few?
I mean, I didn't have performance problems up to now, but in the future?

The Electrum developers will probably tackle that if it ever becomes a problem, don't worry :)


Title: Re: Electrum server discussion thread
Post by: JWU42 on March 30, 2016, 11:03:05 AM
The fact that there are less than 50 servers scares me quite a bit.
What happens if all the Electrum servers go offline?

If all 50 servers disappear, you can still set up your own :)

And with that one I can then send my BTC to a non-light wallet, by making a last transfer from Electrum to another BTC address, right?
Indeed.

OK, thank you :)
However, aren't 50 server a bit few?
I mean, I didn't have performance problems up to now, but in the future?

The Electrum developers will probably tackle that if it ever becomes a problem, don't worry :)

There are plenty of servers to satisfy the current number of clients.  If anything, I am probably going to shut down a server or two as the load is negligible.


Title: Re: Electrum server discussion thread
Post by: MusX on June 01, 2016, 07:51:54 PM
Any knows or have a good reference on starting electrum-server in regtest mode? I tried to setup it in VM but the installation steps are outdated, at least for Ubuntu - fails on `python setup.py install` step. Optionally if anyone knows updated electrum-server docker image?


Title: Re: Electrum server discussion thread
Post by: MusX on June 11, 2016, 01:20:30 PM
Any knows or have a good reference on starting electrum-server in regtest mode? I tried to setup it in VM but the installation steps are outdated, at least for Ubuntu - fails on `python setup.py install` step. Optionally if anyone knows updated electrum-server docker image?
maybe anyone knows an alternative spv wallet + server for it that can be easily started from docker or complete script?


Title: Re: Electrum server discussion thread
Post by: EvryIntl on August 19, 2016, 03:10:44 PM
Hi All,

I'm trying to get a new electrum server started, but it doesn't seem to sync all the way with bitcoind.  Bitcoind is up to the latest block, but electrum server is almost 1000 blocks behind it and falling further behind.  At one point it was 941 blocks behind, then 966 blocks behind, ...

Edit: Can it take that much longer to process via electrum than to keep up with the blockchain with bitcoind?  That is, if the hardware can keep up with bitcoind with lots of CPU and RAM to spare, shouldn't it be possible for electrum-server to catch up?  The log just shows it dropping further and further behind.  Perhaps I'm just missing something here?


Title: Re: Electrum server discussion thread
Post by: molecular on August 19, 2016, 06:28:08 PM
Hi All,

I'm trying to get a new electrum server started, but it doesn't seem to sync all the way with bitcoind.  Bitcoind is up to the latest block, but electrum server is almost 1000 blocks behind it and falling further behind.  At one point it was 941 blocks behind, then 966 blocks behind, ...

Edit: Can it take that much longer to process via electrum than to keep up with the blockchain with bitcoind?  That is, if the hardware can keep up with bitcoind with lots of CPU and RAM to spare, shouldn't it be possible for electrum-server to catch up?  The log just shows it dropping further and further behind.  Perhaps I'm just missing something here?

The thing is slow. In my experience it take a lot more resources than bitcoind per block to digest. Maybe the insert into the patricia tree (?) utxo data structure is to blame? I wouldn't know.

There was an alternative implementation mentioned further up (in java?). I've been wanting to give it a try, but there's no pressure (the machine I use for electrum server has plenty of juice). Maybe you can try it and report back?

EDIT: found the post:

Are there any news about server re-write, with faster block processing?
Fireduck re-wrote electrum-server in Java and it processes blocks much faster than the original Python version.
See https://bitcointalk.org/index.php?topic=726338.0


Title: Re: Electrum server discussion thread
Post by: EvryIntl on August 19, 2016, 07:15:53 PM
Hi All,

I'm trying to get a new electrum server started, but it doesn't seem to sync all the way with bitcoind.  Bitcoind is up to the latest block, but electrum server is almost 1000 blocks behind it and falling further behind.  At one point it was 941 blocks behind, then 966 blocks behind, ...

Edit: Can it take that much longer to process via electrum than to keep up with the blockchain with bitcoind?  That is, if the hardware can keep up with bitcoind with lots of CPU and RAM to spare, shouldn't it be possible for electrum-server to catch up?  The log just shows it dropping further and further behind.  Perhaps I'm just missing something here?

The thing is slow. In my experience it take a lot more resources than bitcoind per block to digest. Maybe the insert into the patricia tree (?) utxo data structure is to blame? I wouldn't know.

There was an alternative implementation mentioned further up (in java?). I've been wanting to give it a try, but there's no pressure (the machine I use for electrum server has plenty of juice). Maybe you can try it and report back?

EDIT: found the post:

Are there any news about server re-write, with faster block processing?
Fireduck re-wrote electrum-server in Java and it processes blocks much faster than the original Python version.
See https://bitcointalk.org/index.php?topic=726338.0

I'll give it a try tonight.  It continues to fall further behind bitcoind, so I have to try something.  I'll report back tomorrow.  Thanks for the suggestion.


Title: Re: Electrum server discussion thread
Post by: JWU42 on October 24, 2016, 09:53:05 PM
Some interesting things brewing in the world of electrum servers...

ElectrumX announced and showing potential.

Fireduck is back to hacking away (in his spare time) on Jelectrum



Title: Re: Electrum server discussion thread
Post by: ThomasV on December 13, 2016, 01:22:18 PM
ElectrumX announced and showing potential.

ElectrumX is pretty stable and fast. It is now linked from electrum.org, in replacement of electrum-server


Title: Re: Electrum server discussion thread
Post by: kipper01 on December 31, 2016, 03:19:31 AM
Trying to get an electrum server up and running but get following error in logs

INFO:root:ElectrumX server starting
INFO:BlockProcessor:switching current directory to /home/kipper01/.electrumx/db
INFO:BlockProcessor:reorg limit is 200 blocks
Traceback (most recent call last):
  File "/usr/local/lib/python3.5/dist-packages/electrumx-0.9.19-py3.5.egg/EGG-INFO/scripts/electrumx_server.py", line 68, in main
  File "/usr/local/lib/python3.5/dist-packages/electrumx-0.9.19-py3.5.egg/EGG-INFO/scripts/electrumx_server.py", line 49, in main_loop
  File "/usr/local/lib/python3.5/dist-packages/electrumx-0.9.19-py3.5.egg/server/protocol.py", line 58, in __init__
    self.bp = BlockProcessor(env)
  File "/usr/local/lib/python3.5/dist-packages/electrumx-0.9.19-py3.5.egg/server/block_processor.py", line 161, in __init__
    super().__init__(env)
  File "/usr/local/lib/python3.5/dist-packages/electrumx-0.9.19-py3.5.egg/server/db.py", line 54, in __init__
    self.reopen_db(True)
  File "/usr/local/lib/python3.5/dist-packages/electrumx-0.9.19-py3.5.egg/server/db.py", line 86, in reopen_db
    self.db = open_db(db_name, self.env.db_engine, max_open_files)
  File "/usr/local/lib/python3.5/dist-packages/electrumx-0.9.19-py3.5.egg/server/storage.py", line 24, in open_db
    return db_class(name, for_sync)
  File "/usr/local/lib/python3.5/dist-packages/electrumx-0.9.19-py3.5.egg/server/storage.py", line 34, in __init__
    self.open(name, create=self.is_new, for_sync=for_sync)
  File "/usr/local/lib/python3.5/dist-packages/electrumx-0.9.19-py3.5.egg/server/storage.py", line 85, in open
    max_open_files=mof, 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)
plyvel._plyvel.IOError: b'IO error: lock Bitcoin-mainnet/LOCK: Resource temporarily unavailable'
CRITICAL:root:ElectrumX server terminated abnormally


Title: Re: Electrum server discussion thread
Post by: zebedee on January 03, 2017, 06:16:25 AM
Trying to get an electrum server up and running but get following error in logs

INFO:root:ElectrumX server starting
INFO:BlockProcessor:switching current directory to /home/kipper01/.electrumx/db
INFO:BlockProcessor:reorg limit is 200 blocks
Traceback (most recent call last):
  File "/usr/local/lib/python3.5/dist-packages/electrumx-0.9.19-py3.5.egg/EGG-INFO/scripts/electrumx_server.py", line 68, in main
  File "/usr/local/lib/python3.5/dist-packages/electrumx-0.9.19-py3.5.egg/EGG-INFO/scripts/electrumx_server.py", line 49, in main_loop
  File "/usr/local/lib/python3.5/dist-packages/electrumx-0.9.19-py3.5.egg/server/protocol.py", line 58, in __init__
    self.bp = BlockProcessor(env)
  File "/usr/local/lib/python3.5/dist-packages/electrumx-0.9.19-py3.5.egg/server/block_processor.py", line 161, in __init__
    super().__init__(env)
  File "/usr/local/lib/python3.5/dist-packages/electrumx-0.9.19-py3.5.egg/server/db.py", line 54, in __init__
    self.reopen_db(True)
  File "/usr/local/lib/python3.5/dist-packages/electrumx-0.9.19-py3.5.egg/server/db.py", line 86, in reopen_db
    self.db = open_db(db_name, self.env.db_engine, max_open_files)
  File "/usr/local/lib/python3.5/dist-packages/electrumx-0.9.19-py3.5.egg/server/storage.py", line 24, in open_db
    return db_class(name, for_sync)
  File "/usr/local/lib/python3.5/dist-packages/electrumx-0.9.19-py3.5.egg/server/storage.py", line 34, in __init__
    self.open(name, create=self.is_new, for_sync=for_sync)
  File "/usr/local/lib/python3.5/dist-packages/electrumx-0.9.19-py3.5.egg/server/storage.py", line 85, in open
    max_open_files=mof, 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)
plyvel._plyvel.IOError: b'IO error: lock Bitcoin-mainnet/LOCK: Resource temporarily unavailable'
CRITICAL:root:ElectrumX server terminated abnormally

Please visit #electrum for help, I don't read this site.

The above just means you had the DB open already elsewhere, perhaps you were running 2 sessions.


Title: Re: Electrum server discussion thread
Post by: loserkids on February 13, 2017, 06:41:08 AM
I have some spare macbook pro late 2011 and I'm thinking of either selling it for peanuts or running electrum server on it (and possibly have more security for my secondary funds held in Electrum). Is it's still impossible to run the code on anything other than linux?


Title: Re: Electrum server discussion thread
Post by: JWU42 on February 13, 2017, 11:25:13 AM
Possible - yes though I have no idea how it is done.

The developer of ElectrumX had been doing testing on a Mac.  I suspect you need a bit of technical chops to get it working...


Title: Re: Electrum server discussion thread
Post by: loserkids on February 14, 2017, 02:07:59 PM
The developer of ElectrumX had been doing testing on a Mac.  I suspect you need a bit of technical chops to get it working...
Thanks, I'll give it a try! I'm a tech guy so I think I'll be able to figure it out.


Title: Re: Electrum server discussion thread
Post by: mmortal03 on June 02, 2017, 08:23:18 AM
I wonder if it's possible to run the ElectrumX server on the Windows Subsystem for Linux (Bash on Ubuntu on Windows). Has anyone tried this?

Also, what's the difference between Electrum server and ElectrumX server?


Title: Re: Electrum server discussion thread
Post by: JWU42 on June 02, 2017, 11:12:13 AM
No to the first question.

ThomasV has stopped development of electrum-server and is encouraging all to use ElectrumX.  The main advantages of ElectrumX are the smaller DB and mainly the much faster sync time if building the db from genesis block.  It is literally 100+X faster.


Title: Re: Electrum server discussion thread
Post by: mmortal03 on June 02, 2017, 11:04:32 PM
No to the first question.

As soon as I get my txindex resynced, I'll give it a shot.


Title: Re: Electrum server discussion thread
Post by: mmortal03 on June 06, 2017, 12:40:40 PM
JWU42, It looks like I've gotten ElectrumX to work on the Windows Subsystem for Linux. I'll post directions in a little while. I have a quick question, though: How large is the ElectrumX database directory once it's synced currently?


Title: Re: Electrum server discussion thread
Post by: mmortal03 on June 07, 2017, 06:37:43 AM
Also, it looks like I'm running into a memory leak (I've been having to close it and open it back up to try to avoid this):

Code:
INFO:BlockProcessor:our height: 304,501 daemon: 470,107 UTXOs 854MB hist 228MB
INFO:BlockProcessor:our height: 304,569 daemon: 470,107 UTXOs 854MB hist 240MB
INFO:BlockProcessor:flushed to FS in 0.2s
INFO:BlockProcessor:flushed history in 14.0s for 1,159,443 addrs
INFO:BlockProcessor:flush #45 took 14.9s.  Height 304,569 txs: 40,250,489
INFO:BlockProcessor:tx/sec since genesis: 971, since last flush: 841
INFO:BlockProcessor:sync time: 11h 30m 18s  ETA: 3d 15h 33m
INFO:BlockProcessor:our height: 304,672 daemon: 470,107 UTXOs 858MB hist 19MB
INFO:BlockProcessor:our height: 304,781 daemon: 470,107 UTXOs 863MB hist 35MB
INFO:BlockProcessor:our height: 304,848 daemon: 470,107 UTXOs 872MB hist 52MB
INFO:BlockProcessor:our height: 304,935 daemon: 470,107 UTXOs 874MB hist 64MB
INFO:BlockProcessor:our height: 304,988 daemon: 470,107 UTXOs 874MB hist 76MB
ERROR:Controller:Traceback (most recent call last):
  File "/home/mmortal03/source/electrumx/server/controller.py", line 157, in on_future_done
    future.result()
  File "/home/mmortal03/source/electrumx/server/block_processor.py", line 201, in main_loop
    await task()
  File "/home/mmortal03/source/electrumx/server/block_processor.py", line 243, in check_and_advance_blocks
    await self.controller.run_in_executor(self.advance_blocks, blocks)
  File "/home/mmortal03/source/electrumx/server/controller.py", line 137, in run_in_executor
    return await self.loop.run_in_executor(None, func, *args)
  File "/usr/lib/python3.6/concurrent/futures/thread.py", line 55, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/home/mmortal03/source/electrumx/server/block_processor.py", line 493, in advance_blocks
    undo_info = self.advance_txs(block.transactions)
  File "/home/mmortal03/source/electrumx/server/block_processor.py", line 546, in advance_txs
    hashX + tx_numb + s_pack('<Q', txout.value))
MemoryError


Title: Re: Electrum server discussion thread
Post by: mmortal03 on June 07, 2017, 01:00:17 PM
I guess I should try lowering CACHE_MB and see what happens.


Title: Re: Electrum server discussion thread
Post by: mmortal03 on June 07, 2017, 07:34:35 PM
Here are the steps I took to get a bare bones instance of ElectrumX up and running on Windows 10 with the Windows Subsystem for Linux:

First, some backstory. For some reason, I couldn't get rid of an underlying instance of python3.5 on (at least my copy of) the Windows Subsystem for Linux. I *also* couldn't get python3-pip to install without it also wanting to pull python3.5 dependencies. Because of this, I had to make sure to always explicitly call python3.6 when running everything. Also, for whatever reason, the installation required using sudo in places where you normally wouldn't.

So, assuming you already have the Windows Subsystem for Linux up and running, and you have a Bitcoin node running with txindex=1 and rpc configured and ready to connect to, here are the commands I ran to get a very bare bones copy of ElectrumX up and running:

sudo apt-get install python3.6 python3.6-dev
sudo apt install python3-pip
sudo python3.6 -m pip install --upgrade pip setuptools wheel
sudo apt-get install libleveldb-dev
sudo python3.6 -m pip install aiohttp pylru leveldb plyvel
mkdir ~/source
cd ~/source
git clone https://github.com/kyuupichan/electrumx.git
cd electrumx
sudo python3.6 -m pip install jaraco.collections

sudo python3.6 setup.py install
(keep repeating this install command until *all* packages actually download and install without errors)

mkdir ~/.electrumx
cd ~/.electrumx

(for more on configuring the following ssl certificate stuff, see the following tutorial, midway down the page: https://freedomnode.com/blog/69/how-to-install-an-electrum-server-using-full-bitcoin-node-and-electrumx )
openssl genrsa -des3 -passout pass:x -out server.pass.key 2048
openssl rsa -passin pass:x -in server.pass.key -out server.key
rm server.pass.key
openssl req -new -key server.key -out server.csr

(make sure to customize the following to point to your own user directory to point to the above .electrum path, and using your, preferably random, Bitcoin node rpc username and password)
export DAEMON_URL=http://rpc_username:rpc_password@localhost:8332/
export DB_DIRECTORY=/home/mmortal03/.electrumx/
export SSL_CERTFILE=/home/mmortal03/.electrumx/server.crt
export SSL_KEYFILE=/home/mmortal03/.electrumx/server.key
export CACHE_MB=600
python3.6 ~/source/electrumx/electrumx_server.py


Title: Re: Electrum server discussion thread
Post by: mmortal03 on June 11, 2017, 07:24:01 PM
It looks like there are some further memory management issues that simply lowering CACHE_MB doesn't solve.

 I'll have to post this issue to the Github:

Code:
INFO:BlockProcessor:our height: 362,156 daemon: 470,268 UTXOs 492MB hist 78MB
INFO:BlockProcessor:our height: 362,190 daemon: 470,268 UTXOs 496MB hist 92MB
INFO:BlockProcessor:our height: 362,235 daemon: 470,269 UTXOs 499MB hist 105MB
INFO:BlockProcessor:flushed to FS in 0.1s
INFO:BlockProcessor:flushed history in 7.2s for 514,119 addrs
terminate called after throwing an instance of 'std::bad_alloc'
  what():  std::bad_alloc
Aborted (core dumped)



Code:
INFO:BlockProcessor:our height: 444,430 daemon: 470,829 UTXOs 477MB hist 96MB
INFO:BlockProcessor:our height: 444,441 daemon: 470,829 UTXOs 482MB hist 107MB
INFO:BlockProcessor:our height: 444,451 daemon: 470,829 UTXOs 486MB hist 116MB
INFO:BlockProcessor:flushed to FS in 0.1s
INFO:BlockProcessor:flushed history in 7.3s for 578,675 addrs
terminate called after throwing an instance of 'std::bad_alloc'
  what():  std::bad_alloc
Aborted (core dumped)


Title: Re: Electrum server discussion thread
Post by: marcus_of_augustus on June 12, 2017, 01:25:36 AM
No to the first question.

ThomasV has stopped development of electrum-server and is encouraging all to use ElectrumX.  The main advantages of ElectrumX are the smaller DB and mainly the much faster sync time if building the db from genesis block.  It is literally 100+X faster.

This is interesting. Can ElectrumX be used on top of a current local blockchain (Core)? Or roughly how long will it take to sync entire blockchain up from scratch on ElectrumX (e.g relative to core)?


Title: Re: Electrum server discussion thread
Post by: mmortal03 on June 12, 2017, 11:41:58 AM
No to the first question.

ThomasV has stopped development of electrum-server and is encouraging all to use ElectrumX.  The main advantages of ElectrumX are the smaller DB and mainly the much faster sync time if building the db from genesis block.  It is literally 100+X faster.

This is interesting. Can ElectrumX be used on top of a current local blockchain (Core)? Or roughly how long will it take to sync entire blockchain up from scratch on ElectrumX (e.g relative to core)?

You must connect it to a Core node over RPC, so it doesn't sync independently. If the Core node is already synced and local, it'll take at least a few days to get ElectrumX synced. I started syncing mine on a slower computer (but with an SSD), and it's taken mine about a week.


Title: Re: Electrum server discussion thread
Post by: mmortal03 on June 15, 2017, 06:54:05 PM
Finally finished syncing mine. It looks like the ElectrumX database is currently around 22 GB.


Title: Re: Electrum server discussion thread
Post by: marcus_of_augustus on June 18, 2017, 03:54:09 AM
No to the first question.

ThomasV has stopped development of electrum-server and is encouraging all to use ElectrumX.  The main advantages of ElectrumX are the smaller DB and mainly the much faster sync time if building the db from genesis block.  It is literally 100+X faster.

This is interesting. Can ElectrumX be used on top of a current local blockchain (Core)? Or roughly how long will it take to sync entire blockchain up from scratch on ElectrumX (e.g relative to core)?

You must connect it to a Core node over RPC, so it doesn't sync independently. If the Core node is already synced and local, it'll take at least a few days to get ElectrumX synced. I started syncing mine on a slower computer (but with an SSD), and it's taken mine about a week.

thnx, exactly the info I was after.


Title: Re: Electrum server discussion thread
Post by: aetherist on June 23, 2017, 11:30:27 PM
Could someone explain the last mile of setting up an electrum-server or electrumX server on a home network? My FQDN resolves, but it does not appear to be pointing to my desktop running electrumX. Perhaps the FQDN points to my router? I registered a domain name, but do I need a subdomain as well?


Title: Re: Electrum server discussion thread
Post by: JWU42 on June 26, 2017, 01:16:36 PM
You need to use your LAN IP for the HOST (e.g. 192.168.1.xxx) and then the FQDN for the REPORT_HOST on E-X.


Title: Re: Electrum server discussion thread
Post by: aetherist on June 28, 2017, 11:31:11 PM
Now, electrum connects to electrumX when I set my A record in the DNS to the internal IP 10.0.0.2 => icarus.tetradrachm.net.  If I change the A record to my home router's external IP, electrum shows my electrum server as offline. I assume that the home router is firewalling electrumX, or electrumX needs a global IP (that is port forwarding will not suffice).


Title: Re: Electrum server discussion thread
Post by: aetherist on July 07, 2017, 11:22:11 PM
I set /etc/hosts and the  DNS A record to the remote IP.  From there, I port forwarded to the server's internal IP which works. Still, SSL remains improperly configured.  I followed the directions on https://freedomnode.com/blog/69/how-to-install-an-electrum-server-using-full-bitcoin-node-and-electrumx

Is SSL worth setting up?


Title: Re: Electrum server discussion thread
Post by: takinbo on July 08, 2017, 01:09:26 AM
It is worth setting up if your host is going to be publicly accessible. With regards to setting up SSL, what you might need to understand is that clients usually cache the certificates of the hosts after connecting for the first time and if the certificate changes, they would flag the connection as possibly being MITM'ed.

Can you state exactly what you are experiencing with setting up SSL?


Title: Re: Electrum server discussion thread
Post by: aetherist on July 10, 2017, 09:12:07 AM
I am hosting publicly: icarus.tetradrachm.net.   When I followed the directions on the aforementioned guide, I did not get any errors.  However, when I attempt to connect my electrum light wallet to my full node electrumX server I get a green light when I choose 50001 and uncheck SSL and a red light when I choose SSL 50002.  Typing "journalctl | grep electrum" in the terminal prints, "electrumx_server.py[1069]: INFO:ElectrumX:[1919] SSL 70.181.17.94:33670, 89 total" among other TCP and SSL connections which confuses me. Perhaps my SSL is misconfigured on my light wallet end?

I know that web servers tend to have their signed certificates hosted by a 3rd party CA.  Does this apply to electrumX/electrum-server? I have not paid to register a CSR with a CA.


Title: Re: Electrum server discussion thread
Post by: takinbo on July 10, 2017, 10:21:20 AM
Electrum clients don't have a problem with self-signed certificates so no need to get a CA-signed one.

I attempted to connect to your node to debug the SSL problem and I think everything is okay except that you did not specify a Common Name for the certificate when you were creating it. You want to at least use icarus.tetradrachm.net as your common name (wildcards "*" will work just fine too) and create a new certificate. If you have the private key of the current certificate, you can attempt to create a new self-signed certificate using the same key but this time remembering to add a common name.

HTH


Title: Re: Electrum server discussion thread
Post by: aetherist on July 12, 2017, 11:32:52 PM
I have the verbose output from electrum (not the server).

[Network] connecting to icarus.tetradrachm.net:50002:s as new interface
[icarus.tetradrachm.net] SSL error: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:590)
[icarus.tetradrachm.net] wrong certificate
[Network] connecting to icarus.tetradrachm.net:50002:s as new interface


Title: Re: Electrum server discussion thread
Post by: takinbo on July 13, 2017, 12:31:14 AM
As I mentioned in my previous post. You have to recreate the certificate with a specified common name for it to work.


Title: Re: Electrum server discussion thread
Post by: aetherist on July 16, 2017, 10:14:17 PM
I signed a new certificate which listed the FQDN.  However, I still had the same error. After reading this, https://github.com/spesmilo/electrum/issues/1782, I realized that my laptop and phone thin wallets had connected to my server when I had my original SSL certificate in which I had filled out all the fields.  I had deleted this one when I got too much spam from bots scraping my e-mail off the certificate.  Since the original certificate was in my thin clients ~/.electrum/certs as trusted, my server was either flagged as MITM'd or my thin client tried to use the incorrect certificate, so my server refused the connection.  After deleting the trusted certificates, I have connected via SSL on both thin clients now.

On another topic, with regards to bootstrapping speed, my online instructor stated that VFS is much faster than ext4.  So, I am considering reformatting my 4TB bitcoind HDD and 0.5TB  electrumX SSD, and lowering bitcoind's dbcache from the current setting of 3GB.  Bitcoind uses 10% of my 20GB of RAM after bootstrapping.  I welcome any resource allocation suggestions.


Title: Re: Electrum server discussion thread
Post by: quicktolegit96 on July 17, 2017, 03:05:27 AM
can someone tell me if i can switch from standard wallet to 2FA (authenticator) or hardware device and how do i do this?



Title: Re: Electrum server discussion thread
Post by: Lionel on August 03, 2017, 08:14:06 PM
Hi,

i have an Electrum wallet running on Windows but i don't see a way to neither open the Python console nor to make the daemon listen on localhost:7777 so that i can send him commands from my script.

How can i achieve that?


Title: Re: Electrum server discussion thread
Post by: takinbo on August 03, 2017, 08:25:51 PM
Click on the View menu option and select "Show Console"


Title: Re: Electrum server discussion thread
Post by: Lionel on August 03, 2017, 08:55:35 PM
Click on the View menu option and select "Show Console"

Thanks ; )

How can i run it in daemon mode on port 7777 on Windows?

Maybe i need to use the Python version of Electrum ?

 Is this the right one: https://launchpad.net/ubuntu/trusty/+package/python-electrum


Title: Re: Electrum server discussion thread
Post by: takinbo on August 03, 2017, 09:37:13 PM
Instructions on setting the RPC port can be found here - http://docs.electrum.org/en/latest/merchant.html

Electrum itself is a python application and the version you linked to is for Ubuntu (not Windows).


Title: Re: Electrum server discussion thread
Post by: Lionel on August 03, 2017, 11:00:31 PM
Instructions on setting the RPC port can be found here - http://docs.electrum.org/en/latest/merchant.html

Electrum itself is a python application and the version you linked to is for Ubuntu (not Windows).

Thanks.

Since it's python it should be portable like java, so i wonder why it's just for Linux.

Anyway seems like bitcoind is much easier to get working on Windows at this point..


Title: Re: Electrum server discussion thread
Post by: takinbo on August 04, 2017, 11:28:22 AM
Yes Python is generally portable but the packaging can vary; as in this case.

You should be able to use the Windows executable that you can download from https://electrum.org/#download (https://electrum.org/#download).


Title: Re: Electrum server discussion thread
Post by: Lionel on August 04, 2017, 05:45:37 PM
You should be able to use the Windows executable that you can download from https://electrum.org/#download (https://electrum.org/#download).

I have it for Windows but it doesn't have the daemon AFAIK, while Bitcoin Core has the daemon on Windows as well.

I need to call the wallet via JSON-RPC from my scripts, so i need the daemon


Title: Re: Electrum server discussion thread
Post by: takinbo on August 04, 2017, 06:34:54 PM
If you are able to locate the directory (from the command prompt) where Electrum is installed, you can run the commands to start it in daemon mode. Unfortunately, I'm unable to give you specific instructions on how to do that.


Title: Re: Electrum server discussion thread
Post by: mmortal03 on August 25, 2017, 04:46:40 AM
This seems important: "The ElectrumX devs made a change in a recent server release so that the default network ("mainnet"), which was previously pointing to the BTC chain, now points to the BCH chain by default. For server operators who update, they now have to explicitly select "bitcoin-segwit" to keep following the BTC chain."

https://www.reddit.com/r/Bitcoin/comments/6vrs69/instead_of_just_cheering_segwit_can_we_get_actual/dm2vwqa/


Title: Re: Electrum server discussion thread
Post by: Green Lantern on October 08, 2017, 05:29:34 PM
I tried once to run 2 electrum servers (for different cryptocurrencies) on the same vps. But it didn't allow me to run second server.
Is there a way to run two (and more) electrum servers on same machine?


Title: Re: Electrum server discussion thread
Post by: flowjob on October 09, 2017, 01:28:10 AM
I tried once to run 2 electrum servers (for different cryptocurrencies) on the same vps. But it didn't allow me to run second server.
Is there a way to run two (and more) electrum servers on same machine?

I run 20 electrum servers on one machine without problem. You have to make different configs for each coin and start one instance of electrumx per coin. Here is a sample script to set one up: https://github.com/SuperNETorg/electrumx/blob/master/docs/HOWTO_SuperNET.txt.


Title: Re: Electrum server discussion thread
Post by: Green Lantern on October 09, 2017, 10:13:15 AM
I tried once to run 2 electrum servers (for different cryptocurrencies) on the same vps. But it didn't allow me to run second server.
Is there a way to run two (and more) electrum servers on same machine?

I run 20 electrum servers on one machine without problem. You have to make different configs for each coin and start one instance of electrumx per coin. Here is a sample script to set one up: https://github.com/SuperNETorg/electrumx/blob/master/docs/HOWTO_SuperNET.txt.
This is electrumx. I meant previous electrum server (github.com/spesmilo/electrum-server)


Title: Re: Electrum server discussion thread
Post by: mmortal03 on October 09, 2017, 06:33:13 PM
I tried once to run 2 electrum servers (for different cryptocurrencies) on the same vps. But it didn't allow me to run second server.
Is there a way to run two (and more) electrum servers on same machine?

I run 20 electrum servers on one machine without problem. You have to make different configs for each coin and start one instance of electrumx per coin. Here is a sample script to set one up: https://github.com/SuperNETorg/electrumx/blob/master/docs/HOWTO_SuperNET.txt.
This is electrumx. I meant previous electrum server (github.com/spesmilo/electrum-server)

My understanding is that even the electrum server creator suggests that you use electrumx now.


Title: Re: Electrum server discussion thread
Post by: Green Lantern on October 09, 2017, 09:36:51 PM
I tried once to run 2 electrum servers (for different cryptocurrencies) on the same vps. But it didn't allow me to run second server.
Is there a way to run two (and more) electrum servers on same machine?

I run 20 electrum servers on one machine without problem. You have to make different configs for each coin and start one instance of electrumx per coin. Here is a sample script to set one up: https://github.com/SuperNETorg/electrumx/blob/master/docs/HOWTO_SuperNET.txt.
This is electrumx. I meant previous electrum server (github.com/spesmilo/electrum-server)

My understanding is that even the electrum server creator suggests that you use electrumx now.
flowjob is the electrum server creator?


Title: Re: Electrum server discussion thread
Post by: flowjob on October 19, 2017, 10:42:01 PM
I tried once to run 2 electrum servers (for different cryptocurrencies) on the same vps. But it didn't allow me to run second server.
Is there a way to run two (and more) electrum servers on same machine?

I run 20 electrum servers on one machine without problem. You have to make different configs for each coin and start one instance of electrumx per coin. Here is a sample script to set one up: https://github.com/SuperNETorg/electrumx/blob/master/docs/HOWTO_SuperNET.txt.
This is electrumx. I meant previous electrum server (github.com/spesmilo/electrum-server)

My understanding is that even the electrum server creator suggests that you use electrumx now.
flowjob is the electrum server creator?

No, i am just running a lot of electrum-servers to use them in BarterDEX. The official repo is this one: https://github.com/kyuupichan/electrumx


Title: Re: Electrum server discussion thread
Post by: aetherist on December 15, 2017, 01:24:43 AM
I have reinstalled Ubuntu 16 LTS.  Previously I had ElectrumX working, but with unexplained downtime and unreliable fee estimates.  Hence I reinstalled Ubuntu server.  I have reinstalled Ubuntu a few times after failing.  At one point, I symbolically linked /usr/bin/python3 to /usr/bin/python3.6 which broke the package management.  Now I have /usr/local/bin/python3 -> /usr/bin/python3.6 which seems to work; although, I have an error which may or may not be related to package management/dependencies:

Dec 14 16:26:05 icarus electrumx_server.py[2534]: Traceback (most recent call last):
...

Dec 14 16:26:05 icarus electrumx_server.py[2534]:   File "/usr/local/lib/python3.6/dist-packages/electrumx-1.2.1-py3.6.egg/server/block_processor.py", line 148, in __init__
Dec 14 16:26:05 icarus electrumx_server.py[2534]:     self.cancel_history_compaction()
Dec 14 16:26:05 icarus electrumx_server.py[2534]: AttributeError: 'BlockProcessor' object has no attribute 'cancel_history_compaction'

I have no clue whether the issue is with dependencies such as leveldb or something else entirely.


Title: Re: Electrum server discussion thread
Post by: flowjob on December 16, 2017, 04:33:42 PM
I would not use ubuntu on servers, use debian instead, you will have much less trouble with it. python3.6 is available in debian https://packages.debian.org/buster/python3.6, so you can install electrumx directly with "sudo python3.6 setup.py install"


Title: Re: Electrum server discussion thread
Post by: aetherist on December 16, 2017, 09:46:32 PM
In my last iteration of reinstalling, I had commented the following and and replaced it with the sudo installation.
#ExecStart=/home/electrum/electrumx/electrumx_server.py
ExecStart=/usr/local/bin/electrumx_server.py

As a rough postmortem, I got so used to appending the instructions with tweaks such as "pip3" instead of "pip" and "sudo apt-get install" instead of "apt-get install" I lost sight of the fact the in order to contain the privileges of user electrum you want to make sure electrum only starts files/processes which are not owned by root.  I am actually still a little fuzzy how the user electrum could even access a file in /usr (?inherentence from systemctl?).  Therefore, "python3.6 setup.py install" should work for anyone else attempting to install on Ubuntu, but you will probably need the symbolic link from my last post.  I don't know what the error was that caused my to comment the line above was, but my guess is that I would not of seen it on debian (if python3.6 baked in).


Title: Re: Electrum server discussion thread
Post by: wandyer on January 02, 2018, 08:59:44 PM
I need some help understanding the whole concept of Bitcoin Core + Electrumx.

I have a full node running and electrumx installed, but still don't quite get how I'm going to access it and what are the API calls available to me.

If someone could take their time and contact me privately so it doesn't fill up this thread.

Thanks in advance.


Title: Re: Electrum server discussion thread
Post by: aetherist on January 03, 2018, 05:11:45 PM
I'm going to reply on the thread, so that the next person that sees your question knows that it has been answered.  Also, someone else might have the same question.

Firstly, I like to break up a large problem into smaller ones.  So, in script kiddie fashion, I copy and paste one of these scripts https://en.bitcoin.it/wiki/API_reference_(JSON-RPC) in order to make sure that you can communicate between processes.  A few things can go wrong here.  I've seen a version update break the (inter-process communication) IPC  in both Zcash  and a Bitcoin Unlimited.  It may have been from the same pull which was not properly vetted or separate pulls.  Make sure your username and password match.  If you use Perl, it may have issues parsing some characters in the password, so omit or replace any suspect characters.

JM required
walletnotify=curl -sI --connect-timeout 1 http://localhost:62602/walletnotify?%s
alertnotify=curl -sI --connect-timeout 1 http://localhost:62602/alertnotify?%s
I'm not sure if JMCS does, but I use them.  I think that should get you in the right direction.


Title: Re: Electrum server discussion thread
Post by: GalaxyCash on March 28, 2018, 06:05:29 PM
Hi, i setup electrum server for my coin on Ubuntu 16.04, uses latest electrum from repository, not electrumx

wallet client stuck on synchronization
on server in log:

[29/03/2018-01:54:18] SSL      *.*.*.*:60424    2 3.1.2
[29/03/2018-01:54:19] SSL      *.*.*.*:60426    1 3.1.2
[29/03/2018-01:55:17] error: no processor for mempool
[29/03/2018-01:56:17] error: no processor for mempool
[29/03/2018-01:57:17] error: no processor for mempool


Title: Re: Electrum server discussion thread
Post by: GalaxyCash on March 29, 2018, 08:39:06 PM
5000 GCH bounty for build Electrum server and client(windows & linux) with sources for GalaxyCash.
PM me in discord.

https://discord.gg/qCJtFua


Title: Server only serves 2 or 3 connections
Post by: aetherist on August 17, 2018, 10:18:52 PM
Aug 17 13:51:37 icarus electrumx_server[1984]: INFO:ElectrumX:[1202] SSL 92.156.243.66:56970, 2 total
Aug 17 13:52:28 icarus electrumx_server[1984]: INFO:ElectrumX:[1203] SSL 190.91.37.177:65412, 2 total
Aug 17 13:53:18 icarus electrumx_server[1984]: INFO:ElectrumX:[1204] SSL 190.91.37.177:49218, 2 total
Aug 17 13:54:14 icarus electrumx_server[1984]: INFO:ElectrumX:[1205] SSL 190.91.37.177:49350, 2 total
Aug 17 13:55:24 icarus electrumx_server[1984]: INFO:ElectrumX:[1206] SSL 190.91.37.177:49538, 2 total
Aug 17 13:56:28 icarus electrumx_server[1984]: INFO:ElectrumX:[1207] SSL 190.91.37.177:49654, 2 total
Aug 17 13:57:30 icarus electrumx_server[1984]: INFO:ElectrumX:[1208] SSL 190.91.37.177:49846, 2 total
Aug 17 13:58:15 icarus electrumx_server[1984]: INFO:ElectrumX:[1209] SSL 190.91.37.177:49966, 2 total
Aug 17 13:59:33 icarus electrumx_server[1984]: INFO:ElectrumX:[1210] SSL 190.91.37.177:50190, 2 total
Aug 17 14:00:08 icarus electrumx_server[1984]: INFO:ElectrumX:[1211] SSL 190.91.37.177:50260, 2 total
Aug 17 14:01:04 icarus electrumx_server[1984]: INFO:ElectrumX:[1212] SSL 217.182.138.142:41128, 2 total
Aug 17 14:01:51 icarus electrumx_server[1984]: INFO:ElectrumX:[1213] SSL 185.128.27.99:56548, 3 total
Aug 17 14:31:03 icarus electrumx_server[1984]: INFO:ElectrumX:[1214] SSL 217.182.138.142:34996, 2 total
Aug 17 14:36:58 icarus electrumx_server[1984]: INFO:ElectrumX:[1215] SSL 71.204.162.202:58830, 3 total
Aug 17 14:39:28 icarus electrumx_server[1984]: INFO:ElectrumX:[1216] SSL 73.32.220.70:57214, 3 total

I try to connect to my server but cannot.  From looking at the logs, it appeared as though my max connections somehow got lowered to 2 or 3, but then after looking at the logs more closely it looks like ElectrumX serves mostly 190.91.37.177 .  I did upgrade to LEDE from a small business router recently.  However, I would think if my IPtables config were the issue that I would have trouble SSHing into Icarus (my server).  Initially, I had trouble SSHing into Icarus but after reconfiguring IPtables I could SSH into Icarus.  About the same time that SSH started working, my AWS server notifications notified me that my server was up.  So, apparently Icarus serves watching only wallets.

 I have no clue why my SSL connections are not on 50002; I plan to tweak IPtables.  If that does not work then I'll upgrade to Ubuntu 18, so that I will be working with a fresh install.  If that doesn't fix it.  I will reset my router config.


Title: Re: Electrum server discussion thread
Post by: furo4kin on August 24, 2018, 08:26:40 PM
Same problem.
Error: Requesting account info from TrustedCoin server... Please try again.



Title: Re: Electrum server discussion thread
Post by: aetherist on August 24, 2018, 10:50:50 PM
I reviewed my logs again.  Actually, the SSL connections were not of the format IP:50002.  So, that hasn't changed since my server's last working state.  I upgraded Ubuntu to 18.04 LTS and upgraded to python 3.7 which increased the number of connections to approximately 30, but I could still not connect via an Electrum client.  Also, a couple months ago when I could connect I had about 10X the connections.  

Furo4kin, have you looked at these issues?
https://github.com/kyuupichan/electrumx/issues/556
https://github.com/kyuupichan/electrumx/issues/94

Let me know if your logs match any output from these issues.  Issue #556 seems to match the timeline of our problems.  I am unsure where the weakest point would be in a DOS attack, but I suppose it would be my router.

Furo4kin, if you would like any more info as I learn more, I could PM you if you allow messages from newbies


Title: Re: Electrum server discussion thread
Post by: aetherist on August 26, 2018, 09:19:37 PM
I found my laptop's IP address among the connections.  So, my client connects to the server, but the server does not serve any data to my laptop.  Presumably, I have a low connections count because clients see my server and connect to it but when they fail to retrieve data they connect to another server.


Title: Re: Electrum server discussion thread
Post by: aetherist on August 28, 2018, 08:26:41 AM
I ran electrum -v and figured out that the problem was my SSL certificate had expired.  For some reason, I could not connect in via port 50001.  So, unfortunately, anyone who has connected to my server in the past will not be able to connect unless (s)he deletes their wallet and restores from the seed because otherwise the old certificate will fail to verify.


Title: Re: Electrum server discussion thread
Post by: Technobilder on April 25, 2021, 10:30:25 AM
I hope someone can help me.

I have some old Verge Electrum from which I only have the seed left.
I need to rebuild the wallet on OSX now so I downloaded Electrum-XVG2.4 from github and it runs fine, only its not connecting to the network.

The only server in it is electrum-verge.xyz
I only found electrum-xvg.stream as another server but theres no way to add it to the list.

Can anyone help me with an actual server list and how I can add them into Electrum-XVG2.4 so I can rebuild my wallet and recover my VERGE?

Thank you


Title: Re: Electrum server discussion thread
Post by: nc50lc on April 26, 2021, 04:15:30 AM
I hope someone can help me.
-snip-
I'm not hodling Verge but this 5-day old reddit post about offline electrum-xvg has some good feedbacks: A question about an ancient wallet (https://www.reddit.com/r/vergecurrency/comments/mttu4d/a_question_about_an_ancient_wallet/gva4mog?utm_source=share&utm_medium=web2x&context=3)
You need Tor for that.


Title: Re: Electrum server discussion thread
Post by: Meuserna on June 06, 2023, 09:26:22 PM
Is there a current guide for setting up an Electrum server on a Mac (not a personal server)?

Is an Electrum Server the same thing as electrumx?  I hope that's not a dumb question.

I've been running a full Bitcoin Node (using the Bitcoin Core app) for a few months.

My goal is to set up BTC RPC Explorer and be able to look up my wallets, historical data, etc, on my own block explorer.

This is mostly a project for me to learn, strictly for my own use - at least for now.


Title: Re: Electrum server discussion thread
Post by: nc50lc on June 07, 2023, 03:49:51 AM
Is an Electrum Server the same thing as electrumx?  I hope that's not a dumb question.
Yes, that is one implementation of Electrum server.
And I'd recommend it if your end-goal is not to use it for personal use, but public.

Plus it's fork is maintained by same developers of Electrum: https://github.com/spesmilo/electrumx (https://github.com/spesmilo/electrumx)
For the set-up, you can refer to its official documentation: https://electrumx-spesmilo.readthedocs.io/en/latest/HOWTO.html (https://electrumx-spesmilo.readthedocs.io/en/latest/HOWTO.html)


Title: Re: Electrum server discussion thread
Post by: DireWolfM14 on June 08, 2023, 09:27:46 PM
Is there a current guide for setting up an Electrum server on a Mac (not a personal server)?

I don't know of any electrum SPC server that's ready to go for a Mac and I have very little experience with MacOS, but you may be able to compile a binary of Electrs (Romanz1 or Blockstream2) that will run on your system.

1https://github.com/romanz/electrs
2https://github.com/Blockstream/electrs

Is an Electrum Server the same thing as electrumx?

ElectrumX is one of the SPC servers compatible with Electrum (and many other clients,) but as far as I know it's intended to run on Linux.  Again, if you're skilled with such things you can compile your own binary, but I don't know of any instructional that will guide you through the process.

My goal is to set up BTC RPC Explorer and be able to look up my wallets, historical data, etc, on my own block explorer.

This is mostly a project for me to learn, strictly for my own use - at least for now.

Romanz Electrs is very easy to set up and plenty good enough for personal use with a blockchain explorer.  One of my servers has been running Mempool.space with Romanz Electrs as the backend, and it's been running flawlessly for nearly two years.  Looking up an address with a ton of transactions will be slow, but I've never had it hang up.  Blockstream's Electrs fork is more robust and more practical for a public server, but it requires more resources.


Title: Re: Electrum server discussion thread
Post by: Cricktor on July 16, 2023, 01:01:23 PM
An interesting Electrum server is also Fulcrum (https://github.com/cculianu/Fulcrum) which has been discussed in some other thread(s) here on this forum, e.g. here https://bitcointalk.org/index.php?topic=5441463 (https://bitcointalk.org/index.php?topic=5441463) and also compared with other Electrum server implementations e.g. here https://www.sparrowwallet.com/docs/server-performance.html (https://www.sparrowwallet.com/docs/server-performance.html).

I use Fulcrum on my RaspiBlitz node as replacement for electrs because I got tired of the issues that electrs has sometimes with addresses that have a huge transaction history. For my personal Electrum wallets I don't need Fulcrum, electrs would be fine. When I do sometimes a bit of blockchain digging I've run into such issues from time to time with electrs. Fulcrum is easier to configure to serve huge address histories and it's refreshingly fast with data retrieval compared to electrs.

Linux and Windows executables are available from the Github, MacOS executables are announced but not yet there. You can always check the code and compile your executable yourself. I don't mind that the main dev appears to be in the BCH camp, the project is open-source and works very well for Bitcoin.