Electrum Dark

UdjinM6

Official Dash Dev
Core Developer
Dash Core Team
May 20, 2014
3,639
3,537
1,183
That could be it.

Though, looking at Poolers source code for the old version the only time he messed with the POW was for the actual electrum-client and not the server. With litecoin using scrypt instead of sha256 I'd assume if it was needed it would need to be edited in both the server and client.

https://github.com/pooler/electrum-ltc-server/compare/spesmilo:master...master

I'll spend some more time on it.
Hmm.. strange if it works at all... that's what my logic was based on - for example:
This https://github.com/Propulsions/electrum-drk-server/blob/master/src/blockchain_processor.py#L655 uses hash_header I mentioned before and stores last_hash
and then https://github.com/Propulsions/electrum-drk-server/blob/master/src/blockchain_processor.py#L662 uses that last_hash to call "darkcoind getblock <last_hash>"
The last statement will definitely fail if hash_header used sha256d to form last_hash earlier.
 

Propulsion

The buck stops here.
Feb 26, 2014
1,008
468
183
Dash Address
XerHCGryyfZttUc6mnuRY3FNJzU1Jm9u5L
Alright. I've imported the hash function from p2pool. I'm able to start and stop the server with no issues. Once again, I'm rebuilding the full blockchain_headers file from scratch.

The only thing that looks concerning is the coin count:

Bash:
$ ./run_electrum_server
INFO:drkelectrum:Starting Electrum Darkcoin Server on localhost
INFO:drkelectrum:Database version 3
INFO:drkelectrum:Blockchain height 12051
INFO:drkelectrum:UTXO tree root hash: 685ea9fae9c6a4a38efb921b9b405e76280c30fa7c9765d8c7be84a03ca625af
INFO:drkelectrum:Coins in database: 806940910993317
INFO:drkelectrum:catching up missing headers: 12018 12051
INFO:drkelectrum:TCP server started on 127.0.0.1:50011
INFO:drkelectrum:SSL server started on 127.0.0.1:50012
INFO:drkelectrum:catch_up: block 13000 (4.787s 28.705s) d44b4565ad30dd24bf8a822bbed5226c1bdaff61bce12ba9fc32b16a800b5e92
^CINFO:drkelectrum:Stopping Stratum
INFO:drkelectrum:closing database
INFO:drkelectrum:Blockchain is up to date.
INFO:drkelectrum:utxo not in database; postponing mempool update
INFO:drkelectrum:Memory pool initialized.
INFO:drkelectrum:Closing database...
INFO:drkelectrum:Database is closed
INFO:drkelectrum:Electrum Darkcoin Server stopped
Looking above it shows a block height of 12051 with a coins in database of 806 940 910 993 317.(806 trillion) That can't be right it should be 2,924,324.0 DRK
Although, looking at a post on BCT on Electrum,
Block height is 296956 while Coins in database shows 1 267 617 386 701 994 which is absolutely wrong.(over one quadrillion)

Bash:
[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
I'm going to go ahead and create the database. I'm not 100% sure it's a good hash function though at this time.
 

vertoe

Three of Nine
Mar 28, 2014
2,573
1,652
1,283
Unimatrix Zero One
well now you got darkcoin hash, but you also need darkcoin subsidy i guess, this calculates the block value and thus the total coins.
 

Propulsion

The buck stops here.
Feb 26, 2014
1,008
468
183
Dash Address
XerHCGryyfZttUc6mnuRY3FNJzU1Jm9u5L
well now you got darkcoin hash, but you also need darkcoin subsidy i guess, this calculates the block value and thus the total coins.
Isn't this fun?
 
  • Like
Reactions: moli

moli

Grizzled Member
Aug 5, 2014
3,255
1,830
1,183
I wish I could understand all this stuff so I could have fun too!!!
:sad:
 

ELM4ever

Member
Feb 9, 2015
64
66
58
I found the problem with the wrong coinbase reporting on the server. I have a working version, but still want to finish building all the UTXOs before declaring victory - 8 hours more to go...

Will do a pull request to Propulsion's Github account when satisfied.

Working on the client in the meantime. Should be simple.
 
Last edited by a moderator:

ELM4ever

Member
Feb 9, 2015
64
66
58
Finally got the UTXO to build... Got less than 3 DRK difference on coinbase (over 5M DRK) between the UTXO and Chainz block explorer.. interesting... It used to be a perfect match until half way down the blockchain...

Still working on the client... managed to get a transaction to show up in my wallet

More info tomorrow...
 
Last edited by a moderator:

ELM4ever

Member
Feb 9, 2015
64
66
58
It is a known fact that Electrum servers are not rewarded with their work (BTC - LTC - ..._). Sadly...

If Darkcoin wants to have Electrum-drk servers to support the (SPV) Electrum feature - someone will have to support them.

If an Electrum-DRK solution can be found, Darkcoin will have to fund a minimum of 3 servers. Can Darkcoin do that?

To run an Electrum-DRK server would require at least 8GB Ram and 40GB HD - do the math with cloud servers... times 3...
 
Last edited by a moderator:

vertoe

Three of Nine
Mar 28, 2014
2,573
1,652
1,283
Unimatrix Zero One

flare

Administrator
Dash Core Team
Moderator
May 18, 2014
2,286
2,404
1,183
Germany
Yeah that should be no prob. I can contribute at least one of such machines.
Me too, at least two heavy duty machines available. eduffield will bring in another machine for sure which i can manage.

Ok, we need to get some overview, this is what github has to offer currently:

??? who is running this one?
https://github.com/electrum-drk/electrum-drk
https://github.com/electrum-drk/electrum-drk-server
This is me, also owning the domain electrum-drk.org
 

ELM4ever

Member
Feb 9, 2015
64
66
58
More info...

12/02/2015-23:48:16] Starting Electrum-DRK server on localhost
[12/02/2015-23:48:17] Database version 3
[12/02/2015-23:48:17] Blockchain height 219339
[12/02/2015-23:48:17] UTXO tree root hash: 4a025e3b761de3dca93800da53b6f2de1ba8d07cd552b1c550a8b4a31885b7a4
[12/02/2015-23:48:17] Coins in database: 512147687739509
[12/02/2015-23:48:17] TCP server started on 127.0.0.1:50001
[12/02/2015-23:48:17] SSL server started on 127.0.0.1:50002
[12/02/2015-23:48:17] HTTP server started.
[12/02/2015-23:48:17] HTTPS server started.
[12/02/2015-23:48:17] Blockchain is up to date.
[12/02/2015-23:48:17] Memory pool initialized.
[12/02/2015-23:48:17] blockchain: 219339 (0.005s)
[12/02/2015-23:48:17] darkcoind is responding

https://chainz.cryptoid.info/drk/bl...079cad3b8893544959d62e68385120a6b54f378bf.htm

Above: 5121476.87739509
Chainz: 5121479.27859667
 

flare

Administrator
Dash Core Team
Moderator
May 18, 2014
2,286
2,404
1,183
Germany
More info...

12/02/2015-23:48:16] Starting Electrum-DRK server on localhost
[12/02/2015-23:48:17] Database version 3
[12/02/2015-23:48:17] Blockchain height 219339
[12/02/2015-23:48:17] UTXO tree root hash: 4a025e3b761de3dca93800da53b6f2de1ba8d07cd552b1c550a8b4a31885b7a4
[12/02/2015-23:48:17] Coins in database: 512147687739509
[12/02/2015-23:48:17] TCP server started on 127.0.0.1:50001
[12/02/2015-23:48:17] SSL server started on 127.0.0.1:50002
[12/02/2015-23:48:17] HTTP server started.
[12/02/2015-23:48:17] HTTPS server started.
[12/02/2015-23:48:17] Blockchain is up to date.
[12/02/2015-23:48:17] Memory pool initialized.
[12/02/2015-23:48:17] blockchain: 219339 (0.005s)
[12/02/2015-23:48:17] darkcoind is responding

https://chainz.cryptoid.info/drk/bl...079cad3b8893544959d62e68385120a6b54f378bf.htm

Above: 5121476.87739509
Chainz: 5121479.27859667
Nice, will set up one for testnet and one for mainnet then.
 

ELM4ever

Member
Feb 9, 2015
64
66
58
Nice, will set up one for testnet and one for mainnet then.
If you want to run a Server, please ensure that you have the following config in your /etc/electrum-drk.conf folder:

[server]
# username for running the daemon
username = electrum-drk
password = someweirdpassword
#hostname. set it to a FQDN in order to be reached from outside
#report_host = xxx.xxxx.org
host = localhost
# ports
electrum_rpc_port = 8000
stratum_http_port = 8081
stratum_http_ssl_port = 8082
stratum_tcp_port = 50001
stratum_tcp_ssl_port = 50002
#report_host =
#report_stratum_tcp_port = 50001
#report_stratum_tcp_ssl_port = 50002
banner = Welcome to Electrum!
banner_file = /etc/electrum-drk.banner
irc = no
irc_nick = mynickname
ssl_certfile = /home/mypc/electrum/UTXO/server.crt
ssl_keyfile = /home/mypc/electrum/UTXO/server.key
logfile = /home/mypc/electrum/electrum-drk.log
#donation_address =

[leveldb]
# path to your database
path = /home/mypc/electrum/UTXO/DRK/electrum-drk-leveldb-utxo-10000
# for each address, history will be pruned if it is longer than this limit
pruning_limit = 10000

[bitcoind]
bitcoind_host = localhost
bitcoind_port = 9998
# user and password from darkcoin.conf
bitcoind_user =
bitcoind_password =

[network]
type = darkcoin_main
 

ELM4ever

Member
Feb 9, 2015
64
66
58
lets start focussing on testnet. will setup one too.
The server is good, but you still need the client....

... and we have to sort the IRC issue. I initially used #electrum-drk as the logging, with ED_XXX as username - but that is to be agreed with you guys. In the mean time, I set the config to NO IRC....
 
Last edited by a moderator:

TaoOfSatoshi

Grizzled Member
Jul 15, 2014
2,841
2,648
1,183
Dash Nation
www.dashnation.com
Yeah that should be no prob. I can contribute at least one of such machines.
Me too, at least two heavy duty machines available. eduffield will bring in another machine for sure which i can manage.



This is me, also owning the domain electrum-drk.org
I get the feeling that this project is closer to completion than we think!

Godspeed guys, excellent job!

Be sure to ping me when you're done and it will be all over Twitter...
 
  • Like
Reactions: buster

ELM4ever

Member
Feb 9, 2015
64
66
58
The server is working. The client is receiving and sending coins. But block_headers are not being validated by the client. We "just" have to integrate BTC, KGW, and DGW for headers validation... anyone has a shortcut to offer?

EDIT: Just saw darkcoin_subsidy on Github, from Vertoe - I will give it a try.
EDIT2: Not what I need. We could disable validating the target, the daemon at the server is already doing it... Only the block hash would be verified on the server and client side.

EDIT3: That worked! Yes! Darkcoin has a ported Electrum wallet. However, at one point in time, to increase security, it will require the addition of the target validation code.

Let's talk Bounty now! Any offers ? :)
 
Last edited by a moderator: