_ # ββββ.ββ Β· β .β β β’β .ββ Β·
__ ____ _| |__ __ _ _ _ # Β·ββββ β. βββͺβββͺ βͺ βββββͺββ β.
\ \/ / _` | "_ \ / _` | | | | # βͺβ ββββββββ βββββ ββββ ββββ ββββΒ·ββββββ
> < (_| | | | | (_| | |_| | # βββββββββͺββ ββββββββ.βββββ.ββββ.ββββββͺββ
/_/\_\__,_|_| |_|\__,_|\__,_| # ββββ’ ββββ βββ Β· βββββͺ βββββͺΒ·β β ββββ
.wasm
CDN locations: https://wasm.xahau.tech (qjsc.wasm, esbuild.wasm)To install (or update, or reload, or restart, or ...)
./install
./clean
./logs
Tip: just keep this running in a separate terminal
./advance
Tip: If you want to automate this, you can POST:
curl \
-X POST --data '{"method":"ledger_accept"}' \
localhost:9005
.bc
Hook (binary, to be deployed)This command will compile .js/.mjs/.cjs/.ts
contracts to compiled binary SetHook Hook ready hook code. The output will be stored in the ./build
folder.
If your file has the .ts
extension (TypeScript), it will be compiled from TypeScript to Javascript first, and then compiled to binary SetHook ready code. Your .js
file will then have the name of your .ts
file. If an existing .js
file with the same name exists IT WILL BE OVERWRITTEN!
To compile all .js/.mjs/.cjs/.ts
files in the ./contracts
folder:
./compile
To compile a single .js/.mjs/.cjs/.ts
file in the ./contracts
folder:
./compile mycontract.ts
Deploy a contract from the ./build
folder to the locally running ledger:
./deploy {contract-name} [destination-r-address]
The contract name is mandatory and matches the file name (without extension) in the ./build
folder.
The destination r-address is optional, if not specified the contract will deploy to ryouhapPYV5KNHmFUKrjNqsjxhnxvQiVt
.
To deploy mycontract.ts
or mycontract.js
from the ./build
folder:
./deploy mycontract
./run-dev
Easiest way: use xrpl-netgen
to run a specific version of the JS Hooks binary.
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
# Advance ledger
curl -X POST --data '{"method":"ledger_accept"}' localhost:5007
# Trace
docker logs --tail 100 -f xahau 2>&1 | grep -E 'HookTrace|HookError'