Skip to content

otov4its/xrpl-hook-template

Repository files navigation

XRPL Hook Template

*Before you begin, it is highly recommended that you read the official docs carefully.

This bootstrap template allows you to write XRPL hooks in Rust.

You may need:

XRPL Hackathon 2021

This is part of the XRPL Hooks Rust project developed for XRPL Hackathon 2021.

Prerequisites

  1. We need rustup if not already installed
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
source ~/.bashrc
  1. Add wasm32 target
rustup target add wasm32-unknown-unknown
  1. We need nodejs v12 for setting hooks to XRPL
curl -fsSL https://deb.nodesource.com/setup_12.x | sudo -E bash -
sudo apt-get install -y nodejs

Clone

Clone this repo

git clone https://github.com/otov4its/xrpl-hook-template.git
cd xrpl-hook-template/

Workflow

Step 0

Make changes in src/lib.rs

Step 1

Build

./build

The builded wasm hook is contained in the project root directory.

Step 2

Set hook

nodejs set_hook s*** hook_debug

Step 3

Check

nodejs pay s*** 1000 r***

Step 4

Goto -> "Step 0" :)

Release

nodejs set_hook s*** hook

Building examples

./build_examples

The builded wasm are contained in examples folder.

To set example hook run:

nodejs set_hook s*** examples/HOOKNAME

About

XRPL Hook Rust template

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published