Skip to content

Commit

Permalink
Merge branch 'master' of github.com:forrestv/p2pool
Browse files Browse the repository at this point in the history
  • Loading branch information
forrestv committed Jun 20, 2014
2 parents 9a73260 + 7f21bdc commit 17082a6
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 2 deletions.
21 changes: 21 additions & 0 deletions p2pool/bitcoin/networks.py
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,27 @@ def check_genesis_block(bitcoind, genesis_block_hash):
DUMB_SCRYPT_DIFF=1,
DUST_THRESHOLD=1e8,
),
fastcoin=math.Object(
P2P_PREFIX='fbc0b6db'.decode('hex'),
P2P_PORT=9526,
ADDRESS_VERSION=96,
RPC_PORT=9527,
RPC_CHECK=defer.inlineCallbacks(lambda bitcoind: defer.returnValue(
'fastcoinaddress' in (yield bitcoind.rpc_help()) and
not (yield bitcoind.rpc_getinfo())['testnet']
)),
SUBSIDY_FUNC=lambda height: 32*100000000 >> (height + 1)//2592000,
POW_FUNC=lambda data: pack.IntType(256).unpack(__import__('ltc_scrypt').getPoWHash(data)),
BLOCK_PERIOD=12, # s
SYMBOL='FST',
CONF_FILE_FUNC=lambda: os.path.join(os.path.join(os.environ['APPDATA'], 'Fastcoin') if platform.system() == 'Windows' else os.path.expanduser('~/Library/Application Support/Fastcoin/') if platform.system() == 'Darwin' else os.path.expanduser('~/.fastcoin'), 'fastcoin.conf'),
BLOCK_EXPLORER_URL_PREFIX='http://fst.webboise.com/block/',
ADDRESS_EXPLORER_URL_PREFIX='http://fst.webboise.com/address/',
TX_EXPLORER_URL_PREFIX='http://fst.webboise.com/tx/',
SANE_TARGET_RANGE=(2**256//100000000 - 1, 2**256//1000 - 1),
DUMB_SCRYPT_DIFF=2**16,
DUST_THRESHOLD=0.03e8,
),

)
for net_name, net in nets.iteritems():
Expand Down
6 changes: 4 additions & 2 deletions p2pool/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -426,6 +426,9 @@ def run():
type=float, action='store', default=0, dest='worker_fee')

bitcoind_group = parser.add_argument_group('bitcoind interface')
bitcoind_group.add_argument('--bitcoind-config-path', metavar='BITCOIND_CONFIG_PATH',
help='custom configuration file path (when bitcoind -conf option used)',
type=str, action='store', default=None, dest='bitcoind_config_path')
bitcoind_group.add_argument('--bitcoind-address', metavar='BITCOIND_ADDRESS',
help='connect to this address (default: 127.0.0.1)',
type=str, action='store', default='127.0.0.1', dest='bitcoind_address')
Expand All @@ -438,7 +441,6 @@ def run():
bitcoind_group.add_argument('--bitcoind-p2p-port', metavar='BITCOIND_P2P_PORT',
help='''connect to P2P interface at this port (default: %s <read from bitcoin.conf if password not provided>)''' % ', '.join('%s:%i' % (name, net.PARENT.P2P_PORT) for name, net in sorted(realnets.items())),
type=int, action='store', default=None, dest='bitcoind_p2p_port')

bitcoind_group.add_argument(metavar='BITCOIND_RPCUSERPASS',
help='bitcoind RPC interface username, then password, space-separated (only one being provided will cause the username to default to being empty, and none will cause P2Pool to read them from bitcoin.conf)',
type=str, action='store', default=[], nargs='*', dest='bitcoind_rpc_userpass')
Expand All @@ -463,7 +465,7 @@ def run():
args.bitcoind_rpc_username, args.bitcoind_rpc_password = ([None, None] + args.bitcoind_rpc_userpass)[-2:]

if args.bitcoind_rpc_password is None:
conf_path = net.PARENT.CONF_FILE_FUNC()
conf_path = args.bitcoind_config_path or net.PARENT.CONF_FILE_FUNC()
if not os.path.exists(conf_path):
parser.error('''Bitcoin configuration file not found. Manually enter your RPC password.\r\n'''
'''If you actually haven't created a configuration file, you should create one at %s with the text:\r\n'''
Expand Down
21 changes: 21 additions & 0 deletions p2pool/networks.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,27 @@
VERSION_CHECK=lambda v: True,
VERSION_WARNING=lambda v: 'Upgrade Terracoin to >= 0.8.0.1!' if v < 80001 else None,
),
fastcoin=math.Object(
PARENT=networks.nets['fastcoin'],
SHARE_PERIOD=6, # seconds
NEW_SHARE_PERIOD=6, # seconds
CHAIN_LENGTH=24*60*60//10, # shares
REAL_CHAIN_LENGTH=24*60*60//10, # shares
TARGET_LOOKBEHIND=60, # shares
SPREAD=150, # blocks
NEW_SPREAD=150, # blocks
IDENTIFIER='9f2e390aa41ffade'.decode('hex'),
PREFIX='50f713ab040dfade'.decode('hex'),
P2P_PORT=23660,
MIN_TARGET=0,
MAX_TARGET=2**256//2**20 - 1,
PERSIST=True,
WORKER_PORT=5150,
BOOTSTRAP_ADDRS='fst.inetrader.com'.split(' '),
ANNOUNCE_CHANNEL='#p2pool-fst',
VERSION_CHECK=lambda v: True,
VERSION_WARNING=lambda v: 'Upgrade Fastcoin to >= 0.8.5.1!' if v < 70002 else None,
),

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

0 comments on commit 17082a6

Please sign in to comment.