Browse Source

Support for Minexcoin (#529)

patch-2
joesixpack 7 years ago
committed by Neil Booth
parent
commit
83732af4fe
  1. 2
      docs/changelog.rst
  2. 49
      electrumx/lib/coins.py
  3. 26
      tests/blocks/minexcoin_mainnet_170999.json

2
docs/changelog.rst

@ -17,7 +17,7 @@ Version 1.6.1 (in progress)
* cleaner mempool and notification handling
* aiohttp min version requirement raised to 2.0
* onion peers are ignored if no tor proxy is available
* add Motion coin (ocruzv)
* add Motion coin (ocruzv), MinexCoin (joesixpack)
Version 1.6 (19 July 2018)
===========================

49
electrumx/lib/coins.py

@ -1923,3 +1923,52 @@ class Monoeci(Coin):
'''Given a header return the hash.'''
import x11_hash
return x11_hash.getPoWHash(header)
class MinexcoinMixin(object):
STATIC_BLOCK_HEADERS = True
BASIC_HEADER_SIZE = 209
DESERIALIZER = lib_tx.DeserializerEquihash
@classmethod
def electrum_header(cls, header, height):
version, = struct.unpack('<I', header[:4])
timestamp, bits = struct.unpack('<II', header[100:108])
return {
'block_height': height,
'version': version,
'prev_block_hash': hash_to_hex_str(header[4:36]),
'merkle_root': hash_to_hex_str(header[36:68]),
'timestamp': timestamp,
'bits': bits,
'nonce': hash_to_hex_str(header[108:140]),
'solution': hash_to_hex_str(header[140:209]),
}
@classmethod
def block_header(cls, block, height):
'''Return the block header bytes'''
deserializer = cls.DESERIALIZER(block)
return deserializer.read_header(height, 140)
class Minexcoin(MinexcoinMixin, Coin):
NAME = "Minexcoin"
SHORTNAME = "MNX"
NET = "mainnet"
P2PKH_VERBYTE = bytes.fromhex("4b")
P2SH_VERBYTES = [bytes.fromhex("05")]
WIF_BYTE = bytes.fromhex("80")
GENESIS_HASH = ('490a36d9451a55ed197e34aca7414b35'
'd775baa4a8e896f1c577f65ce2d214cb')
DESERIALIZER = lib_tx.DeserializerEquihash
TX_COUNT = 327963
TX_COUNT_HEIGHT = 74495
TX_PER_BLOCK = 5
RPC_PORT = 8022
CHUNK_SIZE = 960
PEERS = [
'elex01-ams.turinex.eu s t',
'eu.minexpool.nl s t'
]

26
tests/blocks/minexcoin_mainnet_170999.json

File diff suppressed because one or more lines are too long
Loading…
Cancel
Save