Merge pull request #18 from thelazier/dash

Update for DASH
This commit is contained in:
Neil 2016-11-13 11:55:47 +09:00 committed by GitHub
commit a1247e1bcd
3 changed files with 24 additions and 5 deletions

View File

@ -14,7 +14,8 @@ small - patches welcome.
+ irc: Python IRC package. Only required if you enable IRC; ElectrumX + irc: Python IRC package. Only required if you enable IRC; ElectrumX
will happily serve clients that try to connect directly. will happily serve clients that try to connect directly.
I use 15.0.4 but older versions likely are fine. I use 15.0.4 but older versions likely are fine.
+ x11_hash: Python X11 Hash package. Only required if you use ElectrumX
with Dash Network (Both Mainnet and Testnet). Version == 1.4 ;
While not requirements for running ElectrumX, it is intended to be run While not requirements for running ElectrumX, it is intended to be run
with supervisor software such as Daniel Bernstein's daemontools, with supervisor software such as Daniel Bernstein's daemontools,

View File

@ -307,24 +307,41 @@ class DogecoinTestnet(Coin):
WIF_BYTE = 0xf1 WIF_BYTE = 0xf1
# Source: pycoin # Source: https://github.com/dashpay/dash
class Dash(Coin): class Dash(Coin):
NAME = "Dash" NAME = "Dash"
SHORTNAME = "DASH" SHORTNAME = "DASH"
NET = "mainnet" NET = "mainnet"
XPUB_VERBYTES = bytes.fromhex("02fe52cc") XPUB_VERBYTES = bytes.fromhex("02fe52cc")
XPRV_VERBYTES = bytes.fromhex("02fe52f8") XPRV_VERBYTES = bytes.fromhex("02fe52f8")
GENESIS_HASH = (b'00000ffd590b1485b3caadc19b22e637'
b'9c733355108f107a430458cdf3407ab6')
P2PKH_VERBYTE = 0x4c P2PKH_VERBYTE = 0x4c
P2SH_VERBYTE = 0x10 P2SH_VERBYTE = 0x10
WIF_BYTE = 0xcc WIF_BYTE = 0xcc
TX_COUNT_HEIGHT = 569399
TX_COUNT = 2157510
TX_PER_BLOCK = 4
@classmethod
def header_hashes(cls, header):
'''Given a header return the previous and current block hashes.'''
import x11_hash
return header[4:36], x11_hash.getPoWHash(header)
class DashTestnet(Coin): class DashTestnet(Dash):
NAME = "Dogecoin" NAME = "Dash"
SHORTNAME = "tDASH" SHORTNAME = "tDASH"
NET = "testnet" NET = "testnet"
XPUB_VERBYTES = bytes.fromhex("3a805837") XPUB_VERBYTES = bytes.fromhex("3a805837")
XPRV_VERBYTES = bytes.fromhex("3a8061a0") XPRV_VERBYTES = bytes.fromhex("3a8061a0")
P2PKH_VERBYTE = 0x8b GENESIS_HASH = (b'00000bafbc94add76cb75e2ec9289483'
b'7288a481e5c005f6563d91623bf8bc2c')
P2PKH_VERBYTE = 0x8c
P2SH_VERBYTE = 0x13 P2SH_VERBYTE = 0x13
WIF_BYTE = 0xef WIF_BYTE = 0xef
TX_COUNT_HEIGHT = 101619
TX_COUNT = 132681
TX_PER_BLOCK = 1
#

View File

@ -9,6 +9,7 @@ setuptools.setup(
python_requires='>=3.5', python_requires='>=3.5',
# "irc" package is only required if IRC connectivity is enabled # "irc" package is only required if IRC connectivity is enabled
# via environment variables, in which case I've tested with 15.0.4 # via environment variables, in which case I've tested with 15.0.4
# "x11_hash" package (1.4) is required to sync DASH network.
install_requires=['plyvel', 'aiohttp >= 1'], install_requires=['plyvel', 'aiohttp >= 1'],
packages=setuptools.find_packages(), packages=setuptools.find_packages(),
description='ElectrumX Server', description='ElectrumX Server',