Skip to content

Commit

Permalink
fixup! [Chore] Fix 'nairobinet' config init
Browse files Browse the repository at this point in the history
  • Loading branch information
DMozhevitin committed Nov 14, 2023
1 parent b1cf4db commit 2a7deab
Showing 1 changed file with 18 additions and 11 deletions.
29 changes: 18 additions & 11 deletions baking/src/tezos_baking/tezos_setup_wizard.py
Original file line number Diff line number Diff line change
Expand Up @@ -197,12 +197,19 @@ def get_node_version():
)


def is_protocol_testnet(network):
return network == "nairobinet"
def is_non_protocol_testnet(network):
return network == "mainnet" or network == "ghostnet"


def teztnets_url(network):
return f"https://teztnets.xyz/{network}"
# Starting from Nairobi protocol, the corresponding testnet
# is no longer a named network, so we need to provide the URL
# of the network configuration instead of the network name
# in 'octez-node config init' command.
def network_name_or_teztnets_url(network):
if is_non_protocol_testnet(network):
return network
else:
return f"https://teztnets.xyz/{network}"


compatible_snapshot_version = 6
Expand Down Expand Up @@ -407,13 +414,13 @@ def check_blockchain_data(self):
print_and_log(" Configuring directory: " + node_dir)
network = self.config["network"]
proc_call(
"sudo -u tezos octez-node-" + network + " config init" + " --network " +
# Starting from Nairobi protocol, the corresponding testnet
# is no longer a named network, so we need to provide the URL
# of the network configuration instead of the network name there.
teztnets_url(network)
if is_protocol_testnet(network)
else network + " --rpc-addr " + self.config["node_rpc_addr"]
"sudo -u tezos octez-node-"
+ self.config["network"]
+ " config init"
+ " --network "
+ network_name_or_teztnets_url(self.config["network"])
+ " --rpc-addr "
+ self.config["node_rpc_addr"]
)

diff = node_dir_contents - node_dir_config
Expand Down

0 comments on commit 2a7deab

Please sign in to comment.