Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add PandaCoin (PND). #62

Closed
wants to merge 2 commits into from
Closed
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
57 changes: 39 additions & 18 deletions p2pool/bitcoin/networks.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ def check_genesis_block(bitcoind, genesis_block_hash):
SANE_TARGET_RANGE=(2**256//2**32//1000 - 1, 2**256//2**32 - 1),
DUMB_SCRYPT_DIFF=1,
DUST_THRESHOLD=1e8,
),
),
terracoin_testnet=math.Object(
P2P_PREFIX='41babe56'.decode('hex'),
P2P_PORT=23333,
Expand Down Expand Up @@ -526,7 +526,7 @@ def check_genesis_block(bitcoind, genesis_block_hash):
ADDRESS_VERSION=39,
RPC_PORT=8855,
RPC_CHECK=defer.inlineCallbacks(lambda bitcoind: defer.returnValue(
'giftcoinaddress' in (yield bitcoind.rpc_help()) and
'giftcoinaddress' in (yield bitcoind.rpc_help()) and
not (yield bitcoind.rpc_getinfo())['testnet']
)),
SUBSIDY_FUNC=lambda height: 50*100000000,
Expand Down Expand Up @@ -744,8 +744,8 @@ def check_genesis_block(bitcoind, genesis_block_hash):
POW_FUNC=lambda data: pack.IntType(256).unpack(__import__('ltc_scrypt').getPoWHash(data)),
BLOCK_PERIOD=120, # s
SYMBOL='ARG',
CONF_FILE_FUNC=lambda: os.path.join(os.path.join(os.environ['APPDATA'], 'argentum')
if platform.system() == 'Windows' else os.path.expanduser('~/Library/Application Support/Argentum/')
CONF_FILE_FUNC=lambda: os.path.join(os.path.join(os.environ['APPDATA'], 'argentum')
if platform.system() == 'Windows' else os.path.expanduser('~/Library/Application Support/Argentum/')
if platform.system() == 'Darwin' else os.path.expanduser('~/.Argentum'), 'Argentum.conf'),
BLOCK_EXPLORER_URL_PREFIX='http://arg.webboise.com/chain/Argentum/block/',
ADDRESS_EXPLORER_URL_PREFIX='http://arg.webboise.com/chain/Argentum/address/',
Expand All @@ -767,8 +767,8 @@ def check_genesis_block(bitcoind, genesis_block_hash):
POW_FUNC=lambda data: pack.IntType(256).unpack(__import__('ltc_scrypt').getPoWHash(data)),
BLOCK_PERIOD=40, # s
SYMBOL='SMC',
CONF_FILE_FUNC=lambda: os.path.join(os.path.join(os.environ['APPDATA'], 'smartcoin')
if platform.system() == 'Windows' else os.path.expanduser('~/Library/Application Support/smartcoin/')
CONF_FILE_FUNC=lambda: os.path.join(os.path.join(os.environ['APPDATA'], 'smartcoin')
if platform.system() == 'Windows' else os.path.expanduser('~/Library/Application Support/smartcoin/')
if platform.system() == 'Darwin' else os.path.expanduser('~/.smartcoin'), 'smartcoin.conf'),
BLOCK_EXPLORER_URL_PREFIX='http://altexplorer.net/block/',
ADDRESS_EXPLORER_URL_PREFIX='http://altexplorer.net/address/',
Expand All @@ -790,8 +790,8 @@ def check_genesis_block(bitcoind, genesis_block_hash):
POW_FUNC=lambda data: pack.IntType(256).unpack(__import__('ltc_scrypt').getPoWHash(data)),
BLOCK_PERIOD=60, # s
SYMBOL='MEOW',
CONF_FILE_FUNC=lambda: os.path.join(os.path.join(os.environ['APPDATA'], 'kittehcoin')
if platform.system() == 'Windows' else os.path.expanduser('~/Library/Application Support/kittehcoin/')
CONF_FILE_FUNC=lambda: os.path.join(os.path.join(os.environ['APPDATA'], 'kittehcoin')
if platform.system() == 'Windows' else os.path.expanduser('~/Library/Application Support/kittehcoin/')
if platform.system() == 'Darwin' else os.path.expanduser('~/.kittehcoin'), 'kittehcoin.conf'),
BLOCK_EXPLORER_URL_PREFIX='http://kitexplorer.tk/block/',
ADDRESS_EXPLORER_URL_PREFIX='http://kitexplorer.tk/address/',
Expand All @@ -813,8 +813,8 @@ def check_genesis_block(bitcoind, genesis_block_hash):
POW_FUNC=lambda data: pack.IntType(256).unpack(__import__('ltc_scrypt').getPoWHash(data)),
BLOCK_PERIOD=60, # s
SYMBOL='LEAF',
CONF_FILE_FUNC=lambda: os.path.join(os.path.join(os.environ['APPDATA'], 'LeafCoin')
if platform.system() == 'Windows' else os.path.expanduser('~/Library/Application Support/Leafcoin/')
CONF_FILE_FUNC=lambda: os.path.join(os.path.join(os.environ['APPDATA'], 'LeafCoin')
if platform.system() == 'Windows' else os.path.expanduser('~/Library/Application Support/Leafcoin/')
if platform.system() == 'Darwin' else os.path.expanduser('~/.leafcoin'), 'leafcoin.conf'),
BLOCK_EXPLORER_URL_PREFIX='http://explorer2.leafco.in/block/',
ADDRESS_EXPLORER_URL_PREFIX='http://explorer2.leafco.in/address/',
Expand All @@ -836,8 +836,8 @@ def check_genesis_block(bitcoind, genesis_block_hash):
POW_FUNC=lambda data: pack.IntType(256).unpack(__import__('ltc_scrypt').getPoWHash(data)),
BLOCK_PERIOD=200, #seconds
SYMBOL='KRN',
CONF_FILE_FUNC=lambda: os.path.join(os.path.join(os.environ['APPDATA'], 'Ekrona')
if platform.system() == 'Windows' else os.path.expanduser('~/Library/Application Support/ekrona/')
CONF_FILE_FUNC=lambda: os.path.join(os.path.join(os.environ['APPDATA'], 'Ekrona')
if platform.system() == 'Windows' else os.path.expanduser('~/Library/Application Support/ekrona/')
if platform.system() == 'Darwin' else os.path.expanduser('~/.ekrona'), 'ekrona.conf'),
BLOCK_EXPLORER_URL_PREFIX='http://altexplorer.net/block/', #dummy
ADDRESS_EXPLORER_URL_PREFIX='http://altexplorer.net/address/',
Expand Down Expand Up @@ -942,8 +942,8 @@ def check_genesis_block(bitcoind, genesis_block_hash):
POW_FUNC=lambda data: pack.IntType(256).unpack(__import__('ltc_scrypt').getPoWHash(data)),
BLOCK_PERIOD=120, # seconds
SYMBOL='AKC',
CONF_FILE_FUNC=lambda: os.path.join(os.path.join(os.environ['APPDATA'], 'AntiKeiserCoin')
if platform.system() == 'Windows' else os.path.expanduser('~/Library/Application Support/AntiKesierCoin/')
CONF_FILE_FUNC=lambda: os.path.join(os.path.join(os.environ['APPDATA'], 'AntiKeiserCoin')
if platform.system() == 'Windows' else os.path.expanduser('~/Library/Application Support/AntiKesierCoin/')
if platform.system() == 'Darwin' else os.path.expanduser('~/.antikeisercoin'), 'antikeisercoin.conf'),
BLOCK_EXPLORER_URL_PREFIX='http://altexplorer.net/block/',
ADDRESS_EXPLORER_URL_PREFIX='http://altexplorer.net/address/',
Expand All @@ -965,8 +965,8 @@ def check_genesis_block(bitcoind, genesis_block_hash):
POW_FUNC=lambda data: pack.IntType(256).unpack(__import__('ltc_scrypt').getPoWHash(data)),
BLOCK_PERIOD=60, # seconds
SYMBOL='PCC',
CONF_FILE_FUNC=lambda: os.path.join(os.path.join(os.environ['APPDATA'], 'PolishCoin')
if platform.system() == 'Windows' else os.path.expanduser('~/Library/Application Support/PolishCoin/')
CONF_FILE_FUNC=lambda: os.path.join(os.path.join(os.environ['APPDATA'], 'PolishCoin')
if platform.system() == 'Windows' else os.path.expanduser('~/Library/Application Support/PolishCoin/')
if platform.system() == 'Darwin' else os.path.expanduser('~/.polishcoin'), 'polishcoin.conf'),
BLOCK_EXPLORER_URL_PREFIX='http://altexplorer.net/block/',
ADDRESS_EXPLORER_URL_PREFIX='http://altexplorer.net/address/',
Expand All @@ -988,8 +988,8 @@ def check_genesis_block(bitcoind, genesis_block_hash):
POW_FUNC=lambda data: pack.IntType(256).unpack(__import__('ltc_scrypt').getPoWHash(data)),
BLOCK_PERIOD=60, # seconds
SYMBOL='COIN',
CONF_FILE_FUNC=lambda: os.path.join(os.path.join(os.environ['APPDATA'], 'Coin')
if platform.system() == 'Windows' else os.path.expanduser('~/Library/Application Support/Coin/')
CONF_FILE_FUNC=lambda: os.path.join(os.path.join(os.environ['APPDATA'], 'Coin')
if platform.system() == 'Windows' else os.path.expanduser('~/Library/Application Support/Coin/')
if platform.system() == 'Darwin' else os.path.expanduser('~/.Coin'), 'Coin.conf'),
BLOCK_EXPLORER_URL_PREFIX='http://explorer.coin-project.org/block/',
ADDRESS_EXPLORER_URL_PREFIX='http://explorer.coin-project.org/address/',
Expand All @@ -998,6 +998,27 @@ def check_genesis_block(bitcoind, genesis_block_hash):
DUMB_SCRYPT_DIFF=2**16,
DUST_THRESHOLD=0.03e8,
),
pandacoin=math.Object(
P2P_PREFIX='c0c0c0c0'.decode('hex'),
P2P_PORT=22445,
ADDRESS_VERSION=55,
RPC_PORT=22444,
RPC_CHECK=defer.inlineCallbacks(lambda bitcoind: defer.returnValue(
'pandacoinaddress' in (yield bitcoind.rpc_help()) and
not (yield bitcoind.rpc_getinfo())['testnet']
)),
SUBSIDY_FUNC=lambda height: 10000*100000000,
POW_FUNC=lambda data: pack.IntType(256).unpack(__import__('ltc_scrypt').getPoWHash(data)),
BLOCK_PERIOD=60, # s
SYMBOL='PND',
CONF_FILE_FUNC=lambda: os.path.join(os.path.join(os.environ['APPDATA'], 'PandaCoin') if platform.system() == 'Windows' else os.path.expanduser('~/Library/Application Support/PandaCoin/') if platform.system() == 'Darwin' else os.path.expanduser('~/.pandacoin'), 'pandacoin.conf'),
BLOCK_EXPLORER_URL_PREFIX='http://pnd.showed.us/block/',
ADDRESS_EXPLORER_URL_PREFIX='http://pnd.showed.us/address/',
TX_EXPLORER_URL_PREFIX='http://pnd.showed.us/tx/',
SANE_TARGET_RANGE=(2**256//1000000000 - 1, 2**256//1000 - 1),
DUMB_SCRYPT_DIFF=2**16,
DUST_THRESHOLD=0.03e8,
),

)
for net_name, net in nets.iteritems():
Expand Down
18 changes: 18 additions & 0 deletions p2pool/networks.py
Original file line number Diff line number Diff line change
Expand Up @@ -844,6 +844,24 @@
ANNOUNCE_CHANNEL='#p2pool-alt',
VERSION_CHECK=lambda v: True,
),
pandacoin=math.Object(
PARENT=networks.nets['pandacoin'],
SHARE_PERIOD=15, # seconds target spacing
CHAIN_LENGTH=12*60*60//15, # shares
REAL_CHAIN_LENGTH=12*60*60//15, # shares
TARGET_LOOKBEHIND=20, # shares coinbase maturity
SPREAD=10, # blocks
IDENTIFIER='E2B1A3616E64436f696E'.decode('hex'),
PREFIX='E2B1A3616E64436f696E'.decode('hex'),
P2P_PORT=8334,
MIN_TARGET=0,
MAX_TARGET=2**256//2**20 - 1,
PERSIST=True,
WORKER_PORT=9444,
BOOTSTRAP_ADDRS=''.split(' '), # there are none yet
ANNOUNCE_CHANNEL='#p2pool-alt',
VERSION_CHECK=lambda v: True,
),

)
for net_name, net in nets.iteritems():
Expand Down