Xrpld-Netgen
Xrpld Netgen - Standalone
Learn how to start and stop the standalone environment using the xrpld-netgen.
Quick start
xrpld-netgen is a powerful command-line tool that allows developers to interact with the XRPL network and set up a local development environment. In this guide, we will walk you through the steps required to set up xrpld-netgen in your project.
Installing dependencies
To install xrpld-netgen, you'll need to have Node.js and Yarn installed on your system. Once you have these dependencies installed, you can install xrpld-netgen globally using the following command:
pip3 install xrpld-netgen
Starting the Standalone Environment
To start the standalone environment, you can use the following command:
xrpld-netgen up:standalone
The up:standalone
command will build and recreate the Docker containers defined in the docker-compose.yml
file. The -d
flag runs the containers in detached mode, allowing them to run in the background.
The docker-compose.yml
file defines two services: node1-rippled
and node1-explorer
. The node1-rippled
service runs the default xahaud version from binary, which is the standalone version of the Xahaud node. The node1-explorer
service runs the transia/explorer
image, which is the explorer for the Ripple network.
Once the containers are up and running, the xrpld-netgen will create a xahaud
directory in the current working directory. This directory contains the configuration files, logs, database, and validator list for the xrpld-netgen standalone network.
Accessing the Standalone Environment
To access the standalone environment, you can use the following URLs and ports:
- Rippled API:
http://localhost:80
- Rippled WebSocket:
ws://localhost:80
- Explorer:
http://localhost:4000
Debugging the Standalone Environment
To debug the standalone environment and monitor the execution of hooks, you can use the following command:
tail -f xahaud/log/debug.log | grep HookTrace
This command will stream the debug logs in real-time and filter for lines containing "HookTrace". It allows you to monitor the execution of hooks and identify any issues or errors.
As you interact with the XRPL or trigger hooks, you will see the corresponding debug log entries in the terminal. This can help you troubleshoot and debug any unexpected behavior or errors related to the execution of hooks.
To stop streaming the debug logs, press Ctrl + C
in the terminal.
Using the tail -f xahaud/log/debug.log | grep HookTrace
command provides a convenient way to monitor the execution of hooks and debug the standalone environment.
Stopping the Standalone Environment
To stop the standalone environment and remove the Docker containers, you can use the following command:
xrpld-netgen down:standalone
The down:standalone
command will stop and remove the Docker containers defined in the docker-compose.yml
file. It will also remove the xahaud
directory from the current working directory.
With the xrpld-netgen, you can easily start and stop the standalone environment for XRPL Hooks development. Use the provided commands to manage the environment and access the necessary URLs and ports.