@@ -82,7 +82,7 @@ def main(args, net, datadir_path, merged_urls, worker_endpoint):
8282 def connect_p2p ():
8383 # connect to dashd over dash-p2p
8484 print '''Testing dashd P2P connection to '%s:%s'...''' % (args .dashd_address , args .dashd_p2p_port )
85- factory = dash_p2p .ClientFactory (net .PARENT )
85+ factory = dash_p2p .ClientFactory (net .PARENT , args . devnet )
8686 reactor .connectTCP (args .dashd_address , args .dashd_p2p_port , factory )
8787 def long ():
8888 print ''' ...taking a while. Common reasons for this include all of dashd's connection slots being used...'''
@@ -93,7 +93,7 @@ def long():
9393 print
9494 defer .returnValue (factory )
9595
96- if args .testnet : # establish p2p connection first if testnet so dashd can work without connections
96+ if args .testnet or args . devnet is not None : # establish p2p connection first if testnet or devnet so dashd can work without connections
9797 factory = yield connect_p2p ()
9898
9999 # connect to dashd over JSON-RPC and do initial getmemorypool
@@ -115,7 +115,7 @@ def poll_warnings():
115115 print ' Current block height: %i' % (temp_work ['height' ] - 1 ,)
116116 print
117117
118- if not args .testnet :
118+ if not args .testnet and args . devnet is None :
119119 factory = yield connect_p2p ()
120120
121121 print 'Determining payout address...'
@@ -482,7 +482,7 @@ def run():
482482 print 'Pausing for 3 seconds...'
483483 time .sleep (3 )
484484
485- realnets = dict ((name , net ) for name , net in networks .nets .iteritems () if '_testnet' not in name )
485+ realnets = dict ((name , net ) for name , net in networks .nets .iteritems () if ( '_testnet' not in name and '_devnet' not in name ) )
486486
487487 parser = fixargparse .FixedArgumentParser (description = 'p2pool (version %s)' % (p2pool .__version__ ,), fromfile_prefix_chars = '@' )
488488 parser .add_argument ('--version' , action = 'version' , version = p2pool .__version__ )
@@ -492,6 +492,9 @@ def run():
492492 parser .add_argument ('--testnet' ,
493493 help = '''use the network's testnet''' ,
494494 action = 'store_const' , const = True , default = False , dest = 'testnet' )
495+ parser .add_argument ('--devnet' ,
496+ help = '''use the network's devnet''' ,
497+ type = str , action = 'store' , default = None , dest = 'devnet' )
495498 parser .add_argument ('--debug' ,
496499 help = 'enable debugging mode' ,
497500 action = 'store_const' , const = True , default = False , dest = 'debug' )
@@ -589,7 +592,7 @@ def run():
589592 else :
590593 p2pool .DEBUG = False
591594
592- net_name = args .net_name + ('_testnet' if args .testnet else '' )
595+ net_name = args .net_name + ('_testnet' if args .testnet else '' ) + ( '_devnet' if args . devnet is not None else '' )
593596 net = networks .nets [net_name ]
594597
595598 datadir_path = os .path .join ((os .path .join (os .path .dirname (sys .argv [0 ]), 'data' ) if args .datadir is None else args .datadir ), net_name )
0 commit comments