Skip to content

Commit

Permalink
fix xrpl features
Browse files Browse the repository at this point in the history
  • Loading branch information
dangell7 committed Nov 26, 2024
1 parent 078154f commit 400f029
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 8 deletions.
1 change: 1 addition & 0 deletions tests/integration/test_standalone.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ def test_standalone_image(cls):
cls.assertTrue(folder_exists)
for file in files_exist:
cls.assertTrue(file)
print(ee)

def _test_standalone_binary(cls):
create_standalone_binary(
Expand Down
1 change: 1 addition & 0 deletions xrpld_netgen/libs/rippled.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ def parse_rippled_amendments(lines: Any):
amendment_name: str = ""
if re.match(r"XRPL_FIX", line):
amendment_name = re.search("XRPL_FIX\)?.*?\((.*?),", line).group(1) or 0
amendment_name = f"fix{amendment_name}"
if re.match(r"XRPL_FEATURE", line):
amendment_name = re.search("XRPL_FEATURE\((.*?),", line).group(1) or 0
supported = re.findall(r"Supported::(.*),", line)
Expand Down
20 changes: 12 additions & 8 deletions xrpld_netgen/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ def update_stop_sh(
return stop_sh_content


def create_standalone_folder(
def create_xrpl_standalone_folder(
binary: bool,
name: str,
image: str,
Expand Down Expand Up @@ -127,10 +127,11 @@ def create_standalone_folder(
nodedb_type,
get_node_db_path(nodedb_type, "standalone"),
get_relational_db(nodedb_type),
"/var/lib/rippled/db",
"/var/log/rippled/debug.log",
"/opt/ripple/lib/db",
"/opt/ripple/log/debug.log",
log_level,
None,
[],
vl_config["validator_list_sites"],
vl_config["validator_list_keys"],
vl_config["import_vl_keys"] if protocol == "xahau" else [],
Expand All @@ -143,6 +144,7 @@ def create_standalone_folder(

lines: List[str] = get_feature_lines_from_content(feature_content)
features_json: Dict[str, Any] = parse_rippled_amendments(lines)
print(json.dumps(features_json, indent=4))
genesis_json: Any = update_amendments(features_json, protocol)
write_file(
f"{basedir}/{protocol}-{name}/genesis.json",
Expand Down Expand Up @@ -216,7 +218,7 @@ def create_standalone_image(
owner, repo, build_name, "include/xrpl/protocol/detail/features.macro"
)
image: str = f"{build_system}/rippled:{build_name}"
create_standalone_folder(
create_xrpl_standalone_folder(
False,
name,
image,
Expand Down Expand Up @@ -278,7 +280,7 @@ def create_standalone_image(
os.chmod(f"{basedir}/{protocol}-{name}/stop.sh", 0o755)


def create_binary_folder(
def create_xahau_standalone_folder(
binary: bool,
name: str,
image: str,
Expand Down Expand Up @@ -320,10 +322,11 @@ def create_binary_folder(
nodedb_type,
get_node_db_path(nodedb_type, "standalone"),
get_relational_db(nodedb_type),
"/var/lib/rippled/db",
"/var/log/rippled/debug.log",
"/opt/ripple/lib/db",
"/opt/ripple/log/debug.log",
log_level,
None,
[],
vl_config["validator_list_sites"],
vl_config["validator_list_keys"],
vl_config["import_vl_keys"] if protocol == "xahau" else [],
Expand Down Expand Up @@ -415,7 +418,7 @@ def create_standalone_binary(
url: str = f"{build_server}/{build_version}"
download_binary(url, f"{basedir}/{protocol}-{name}/rippled.{name}")
image: str = "ubuntu:jammy"
create_binary_folder(
create_xahau_standalone_folder(
True,
name,
image,
Expand Down Expand Up @@ -520,6 +523,7 @@ def create_local_folder(
"debug.log",
log_level,
None,
[],
vl_config["validator_list_sites"],
vl_config["validator_list_keys"],
vl_config["import_vl_keys"] if protocol == "xahau" else [],
Expand Down

0 comments on commit 400f029

Please sign in to comment.