From c7a65fc9b0286c67515a354b25b0c7647c0bc188 Mon Sep 17 00:00:00 2001 From: Jose Luis Estevez Date: Tue, 5 Mar 2019 05:05:22 +0100 Subject: [PATCH] Add Onixcoin (ONIX) (#747) * Add Onixcoin (ONIX) --- electrumx/lib/coins.py | 27 +++++++++++++++++++++++ tests/blocks/onixcoin_mainnet_300000.json | 18 +++++++++++++++ 2 files changed, 45 insertions(+) create mode 100644 tests/blocks/onixcoin_mainnet_300000.json diff --git a/electrumx/lib/coins.py b/electrumx/lib/coins.py index 3e698a6..a3aaae7 100644 --- a/electrumx/lib/coins.py +++ b/electrumx/lib/coins.py @@ -2854,3 +2854,30 @@ class RavencoinTestnet(Ravencoin): PEERS = [ 'rvn.satoshi.org.uk s t' ] + + +class Onixcoin(Coin): + NAME = "Onixcoin" + SHORTNAME = "ONX" + NET = "mainnet" + XPUB_VERBYTES = bytes.fromhex("0488B21E") + XPRV_VERBYTES = bytes.fromhex("0488ADE4") + P2PKH_VERBYTE = bytes.fromhex("4B") + P2SH_VERBYTES = [bytes.fromhex("05")] + WIF_BYTE = bytes.fromhex("80") + GENESIS_HASH = ('000007140b7a6ca0b64965824f5731f6' + 'e86daadf19eb299033530b1e61236e43') + TX_COUNT = 431808 + TX_COUNT_HEIGHT = 321132 + TX_PER_BLOCK = 10 + RPC_PORT = 41019 + REORG_LIMIT = 800 + PEERS = [] + SESSIONCLS = DashElectrumX + DAEMON = daemon.DashDaemon + + @classmethod + def header_hash(cls, header): + '''Given a header return the hash.''' + import x11_hash + return x11_hash.getPoWHash(header) diff --git a/tests/blocks/onixcoin_mainnet_300000.json b/tests/blocks/onixcoin_mainnet_300000.json new file mode 100644 index 0000000..e4dcfc4 --- /dev/null +++ b/tests/blocks/onixcoin_mainnet_300000.json @@ -0,0 +1,18 @@ +{ + "hash": "00000000000502760fe120b5be6f315513af417cd7942ce4f760399d7fe37707", + "confirmations": 17763, + "size": 212, + "height": 300000, + "version": 2, + "merkleroot": "83587626c5485313158092719facfa72ae1c2a65d9666ad1ab31b2545d496d10", + "tx": [ + "83587626c5485313158092719facfa72ae1c2a65d9666ad1ab31b2545d496d10" + ], + "time": 1547896171, + "nonce": 1025707132, + "bits": "1b057450", + "difficulty": 12015.1900094, + "previousblockhash": "000000000003f3b11ace3464840836fc361ac91bad3ef9395024cf4c846cad2d", + "nextblockhash": "0000000000045d9259a114088079b005518bb23a72a2f2802348ddb382726459", + "block": "020000002dad6c844ccf245039f93ead1bc91a36fc3608846434ce1ab1f3030000000000106d495d54b231abd16a66d9652a1cae72faac9f71928015135348c5267658836b05435c5074051b7c0c233d0101000000010000000000000000000000000000000000000000000000000000000000000000ffffffff2e03e09304062f503253482f049805435c08581eb2a333010000142f70726f68617368696e672e636f6d5a0307002f000000000100bca065010000001976a9149f7932e1c8fcef3251869121da7351921e7671dc88ac00000000" + }