Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 30 additions & 4 deletions .github/workflows/python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,10 @@ jobs:
matrix:
python-version: ['3.9', '3.10']

env:
XRPL_VERSION: 3.1.1
XAHAU_VERSION: 2025.7.9-release+1951

steps:
- uses: actions/checkout@v3

Expand Down Expand Up @@ -129,23 +133,45 @@ jobs:
- name: Test CLI subcommand help
run: |
poetry run xrpld-netgen create:network --help
poetry run xrpld-netgen up --help
poetry run xrpld-netgen up:standalone --help
poetry run xrpld-netgen up:local --help

- name: Test CLI without args does not crash
run: |
poetry run xrpld-netgen || true

- name: Test CLI command for xrpl
- name: Test CLI standalone command for xrpl
run: |
poetry run xrpld-netgen up:standalone --protocol xrpl
poetry run xrpld-netgen up:standalone --protocol xrpl --version ${{ env.XRPL_VERSION }}
sleep 5
docker logs xrpl
docker ps | grep xrpl
# poetry run xrpld-netgen down:standalone --protocol xrpl --version ${{ env.XRPL_VERSION }}

- name: Test CLI command for xahau
- name: Test CLI standalone command for xahau
run: |
poetry run xrpld-netgen up:standalone --protocol xahau
poetry run xrpld-netgen up:standalone --protocol xahau --version ${{ env.XAHAU_VERSION }}
sleep 5
docker logs xahau
docker ps | grep xahau
# poetry run xrpld-netgen down:standalone --protocol xahau --version ${{ env.XAHAU_VERSION }}

# TODO: not supported?
# - name: Test CLI create:network, up, stop, down command for xrpl
# run: |
# poetry run xrpld-netgen create:network --protocol xrpl --build_version ${{ env.XRPL_VERSION }}
# poetry run xrpld-netgen up --name xrpld-${{ env.XRPL_VERSION }}-cluster
# sleep 5
# docker ps | grep cluster
# poetry run xrpld-netgen down --name xrpld-${{ env.XRPL_VERSION }}-cluster
# poetry run xrpld-netgen remove --name xrpld-${{ env.XRPL_VERSION }}-cluster

- name: Test CLI create:network, up, stop, down command for xahau
run: |
poetry run xrpld-netgen create:network --protocol xahau --build_version ${{ env.XAHAU_VERSION }}
poetry run xrpld-netgen up --name ${{ env.XAHAU_VERSION }}-cluster
sleep 5
docker ps | grep cluster
poetry run xrpld-netgen down --name ${{ env.XAHAU_VERSION }}-cluster
poetry run xrpld-netgen remove --name ${{ env.XAHAU_VERSION }}-cluster
1 change: 1 addition & 0 deletions tests/integration/test_network.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ def _test_create_ansible(cls):
def _test_update_node(cls):
update_node_binary(
"2025.2.6-release+1299-cluster", # network name
"xahau", # protocol
"1", # node id
"peer", # node type: validator or peer
"https://build.xahau.tech", # build server
Expand Down
2 changes: 1 addition & 1 deletion xrpld_netgen/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -585,7 +585,7 @@ def main():
print(f" - Node Type: {NODE_VERSION}")
print(f" - Build Server: {BUILD_SERVER}")
print(f" - Build Version: {BUILD_VERSION}")
update_node_binary(NAME, NODE_ID, NODE_VERSION, BUILD_SERVER, BUILD_VERSION)
update_node_binary(NAME, PROTOCOL, NODE_ID, NODE_VERSION, BUILD_SERVER, BUILD_VERSION)

if args.command == "enable:amendment":
NAME = args.name
Expand Down
23 changes: 15 additions & 8 deletions xrpld_netgen/deploykit/network.entrypoint
Original file line number Diff line number Diff line change
@@ -1,27 +1,34 @@
#!/bin/bash
# ./entrypoint.sh ledgerfile quorum
# ./entrypoint.sh /genesis.json 5
# ./entrypoint.sh protocol ledgerfile quorum
# ./entrypoint.sh protocol /genesis.json 5

# Check if $1 is passed
if [[ -n "$1" ]]; then
ledgerfile="--ledgerfile $1"
protocol="$1"
else
ledgerfile=""
protocol="xrpl"
fi

# Check if $2 is passed
if [[ -n "$2" ]]; then
quorum="--quorum=$2"
ledgerfile="--ledgerfile $2"
else
quorum=""
ledgerfile=""
fi

# Check if $3 is passed
if [[ -n "$3" ]]; then
standalone="$3"
quorum="--quorum=$3"
else
quorum=""
fi

# Check if $4 is passed
if [[ -n "$4" ]]; then
standalone="$4"
else
standalone=""
fi

# Start xrpld with or without ledgerfile and quorum
exec /app/xrpld $ledgerfile $quorum $standalone --conf /opt/ripple/config/xrpld.cfg
exec /app/"$protocol"d $ledgerfile $quorum $standalone --conf /opt/ripple/config/"$protocol"d.cfg
26 changes: 16 additions & 10 deletions xrpld_netgen/deploykit/xahau.entrypoint
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash
# ./entrypoint.sh ledgerfile quorum
# ./entrypoint.sh /genesis.json 5
# ./entrypoint.sh xahau ledgerfile quorum
# ./entrypoint.sh xahau /genesis.json 5

xahaudconfig=`/bin/cat /config/xahaud.cfg 2>/dev/null | wc -l`
validatorstxt=`/bin/cat /config/validators.txt 2>/dev/null | wc -l`
Expand All @@ -17,23 +17,29 @@ if [[ "$xahaudconfig" -gt "0" && "$validatorstxt" -gt "0" ]]; then

fi

# Check if $1 is passed
if [[ -n "$1" ]]; then
ledgerfile="--ledgerfile $1"
else
ledgerfile=""
# Check if $1 is xahau
if [[ "$1" != "xahau" ]]; then
echo "Invalid protocol: $1"
exit 1
fi

# Check if $2 is passed
if [[ -n "$2" ]]; then
quorum="--quorum=$2"
ledgerfile="--ledgerfile $2"
else
quorum=""
ledgerfile=""
fi

# Check if $3 is passed
if [[ -n "$3" ]]; then
standalone="$3"
quorum="--quorum=$3"
else
quorum=""
fi

# Check if $4 is passed
if [[ -n "$4" ]]; then
standalone="$4"
else
standalone=""
fi
Expand Down
26 changes: 16 additions & 10 deletions xrpld_netgen/deploykit/xrpl.entrypoint
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash
# ./entrypoint.sh ledgerfile quorum
# ./entrypoint.sh /genesis.json 5
# ./entrypoint.sh xrpl ledgerfile quorum
# ./entrypoint.sh xrpl /genesis.json 5

xrpldconfig=`/bin/cat /config/xrpld.cfg 2>/dev/null | wc -l`
validatorstxt=`/bin/cat /config/validators.txt 2>/dev/null | wc -l`
Expand All @@ -17,23 +17,29 @@ if [[ "$xrpldconfig" -gt "0" && "$validatorstxt" -gt "0" ]]; then

fi

# Check if $1 is passed
if [[ -n "$1" ]]; then
ledgerfile="--ledgerfile $1"
else
ledgerfile=""
# Check if $1 is xrpl
if [[ "$1" != "xrpl" ]]; then
echo "Invalid protocol: $1"
exit 1
fi

# Check if $2 is passed
if [[ -n "$2" ]]; then
quorum="--quorum=$2"
ledgerfile="--ledgerfile $2"
else
quorum=""
ledgerfile=""
fi

# Check if $3 is passed
if [[ -n "$3" ]]; then
standalone="$3"
quorum="--quorum=$3"
else
quorum=""
fi

# Check if $4 is passed
if [[ -n "$4" ]]; then
standalone="$4"
else
standalone=""
fi
Expand Down
Loading
Loading