Sending Intra-Rayls Privacy Node Transactions

Overview

In the Rayls ecosystem, there are two main types of transactions:

  1. Internal transactions within a single Rayls Privacy Node Ledger (PL).
  2. Cross-chain transactions between different Rayls Privacy Nodes via the Private Network Hub (link to cross-chain transactions page).

This page focuses on internal transactions within a single Rayls Privacy Node and guides you through the process of sending transactions using various methods, including Rayls Custody Light APIs.

Prerequisites

  • Set up a wallet or custody account within the Rayls Privacy Node.
  • Have access to the Rayls Privacy Node Ledger’s RPC endpoint or the Rayls Custody Light APIs.
  • Have a sufficient token balance in your wallet for the transaction.

Executing Internal Transactions in a Rayls Privacy Node Ledger

1. Direct Contact to the Rayls Privacy Node Ledger Transaction Execution

Rayls is fully EVM-compatible, therefore it supports Ethereum-like transaction execution, allowing developers familiar with Ethereum to use tools like Ethers.js and Web3.js.

Example Transaction Using Ethers.js:

const { ethers } = require('ethers');  
const provider = new ethers.providers.JsonRpcProvider('<Privacy-Ledger-Endpoint>');

const privateKey = '<Your-Private-Key>';  
const wallet = new ethers.Wallet(privateKey, provider);

async function sendTransaction() {  
    const tx = {  
        to: '<Recipient-Address>',  
        value: ethers.utils.parseEther('1.0')  
    };
const transaction = await wallet.sendTransaction(tx);
await transaction.wait();
console.log('Transaction successful:', transaction);
}

sendTransaction();