Blockchain-Laboratories-LLC / xrpl-hook-template

XRPL Hook Rust template

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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


Languages

Language:JavaScript 70.4%Language:Shell 15.6%Language:Rust 14.0%