Skip to content
This repository was archived by the owner on Dec 25, 2022. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions altcoin/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
# LICENSE file.

from altcoin.core import CoreDogeMainParams, CoreDogeTestNetParams, _SelectCoreParams
from altcoin.core import CoreMonaMainParams, CoreMonaTestNetParams
from altcoin.core import CoreLtcMainParams, CoreLtcTestNetParams
from bitcoin.core import b2lx
import bitcoin
Expand Down Expand Up @@ -93,6 +94,33 @@ class DogeTestNetParams(CoreDogeTestNetParams):
'SCRIPT_ADDR':196,
'SECRET_KEY' :241}

# Monacoin main/testnet information
#
# See
# https://github.com/dogecoin/dogecoin/blob/1.8-maint/src/chainparams.cpp

class MonaMainParams(CoreMonaMainParams):
MESSAGE_START = b'\xfb\xc0\xb6\xdb'
DEFAULT_PORT = 9401
RPC_PORT = 9402
DNS_SEEDS = (('monacoin.org', 'seed.monacoin.org'))
BASE58_PREFIXES = {'PUBKEY_ADDR':50,
'SCRIPT_ADDR':5,
'SCRIPT_ADDR2':55,
'SECRET_KEY' :176,
'OLD_SECRET_KEY' :178}

class MonaTestNetParams(CoreMonaTestNetParams):
MESSAGE_START = b'\xfb\xd2\xc8\xf1'
DEFAULT_PORT = 19403
RPC_PORT = 19402
DNS_SEEDS = (('monacoin.org', 'testnet-dnsseed.monacoin.org'))
BASE58_PREFIXES = {'PUBKEY_ADDR':111,
'SCRIPT_ADDR':196,
'SCRIPT_ADDR2':117,
'SECRET_KEY' :239,
'OLD_SECRET_KEY' :239}

available_params = {}

def SelectParams(genesis_block_hash):
Expand All @@ -115,6 +143,8 @@ def SelectParams(genesis_block_hash):
bitcoin.TestNetParams(),
DogeMainParams(),
DogeTestNetParams(),
MonaMainParams(),
MonaTestNetParams(),
LtcMainParams(),
LtcTestNetParams()
]:
Expand All @@ -124,6 +154,8 @@ def SelectParams(genesis_block_hash):
__all__ = (
'LtcMainParams',
'LtcTestNetParams',
'MonaMainParams',
'MonaTestNetParams',
'DogeMainParams',
'DogeTestNetParams',
'SelectParams',
Expand Down
17 changes: 17 additions & 0 deletions altcoin/core/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,18 @@ def GetHash(self):
return _cached_GetHash


class CoreMonaMainParams(bitcoin.core.CoreChainParams):
NAME = 'monacoin_main'
GENESIS_BLOCK = CAltcoinBlock.deserialize(x('010000000000000000000000000000000000000000000000000000000000000000000000a64bac07fe31877f31d03252953b3c32398933af7a724119bc4d6fa4a805e435f083c252f0ff0f1e66d612000101000000010000000000000000000000000000000000000000000000000000000000000000ffffffff5f04ffff001d01044c564465632e20333174682032303133204a6170616e2c205468652077696e6e696e67206e756d62657273206f6620746865203230313320596561722d456e64204a756d626f204c6f74746572793a32332d313330393136ffffffff0100f2052a010000004341040184710fa689ad5023690c80f3a49c8f13f8d45b8c857fbcbc8bc4a8e4d3eb4b10f4d4604fa08dce601aaf0f470216fe1b51850b4acf21b179c45070ac7b03a9ac00000000'))
SUBSIDY_HALVING_INTERVAL = 1051200
PROOF_OF_WORK_LIMIT = 2**256-1 >> 20


class CoreMonaTestNetParams(CoreMonaMainParams):
NAME = 'monacoin_test'
GENESIS_BLOCK = CAltcoinBlock.deserialize(x('010000000000000000000000000000000000000000000000000000000000000000000000a64bac07fe31877f31d03252953b3c32398933af7a724119bc4d6fa4a805e435f083c252f0ff0f1e66d612000101000000010000000000000000000000000000000000000000000000000000000000000000ffffffff5f04ffff001d01044c564465632e20333174682032303133204a6170616e2c205468652077696e6e696e67206e756d62657273206f6620746865203230313320596561722d456e64204a756d626f204c6f74746572793a32332d313330393136ffffffff0100f2052a010000004341040184710fa689ad5023690c80f3a49c8f13f8d45b8c857fbcbc8bc4a8e4d3eb4b10f4d4604fa08dce601aaf0f470216fe1b51850b4acf21b179c45070ac7b03a9ac00000000'))


class CoreDogeMainParams(bitcoin.core.CoreChainParams):
NAME = 'dogecoin_main'
GENESIS_BLOCK = CAltcoinBlock.deserialize(x('010000000000000000000000000000000000000000000000000000000000000000000000696ad20e2dd4365c7459b4a4a5af743d5e92c6da3229e6532cd605f6533f2a5b24a6a152f0ff0f1e678601000101000000010000000000000000000000000000000000000000000000000000000000000000ffffffff1004ffff001d0104084e696e746f6e646fffffffff010058850c020000004341040184710fa689ad5023690c80f3a49c8f13f8d45b8c857fbcbc8bc4a8e4d3eb4b10f4d4604fa08dce601aaf0f470216fe1b51850b4acf21b179c45070ac7b03a9ac00000000'))
Expand All @@ -244,6 +256,7 @@ class CoreDogeMainParams(bitcoin.core.CoreChainParams):

class CoreDogeTestNetParams(CoreDogeMainParams):
NAME = 'dogecoin_test'
GENESIS_BLOCK = CAltcoinBlock.deserialize(x('010000000000000000000000000000000000000000000000000000000000000000000000696ad20e2dd4365c7459b4a4a5af743d5e92c6da3229e6532cd605f6533f2a5b24a6a152f0ff0f1e678601000101000000010000000000000000000000000000000000000000000000000000000000000000ffffffff1004ffff001d0104084e696e746f6e646fffffffff010058850c020000004341040184710fa689ad5023690c80f3a49c8f13f8d45b8c857fbcbc8bc4a8e4d3eb4b10f4d4604fa08dce601aaf0f470216fe1b51850b4acf21b179c45070ac7b03a9ac00000000'))
GENESIS_BLOCK = CAltcoinBlock.deserialize(x('010000000000000000000000000000000000000000000000000000000000000000000000696ad20e2dd4365c7459b4a4a5af743d5e92c6da3229e6532cd605f6533f2a5bb9a7f052f0ff0f1ef7390f000101000000010000000000000000000000000000000000000000000000000000000000000000ffffffff1004ffff001d0104084e696e746f6e646fffffffff010058850c020000004341040184710fa689ad5023690c80f3a49c8f13f8d45b8c857fbcbc8bc4a8e4d3eb4b10f4d4604fa08dce601aaf0f470216fe1b51850b4acf21b179c45070ac7b03a9ac00000000'))


Expand Down Expand Up @@ -281,6 +294,8 @@ def _SelectCoreParams(genesis_block_hash):
bitcoin.core.CoreRegTestParams(),
CoreLtcMainParams(),
CoreLtcTestNetParams(),
CoreMonaMainParams(),
CoreMonaTestNetParams(),
CoreDogeMainParams(),
CoreDogeTestNetParams()
]:
Expand All @@ -293,6 +308,8 @@ def _SelectCoreParams(genesis_block_hash):
'CAltcoinBlock',
'CoreDogeMainParams',
'CoreDogeTestNetParams',
'CoreMonaMainParams',
'CoreMonaTestNetParams',
'CoreLtcMainParams',
'CoreLtcTestNetParams',
'_SelectCoreParams',
Expand Down