Skip to content

Commit a402582

Browse files
authored
Merge pull request #343 from raiden-network/fix-arb
Fix problems for Arbitrum deployments
2 parents 906dfc2 + 972e9bb commit a402582

3 files changed

Lines changed: 11 additions & 18 deletions

File tree

backend/metrics_backend/metrics_cli.py

Lines changed: 9 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,6 @@
3838
TEMP_FILE = 'tmp.json'
3939
OUTPUT_PERIOD = 10 # seconds
4040
REQUIRED_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
)
9691
def 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

backend/requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
raiden-common == 0.1.3
1+
raiden-common == 0.1.4
22

33
Click
44

docker-compose.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ services:
2424
environment:
2525
- EXPLORER_ETH_RPC=http://1.geth.mainnet.ethnodes.brainbot.com:8545
2626
- EXPLORER_CONFIRMATIONS=5
27+
- EXPLORER_CONTRACTS_VERSION=0.37.0
2728
labels:
2829
- "traefik.enable=true"
2930
- "traefik.frontend.rule=Host:explorer.raiden.network; Path: /json"
@@ -50,7 +51,6 @@ services:
5051
restart: always
5152
environment:
5253
- EXPLORER_ETH_RPC=https://arb1.arbitrum.io/rpc
53-
- EXPLORER_ENVIRONMENT=development
5454
labels:
5555
- "traefik.enable=true"
5656
- "traefik.frontend.rule=Host:arbitrum-one.explorer.raiden.network; Path: /json"
@@ -103,7 +103,6 @@ services:
103103
restart: always
104104
environment:
105105
- EXPLORER_ETH_RPC=https://rinkeby.arbitrum.io/rpc
106-
- EXPLORER_ENVIRONMENT=development
107106
labels:
108107
- "traefik.enable=true"
109108
- "traefik.frontend.rule=Host:rinkarby.explorer.raiden.network; Path: /json"

0 commit comments

Comments
 (0)