#NEWLINE# @ pyethapp_app . app . command ( help = 'run multiple nodes in a zero config default configuration' ) #NEWLINE# @ click . option ( 'num_validators' , '--num_validators' , '-v' , multiple = False , type = int , default = 3 , help = 'number of validators' ) #NEWLINE# @ click . option ( 'seed' , '--seed' , '-s' , multiple = False , type = int , default = 42 , help = 'the seed' ) #NEWLINE# @ click . pass_context #NEWLINE# def runmultiple( ctx , num_validators , seed ) : #NEWLINE# #INDENT# gevent . get_hub ( ) . SYSTEM_ERROR = BaseException #NEWLINE# base_port = 29870 #NEWLINE# PBKDF2_CONSTANTS [ 'c' ] = 100 #NEWLINE# config = ctx . obj [ 'config' ] #NEWLINE# config [ 'discovery' ] [ 'bootstrap_nodes' ] = [ get_bootstrap_node ( seed , base_port ) ] #NEWLINE# apps = [ ] #NEWLINE# for node_num in range ( num_validators ) : #NEWLINE# #INDENT# n_config = copy . deepcopy ( config ) #NEWLINE# ( n_config , account ) = _configure_node_network ( n_config , num_validators , node_num , seed ) #NEWLINE# n_config [ 'discovery' ] [ 'listen_port' ] = ( base_port + node_num ) #NEWLINE# n_config [ 'p2p' ] [ 'listen_port' ] = ( base_port + node_num ) #NEWLINE# n_config [ 'p2p' ] [ 'min_peers' ] = min ( 10 , ( num_validators - 1 ) ) #NEWLINE# n_config [ 'p2p' ] [ 'max_peers' ] = ( num_validators * 2 ) #NEWLINE# n_config [ 'jsonrpc' ] [ 'listen_port' ] += node_num #NEWLINE# n_config [ 'client_version_string' ] = 'NODE{}' . format ( node_num ) #NEWLINE# n_config [ 'data_dir' ] = os . path . join ( n_config [ 'data_dir' ] , str ( node_num ) ) #NEWLINE# konfig . setup_data_dir ( n_config [ 'data_dir' ] ) #NEWLINE# if ( node_num != 0 ) : #NEWLINE# #INDENT# n_config [ 'deactivated_services' ] . append ( Console . name ) #NEWLINE# #UNINDENT# app = start_app ( n_config , [ account ] ) #NEWLINE# apps . append ( app ) #NEWLINE# app . apps = apps #NEWLINE# #UNINDENT# serve_until_stopped ( * apps )