3838TEMP_FILE = 'tmp.json'
3939OUTPUT_PERIOD = 10 # seconds
4040REQUIRED_CONFIRMATIONS = 5
41- PRODUCTION_CONTRACTS_VERSION = '0.37.0'
42- DEMOENV_CONTRACTS_VERSION = '0.37.0'
4341
4442
4543@contextlib .contextmanager
@@ -85,21 +83,18 @@ def no_ssl_verification():
8583 help = 'Number of block confirmations to wait for'
8684)
8785@click .option (
88- '--environment' ,
89- default = 'production' ,
90- type = click .Choice (['production' , 'development' , 'demo' ], case_sensitive = False ),
91- help = (
92- 'Change the version of the used contracts and transport server '
93- 'by setting the environment to "production" (default), "development" or "demo"'
94- )
86+ '--contracts-version' ,
87+ default = None ,
88+ type = str ,
89+ help = 'Use addresses for contracts of this version. Default: latest'
9590)
9691def main (
9792 eth_rpc ,
9893 registry_address ,
9994 start_block ,
10095 port ,
10196 confirmations ,
102- environment
97+ contracts_version ,
10398):
10499 # setup logging
105100 logging .basicConfig (
@@ -122,18 +117,17 @@ def main(
122117 )
123118 sys .exit ()
124119
125- if environment == 'production' :
126- contracts_version = PRODUCTION_CONTRACTS_VERSION
127- elif environment == 'demo' :
128- contracts_version = DEMOENV_CONTRACTS_VERSION
129- else :
120+ if contracts_version is None :
130121 contracts_version = CONTRACTS_VERSION
131122 log .info (f'Using contracts version: { contracts_version } ' )
132123
133124 with no_ssl_verification ():
134125 valid_params_given = is_checksum_address (registry_address ) and start_block >= 0
135126 try :
136127 contract_data = get_contracts_deployment_info (web3 .eth .chainId , contracts_version )
128+ if contract_data is None :
129+ log .error (f'No deployment data for chain_id { web3 .eth .chainId } and { contracts_version = } ' )
130+ sys .exit (1 )
137131 service_registry_address = contract_data ['contracts' ][CONTRACT_SERVICE_REGISTRY ]['address' ]
138132 if not valid_params_given :
139133 token_network_registry_info = contract_data ['contracts' ][CONTRACT_TOKEN_NETWORK_REGISTRY ] # noqa
0 commit comments