Skip to content

Commit

Permalink
Remove sidechain and witness server functionality
Browse files Browse the repository at this point in the history
  • Loading branch information
SaxenaKaustubh committed Jun 13, 2024
1 parent b37da19 commit ffb4a3d
Show file tree
Hide file tree
Showing 10 changed files with 12 additions and 1,085 deletions.
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,12 @@ def read_requirements():
setup(
name='claudia',
version=CLAUDIA_VERSION,
description='Helper utility to manage local rippled mainnet and sidechain networks',
description='Helper utility to manage local rippled mainnet networks',
long_description=long_description,
long_description_content_type='text/markdown',
author="Kausty Saxena",
author_email="[email protected]",
keywords="ripple xrpl python local mainnet sidechain",
keywords="ripple xrpl python local mainnet",
url='https://xrpl.org/',
download_url='https://github.com/ripple/claudia',
py_modules=['claudia.claudia'],
Expand Down
55 changes: 3 additions & 52 deletions src/claudia/README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Claudia
Claudia is a helper utility that simplifies setting up and managing a development environment for the XRP Ledger.
It helps the user to run a local network using a built/installed instance of rippled. It can also launch a sidechain network.
These networks can be later used to perform local testing and debugging.
It helps the user to run a local network using a built/installed instance of rippled.
This network can be used to perform local testing and debugging.

Claudia was developed by the XRPL Automation Team as an internal tool to help with XRPL local development, debugging and
testing. As the tool matured, the team quickly realized its potential and decided to expose it outside of Ripple, so
Expand All @@ -12,9 +12,6 @@ Following are some of the important tasks that can be performed using Claudia:
- Build rippled from local code.
- Install rippled from pre-built binaries released by Ripple.
- Manage a local-mainnet network using local rippled instance.
- Locally build a local witness server to start a sidechain network.
- Manage a local-sidechain network.
- Manage rippled features on the local-mainnet and local-sidechain networks.

---

Expand Down Expand Up @@ -93,8 +90,7 @@ even learn a few XRPL tricks. This section walks you through some major features
### How to build rippled?

Claudia offers a way to build rippled from local code. You will need to
clone [rippled](https://github.com/XRPLF/rippled) repository first before starting with this step. If you intend to use
sidechain functionality, please use [this](https://github.com/seelabs/rippled/tree/xbridge) rippled fork instead.
clone [rippled](https://github.com/XRPLF/rippled) repository first before starting with this step.

Once the repository has been cloned, you can build rippled as follows. Each option would require you to provide the ***absolute path*** to the cloned repository.

Expand Down Expand Up @@ -151,18 +147,6 @@ You can follow these instructions to disable a rippled feature:
- Demo Mode
- Select `Settings` -> `Disable a rippled feature`

### How to build witness server?

Before you can start a sidechain network, you will need to build a witness server locally. You will need to
clone [XBridge Witness](https://github.com/seelabs/xbridge_witness) repository first before starting on this step. Once
the repository has been cloned, you can build the witness server as follows. Each option would require you to provide
the absolute path to the cloned repository.

- CLI Mode
- Run `claudia witness build --repo <repo_path>`
- Demo Mode
- Select `Custom XRPL Networks` -> `Build witness server`

### How to start a local-mainnet network?

Before you can start a local mainnet network, rippled has to be built or installed locally. Afterwards, you can follow
Expand All @@ -186,39 +170,6 @@ You can follow these instructions to stop a local mainnet network:
- Demo Mode
- Select `Custom XRPL Networks` -> `Stop local-mainnet`

### How to start a local-sidechain network?

Before you can start a local sidechain network:

1. rippled has to be built/installed locally.
2. Witness server has to be built locally.
3. `XChainBridge` rippled feature has to be enabled.
4. The local-mainnet network has to be running.

Once all the requirements have been met, you can start the local sidechain network as follows:

- CLI Mode
- Run `claudia local-sidechain start`
- Demo Mode
- Select `Custom XRPL Networks` -> `Start local-sidechain`

This can take up to a minute. Once the network has been launched, you can access the network as follows:
- WebSocket (ws): 127.0.0.1:6003
- JSON-RPC (http): 127.0.0.1:5003
-

### How to stop a local-sidechain network?

You can follow these instructions to stop a local sidechain network:

- CLI Mode
- Run `claudia local-sidechain stop`
- Demo Mode
- Select `Custom XRPL Networks` -> `Stop local-sidechain`

Please note that once the sidechain has been stopped, local-mainnet has to be restarted before attempting to start the
local-sidechain again.

### How to clean up your computer and free resources after running Claudia?

While using claudia, there are a few files created permanently. Also, there are a few system resources which are
Expand Down
122 changes: 1 addition & 121 deletions src/claudia/claudia.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,10 +75,6 @@ def launch_custom_rippled_networks_menu():
"Start local-mainnet",
"Stop local-mainnet",
"Check local-mainnet status",
"Build witness server",
"Start local-sidechain",
"Stop local-sidechain",
"Check witness server status",
"Back to main menu"
],
),
Expand Down Expand Up @@ -126,35 +122,6 @@ def launch_custom_rippled_networks_menu():
print("\nINFO: In order to '{}', run: 'claudia local-mainnet stop'".format(selection_text))
print("You have opted to execute '{}'. Starting now...\n".format(selection_text))
launch_command_network_stop()
elif selection_text == 'Build witness server':
relaunch_wizard = False
repo_path = get_valid_repo_path()
if repo_path == "" or repo_path.replace("'", "").replace('"', '').lower() == 'back':
relaunch_wizard = True
else:
clear_screen()
print("\nINFO: In order to '{}', run: 'claudia witness build --repo <absolute_path_to_local_repo>'".format(
selection_text))
print("You have opted to execute '{}'. Starting now...\n".format(selection_text))
launch_command_witness_build(repo_path)
elif selection_text == 'Check witness server status':
relaunch_wizard = False
clear_screen()
print("\nINFO: In order to '{}', run: 'claudia witness status'".format(selection_text))
print("You have opted to execute '{}'. Starting now...\n".format(selection_text))
launch_command_witness_status()
elif selection_text == 'Start local-sidechain':
relaunch_wizard = False
clear_screen()
print("\nINFO: In order to '{}', run: 'claudia local-sidechain start'".format(selection_text))
print("You have opted to execute '{}'. Starting now...\n".format(selection_text))
launch_command_sidechain_start()
elif selection_text == 'Stop local-sidechain':
relaunch_wizard = False
clear_screen()
print("\nINFO: In order to '{}', run: 'claudia local-sidechain stop'".format(selection_text))
print("You have opted to execute '{}'. Starting now...\n".format(selection_text))
launch_command_sidechain_stop()
elif selection_text == 'Back to main menu':
clear_screen()
launch_main_menu()
Expand Down Expand Up @@ -323,16 +290,6 @@ def local_mainnet():
"""Setup rippled Network"""


@main.group()
def local_sidechain():
"""Setup Sidechain"""


@main.group()
def witness():
"""Setup Witness Server for Sidechain"""


@main.group()
def set_install_mode():
"""Setup Install Mode"""
Expand Down Expand Up @@ -397,81 +354,6 @@ def list():
"""List supported options"""


@local_sidechain.command()
def start():
"""Start a new sidechain"""
launch_command_sidechain_start()


def launch_command_sidechain_start():
command = get_launch_command_sidechain_start()
return subprocess.call(command, shell=True)


def get_launch_command_sidechain_start():
set_to_project_root_wd()
return "sh network_setup/setup.sh --sidechainStart"


@local_sidechain.command()
def stop():
"""Stop sidechain"""
launch_command_sidechain_stop()


def launch_command_sidechain_stop():
command = get_launch_command_sidechain_stop()
return subprocess.call(command, shell=True)


def get_launch_command_sidechain_stop():
set_to_project_root_wd()
return "sh network_setup/setup.sh --sidechainStop"


@witness.command()
@click.option('--repo', required=True, help="The path to a local witness server repo")
def build(repo):
"""Build witness server"""
launch_command_witness_build(repo)


def launch_command_witness_build(repo):
if not os.path.isabs(repo) or not os.path.exists(repo):
click.echo(
" - ERROR: The rippled repository path '{}' is not correct. Please provide correct absolute path!".format(repo))
return

command = get_launch_command_witness_build(repo)
return subprocess.call(command, shell=True)


def get_launch_command_witness_build(repo):
set_to_project_root_wd()
return "sh network_setup/setup.sh --witnessBuild --repo {}".format(repo)


@witness.command()
def status():
"""Witness server status"""
launch_command_witness_status()


def launch_command_witness_status():
command = get_launch_command_witness_status()
return subprocess.call(command, shell=True)


def get_launch_command_witness_status():
set_to_project_root_wd()
return "sh network_setup/setup.sh --witnessStatus"


def get_launch_command_deploy_network(count):
set_to_project_root_wd()
return f"sh aws/setup.sh --deployNetwork --nodeCount {count}"


@set_install_mode.command()
def build():
"""Set install mode to build"""
Expand Down Expand Up @@ -610,7 +492,7 @@ def stop():


def launch_command_network_stop():
command = get_launch_command_sidechain_stop()
command = get_launch_command_network_stop()
return subprocess.call(command, shell=True)


Expand Down Expand Up @@ -641,8 +523,6 @@ def get_explorer_url(network):
url = "https://testnet.xrpl.org"
elif network == 'devnet':
url = "https://devnet.xrpl.org"
elif network == "local-sidechain":
url = "https://custom.xrpl.org/localhost:6003"
else:
url = "https://custom.xrpl.org/localhost:6001"

Expand Down

This file was deleted.

9 changes: 0 additions & 9 deletions src/claudia/network_setup/lib/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ LOG_DIR="${LOG_BASE_DIR}/logs_$(date +%Y%m%d_%H%M%S)"
WORK_DIR="/tmp/work_dir"
use_existing_log_dir="false"
build_rippled_opt="false"
build_witness_opt="false"
repo=""

trap cleanup EXIT
Expand Down Expand Up @@ -43,9 +42,6 @@ prepare_workspace() {
if [ -z "${repo}" ]; then
if [ "${build_rippled_opt}" = "true" ]; then
repo="${HOME}/rippled"
elif [ "${build_witness_opt}" = "true" ]; then
repo="${HOME}/xbridge_witness"
fi
fi

if [ ! -d "${repo}" ]; then
Expand Down Expand Up @@ -75,10 +71,6 @@ while [ "$1" != "" ]; do
build_rippled_opt="true"
;;

--buildWitness)
build_witness_opt="true"
;;

--logDir)
shift
use_existing_log_dir="true"
Expand All @@ -95,4 +87,3 @@ done
prepare_workspace
install_prerequisites
build_rippled "${build_rippled_opt}" "${repo}"
build_witness "${build_witness_opt}" "${repo}"
Loading

0 comments on commit ffb4a3d

Please sign in to comment.