### Run Development Environment with Autoreload using Shell Script Source: https://github.com/xahau/jshooks-alpha/blob/main/README.md The `./run-dev` command starts the development environment in a watch mode with autoreload capabilities. This is useful for iterating quickly during development as changes are automatically reflected. ```shell ./run-dev ``` -------------------------------- ### Install/Renew Environment with Shell Script Source: https://github.com/xahau/jshooks-alpha/blob/main/README.md This command installs, updates, reloads, or restarts the development environment for Xahau JS Hooks. It's a shell script designed to manage the project's dependencies and setup. ```shell ./install ``` -------------------------------- ### Run Xahau Standalone Node with xrpl-netgen Source: https://github.com/xahau/jshooks-alpha/blob/main/README.md This snippet demonstrates how to set up and run a standalone Xahau node using `xrpl-netgen`. It specifies the protocol, version, build type, server, and network ID. It also shows how to shut down the container. ```shell pip3bin=$(echo "$(echo $(which pipx 2>&1); echo $(which pip3 2>&1))"|grep /|head -n 1) $pip3bin install xrpld-netgen # Run, binary 2024.5.20-dev+jshooks as per https://build.xahau.tech xrpld-netgen up:standalone --protocol xahau --version 2024.5.20-dev+jshooks --build_type binary --server https://build.xahau.tech --network_id 65535 # xrpld-netgen down:standalone --version 2024.5.20-dev+jshooks ``` -------------------------------- ### Deploy Compiled JS Hooks to Ledger with Shell Script Source: https://github.com/xahau/jshooks-alpha/blob/main/README.md This command deploys a compiled hook (found in the `./build` folder) to the locally running Xahau ledger. The contract name is mandatory, and an optional destination r-address can be provided. If no address is specified, a default address is used. ```shell ./deploy {contract-name} [destination-r-address] ``` ```shell ./deploy mycontract ``` -------------------------------- ### Compile JS/TS Hooks to BC Binary with Shell Script Source: https://github.com/xahau/jshooks-alpha/blob/main/README.md The `./compile` command compiles JavaScript (.js, .mjs, .cjs) and TypeScript (.ts) hook files into a binary format (`.bc`) suitable for deployment on the Xahau ledger. If TypeScript is used, it's first compiled to JavaScript. Existing JavaScript files with the same name in the `./build` folder will be overwritten. ```shell ./compile ``` ```shell ./compile mycontract.ts ``` -------------------------------- ### Trace Logs with Docker for xrpl-netgen Container Source: https://github.com/xahau/jshooks-alpha/blob/main/README.md This command retrieves and displays the last 100 lines of logs from the `xahau` Docker container, filtering for lines containing 'HookTrace' or 'HookError'. This is useful for debugging hook execution within the `xrpl-netgen` environment. ```shell # Trace docker logs --tail 100 -f xahau 2>&1 | grep -E 'HookTrace|HookError' ``` -------------------------------- ### Watch Xahaud Trace Logs with Shell Script Source: https://github.com/xahau/jshooks-alpha/blob/main/README.md This command, `./logs`, allows users to watch Xahaud trace logs live. It specifically filters logs for Hook information, providing real-time insights into hook execution. It's recommended to run this in a separate terminal. ```shell ./logs ``` -------------------------------- ### Advance Ledger with xrpl-netgen cURL POST Request Source: https://github.com/xahau/jshooks-alpha/blob/main/README.md This command advances the ledger for a Xahau standalone node managed by `xrpl-netgen`. It sends a POST request to the ledger's API endpoint to accept the next ledger. ```shell # Advance ledger curl -X POST --data '{"method":"ledger_accept"}' localhost:5007 ``` -------------------------------- ### Advance Ledger and Commit Transactions with Shell Script Source: https://github.com/xahau/jshooks-alpha/blob/main/README.md The `./advance` command is used to close a ledger and commit any pending transactions. This is a crucial step in testing hook functionality on a local ledger. ```shell ./advance ``` -------------------------------- ### Advance Ledger with cURL POST Request Source: https://github.com/xahau/jshooks-alpha/blob/main/README.md This method allows for programmatically advancing the ledger and committing transactions by sending a POST request to the local ledger's API. It's useful for automating ledger advancement in tests or scripts. ```shell curl \ -X POST --data '{"method":"ledger_accept"}' \ localhost:9005 ``` -------------------------------- ### Remove/Cleanup Environment with Shell Script Source: https://github.com/xahau/jshooks-alpha/blob/main/README.md This shell script command is used to remove or clean up the existing development environment for Xahau JS Hooks. It's useful for resetting the project state or freeing up disk space. ```shell ./clean ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.