Skip to content

Commit

Permalink
chore: changed node-type to node_type
Browse files Browse the repository at this point in the history
  • Loading branch information
riyasng12 committed Jan 10, 2024
1 parent 3b5830a commit 90ae6ce
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 27 deletions.
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -114,13 +114,13 @@ To use the Polkadot-kurtosis-package, you need to create a configuration file sp
"nodes": [
{
"name": "alice",
"node-type": "validator",
"node_type": "validator",
"port": 9944,
"prometheus": false
},
{
"name": "bob",
"node-type": "full",
"node_type": "full",
"port": 9945,
"prometheus": false
}
Expand All @@ -132,12 +132,12 @@ To use the Polkadot-kurtosis-package, you need to create a configuration file sp
"nodes": [
{
"name": "alice",
"node-type": "validator",
"node_type": "validator",
"prometheus": false
},
{
"name": "bob",
"node-type": "full",
"node_type": "full",
"prometheus": false
}
]
Expand All @@ -158,14 +158,14 @@ To use the Polkadot-kurtosis-package, you need to create a configuration file sp
- **name:** Name of the relay chain (e.g., "rococo-local", "rococo", "polkadot" or "kusama").
- **nodes:** List of nodes on the relay chain, each with:
- **name:** Node name (e.g., "alice").
- **node-type:** Node type, can be "validator" or "full".
- **node_type:** Node type, can be "validator" or "full".
- **port:** Port number for the node (e.g., 9944).
- **prometheus:** Whether Prometheus monitoring is enabled (true/false).
- **para:** List of parachains, each with:
- **name:** Parachain name (e.g., "kilt").
- **nodes:** List of nodes on the parachain, similar to relay chain nodes.
- **name:** Node name (e.g., "alice").
- **node-type:** Node type, can be "callator" or "full".
- **node_type:** Node type, can be "callator" or "full".
- **prometheus:** Whether Prometheus monitoring is enabled (true/false).
- **chopstick:** Configuration for Chopstick integration.
- **xcm:** Whether XCM (Cross-Chain Messaging) is enabled (true/false).
Expand Down
8 changes: 4 additions & 4 deletions local.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@
"nodes": [
{
"name": "alice",
"node-type": "validator",
"node_type": "validator",
"prometheus": false
},
{
"name": "bob",
"node-type": "full",
"node_type": "full",
"prometheus": true

}
Expand All @@ -23,13 +23,13 @@
"nodes": [
{
"name": "alice",
"node-type": "validator",
"node_type": "validator",
"prometheus": false

},
{
"name": "bob",
"node-type": "full",
"node_type": "full",
"prometheus": true
}
]
Expand Down
12 changes: 6 additions & 6 deletions package_io/utils.star
Original file line number Diff line number Diff line change
Expand Up @@ -87,19 +87,19 @@ def check_config_validity(plan, chain_type, relaychain, parachains):
if len(relaychain) != 0:
for node in relay_nodes:
if len(node) != 0:
if node["node-type"] in ["validator", "full", "archive"]:
if node["node_type"] in ["validator", "full", "archive"]:
plan.print("config for relaynodes is valid")
else:
return fail("relaychain node-type can be only validator/full")
return fail("relaychain node_type can be only validator/full")

if len(parachains) != 0:
for para in parachains:
if len(para["nodes"]) != 0:
for node in para["nodes"]:
if node["node-type"] in ["validator", "full", "collator"]:
if node["node_type"] in ["validator", "full", "collator"]:
plan.print("config for parachain is valid")
else:
return fail("parachain node-type can be only validator/full/collator")
return fail("parachain node_type can be only validator/full/collator")

def upload_files(plan):
plan.upload_files(src = "../parachain/static_files/configs", name = "configs")
Expand All @@ -111,13 +111,13 @@ def convert_to_lowercase(chain_type, relaychain, parachains):
relaychain["name"] = relaychain["name"].lower()
for node in relaychain["nodes"]:
node["name"] = node["name"].lower()
node["node-type"] = node["node-type"].lower()
node["node_type"] = node["node_type"].lower()

for para in parachains:
para["name"] = para["name"].lower()
for node in para["nodes"]:
node["name"] = node["name"].lower()
node["node-type"] = node["node-type"].lower()
node["node_type"] = node["node_type"].lower()

return chain_type, relaychain, parachains

10 changes: 5 additions & 5 deletions parachain/parachain.star
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ def start_local_parachain_node(plan, chain_type, parachain, para_id):
parachain_detail["endpoint"] = utils.get_service_url("ws", parachain_spawn_detail.ip_address, parachain_spawn_detail.ports["ws"].number)
parachain_detail["ip_address"] = parachain_spawn_detail.ip_address
parachain_detail["prometheus"] = node["prometheus"]
parachain_detail["node-type"] = node["node-type"]
parachain_detail["node_type"] = node["node_type"]
if node["prometheus"] == True:
parachain_detail["prometheus_port"] = parachain_spawn_detail.ports["metrics"].number
if prometheus_port != None:
Expand Down Expand Up @@ -171,10 +171,10 @@ def run_testnet_mainnet(plan, chain_type, relaychain_name, parachain):

command = common_command
command = command + ["--name={0}".format(node["name"])]
if node["node-type"] == "collator":
if node["node_type"] == "collator":
command = command + ["--collator"]

if node["node-type"] == "validator":
if node["node_type"] == "validator":
command = command + ["--validator"]

if parachain["name"] in constant.CHAIN_COMMAND:
Expand All @@ -192,7 +192,7 @@ def run_testnet_mainnet(plan, chain_type, relaychain_name, parachain):
node_info["endpoint"] = utils.get_service_url("ws", node_details.ip_address, node_details.ports["ws"].number)
node_info["ip_address"] = node_details.ip_address
node_info["prometheus"] = node["prometheus"]
node_info["node-type"] = node["node-type"]
node_info["node_type"] = node["node_type"]
if node["prometheus"] == True:
node_info["prometheus_port"] = node_details.ports["metrics"].number
if prometheus_port != None:
Expand All @@ -210,7 +210,7 @@ def run_testnet_mainnet(plan, chain_type, relaychain_name, parachain):
node_info["endpoint"] = utils.get_service_url("ws", node_details.ip_address, node_details.ports["ws"].number)
node_info["ip_address"] = node_details.ip_address
node_info["prometheus"] = node["prometheus"]
node_info["node-type"] = node["node-type"]
node_info["node_type"] = node["node_type"]
if node["prometheus"] == True:
node_info["prometheus_port"] = node_details.ports["metrics"].number
if prometheus_port != None:
Expand Down
4 changes: 2 additions & 2 deletions relaychain/relay-chain.star
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ def start_relay_chain(plan, chain_type, chain_name, relay_nodes):
relay_node_details["service_name"] = service_details.name
relay_node_details["prometheus"] = relay_node["prometheus"]
relay_node_details["ip_address"] = service_details.ip_address
relay_node_details["node-type"] = relay_node["node-type"]
relay_node_details["node_type"] = relay_node["node_type"]
if relay_node["prometheus"] == True:
relay_node_details["prometheus_port"] = service_details.ports["metrics"].number
if prometheus_port != None:
Expand Down Expand Up @@ -117,7 +117,7 @@ def start_relay_chains_local(plan, chain_type, chain_name, relay_nodes):
relay_detail["service_name"] = service_details.name
relay_detail["prometheus"] = node["prometheus"]
relay_detail["ip_address"] = service_details.ip_address
relay_detail["node-type"] = node["node-type"]
relay_detail["node_type"] = node["node_type"]
if node["prometheus"]:
relay_detail["prometheus_port"] = service_details.ports["metrics"].number
if prometheus_port != None:
Expand Down
8 changes: 4 additions & 4 deletions testdata/updated_config.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@
"nodes": [
{
"name": "alice",
"node-type": "validator",
"node_type": "validator",
"port": 9944
},
{
"name": "bob",
"node-type": "full",
"node_type": "full",
"port": 9945
}
]
Expand All @@ -20,11 +20,11 @@
"nodes": [
{
"name": "alice",
"node-type": "collator"
"node_type": "collator"
},
{
"name": "bob",
"node-type": "full"
"node_type": "full"
}
]
}
Expand Down

0 comments on commit 90ae6ce

Please sign in to comment.