Bitcoin Forum

Bitcoin => Electrum => Topic started by: fireduck on August 06, 2014, 06:26:17 AM



Title: Java Electrum Server - jelectrum
Post by: fireduck on August 06, 2014, 06:26:17 AM
https://github.com/fireduck64/jelectrum

I have created a fresh electrum server that uses java and bitcoinj.  It replicates all features of the standard python electrum server (that I know about).

If anyone tried it in the last week, I just changed some things around in the database.  You'll have to nuke your mongodb DB and sync fresh.


Title: Re: Java Electrum Server - jelectrum
Post by: fireduck on August 06, 2014, 09:11:45 PM
With some recent improvements I've simplified the locking model for multi-threaded database updates and made it a bit faster.

I think we are looking at about a ~2-3 day sync for the entire blockchain, assuming SSD and a few CPU cores.



Title: Re: Java Electrum Server - jelectrum
Post by: jonald_fyookball on August 07, 2014, 01:55:05 AM
nice work fireduck...

I promised myself to run a full node electrum server when I get a new PC.


Title: Re: Java Electrum Server - jelectrum
Post by: fireduck on August 09, 2014, 12:54:43 AM
After a fresh DB sync, I have a server up at b.1209k.com 50002 ssl.

If it doesn't connect, try deleting your cert for b.1209k.com.  I ran an electrum server with a different cert there before.



Title: Re: Java Electrum Server - jelectrum
Post by: fireduck on August 19, 2014, 05:46:13 PM
"Unknown method - blockchain.address.listunspent"

Looks like I have work to do.


Title: Re: Java Electrum Server - jelectrum
Post by: fireduck on August 22, 2014, 05:41:54 PM
jelectrum:
Saved block: 00000000000000001c5b4fd3a8ae6150f5a8c0e869ece137307cae59a8dd83b8 - 316980 - 1024 (1.138 seconds)
Saved block: 00000000000000001f9e4d8b0e9ae8d5a45f9d8f3afd249bc1b451ac9b556389 - 316981 - 1702 (2.313 seconds)
Saved block: 0000000000000000174fd2b47b1a8420217b7cdb3d2269c521cb9f35d06afeb2 - 316982 - 713 (0.924 seconds)
Saved block: 000000000000000029000da8903b3df605b111e91b9f18bea9503e53c22b3091 - 316983 - 1732 (2.068 seconds)
Saved block: 00000000000000001fc3cdede940822b24a29cbdda760547fcaab961b145c468 - 316983 - 1689 (0.955 seconds)

electrum-server:
INFO:electrum:blockchain: 316980 (15.073s)
INFO:electrum:blockchain: 316981 (35.007s)
INFO:electrum:blockchain: 316982 (21.482s)
INFO:electrum:blockchain: 316983 (39.583s)
INFO:electrum:blockchain reorg 316983 0000000000000000174fd2b47b1a8420217b7cdb3d2269c521cb9f35d06afeb2 000000000000000029000da8903b3df605b111e91b9f18bea9503e53c22b3091


Both of these were running at the same time on the same hardware.  Jelectrum does seem to import blocks a lot faster.


Title: Re: Java Electrum Server - jelectrum
Post by: jonald_fyookball on August 22, 2014, 09:58:51 PM
what do you see as benefits of java implementation over normal electrum server?


Title: Re: Java Electrum Server - jelectrum
Post by: torusJKL on October 09, 2014, 04:13:45 PM
I'm thinking about creating an Electrum server.
I'll definitely look into this release.


Title: Re: Java Electrum Server - jelectrum
Post by: JWU42 on August 22, 2015, 10:37:24 PM
Bumping this as it is now relevant again...


Title: Re: Java Electrum Server - jelectrum
Post by: JWU42 on August 29, 2015, 07:45:39 PM
Just to advise that jelectrum (with respect to creating a new DB) is 50+ times faster than the existing python implementation (yes, you can should download a database from the foundry for the python version but what fun is that).  There are "costs" to running the jelectrum server, however...

1.  The leveldb database is roughly 130GB

Code:
25G     ELDB/electrum-leveldb-utxo-1000

So over 100GB larger

2.  The amount of RAM needed on the server (and this could be tweaked more going forward I assume) is ideally 12+ GB

 - I have been running the python version on a server with 8 GB and could get away with as little as 4GB

All that said, I am enjoying trying something new and can foresee this being the evolution of the current server software.

SO, for the adventurous, come give it a try!


Title: Re: Java Electrum Server - jelectrum
Post by: JWU42 on August 29, 2015, 07:50:11 PM

I think we are looking at about a ~2-3 day sync for the entire blockchain, assuming SSD and a few CPU cores.


In less than 20 hours I am currently at block 313,000 and at the Block rate of 1.25+/s it should be complete in another 14-16 hours.

Code:
AMD FX-6100
12GB RAM
DB on 4x120GB SSD Raid0


Title: Re: Java Electrum Server - jelectrum
Post by: AussieHash on September 02, 2015, 06:18:42 AM
Just to advise...  running the jelectrum server  ...
1.  The leveldb database is roughly 130GB
2.  The amount of RAM needed on the server (and this could be tweaked more going forward I assume) is ideally 12+ GB

Darn -- for ultimate privacy I was hoping to run it on either a 1GB RAM Odroid C1 or a 2GB RAM Odroid XU4 with cloudshell (http://www.hardkernel.com/main/products/prdt_info.php?g_code=G143599699669)


Title: Re: Java Electrum Server - jelectrum
Post by: JWU42 on September 02, 2015, 10:17:27 AM
Just to advise...  running the jelectrum server  ...
1.  The leveldb database is roughly 130GB
2.  The amount of RAM needed on the server (and this could be tweaked more going forward I assume) is ideally 12+ GB

Darn -- for ultimate privacy I was hoping to run it on either a 1GB RAM Odroid C1 or a 2GB RAM Odroid XU4 with cloudshell (http://www.hardkernel.com/main/products/prdt_info.php?g_code=G143599699669)

Fireduck might be able to tune a version for much lower memory usage - not sure...


Title: Re: Java Electrum Server - jelectrum
Post by: JWU42 on September 03, 2015, 11:56:50 PM
Finally have a working LevelDB database that I can host if anyone prefers to download it versus building from scratch.

It is currently 130GB though it can be compressed to less than 100GB with LRzip I assume.

PM me if interested...



EDIT - Just about 100GB in a 7-zip file...


Title: Re: Java Electrum Server - jelectrum
Post by: fydel on January 21, 2016, 06:00:59 PM
Great project. Keep up the good work, fireduck!


Title: Re: Java Electrum Server - jelectrum
Post by: fireduck on January 21, 2016, 06:18:09 PM
Great project. Keep up the good work, fireduck!

Thanks!  I'm seeing a few more jelectrum servers running, which is great.


Title: Re: Java Electrum Server - jelectrum
Post by: MusX on August 28, 2016, 09:52:29 PM
any chance to have dockerfile included in the project for easier deployment?


Title: Re: Java Electrum Server - jelectrum
Post by: fireduck on August 28, 2016, 10:27:58 PM
any chance to have dockerfile included in the project for easier deployment?

Maybe.  Can you school me?  Lets assume I'm familiar with cloud hosting servers (EC2, GCE) but have never messed with docker.  Is it possible to get persistent SSD with that?  (Or some persistent storage.  An electrum server can't just run, it needs a pretty big database that takes a while to build or download.


Title: Re: Java Electrum Server - jelectrum
Post by: MusX on August 29, 2016, 04:00:30 PM
any chance to have dockerfile included in the project for easier deployment?

Maybe.  Can you school me?  Lets assume I'm familiar with cloud hosting servers (EC2, GCE) but have never messed with docker.  Is it possible to get persistent SSD with that?  (Or some persistent storage.  An electrum server can't just run, it needs a pretty big database that takes a while to build or download.
Any persistent storage like database or wallet information would be stored in a volume (dir on host machine) that user defines while calling `docker run jelectrum --volume /home/user/electrumdb:/var/... --volume /home/user/electrumwallet:/var/...`, this isolates data from the application. Aside from that you need to write plaintext dockerfile which is basically a set of shell commands that produces environment ready to operate. Important that then need to be non-prompt commands. You don't need to start from scratch, using `FROM java...` will use build your docker image on top of another one. Good examples here: https://github.com/dockerfile/java At the end you need expose expected ports and start your app, ensure it won't be closed because when that process closes, the docker image will stop.