Run Secure RPC

Repository: Secure RPC GitHubarrow-up-right

  1. Clone the repository

    git clone https://github.com/radiusxyz/secure-rpc
  2. Build the binary

    cd secure-rpc
    cargo build --release
  3. Set up environment variables in ./scripts/execute/env.sh.

  4. Initialize the service:

    ./scripts/execute/01_init_secure_rpc.sh
  5. Start the service:

    ./scripts/execute/02_run_secure_rpc.sh

Environment Variables

chevron-rightsecure-rpc/scripts/execute/env.shhashtag
#!/bin/bash
SCRIPT_PATH="$( cd -- "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P )"
PROJECT_ROOT_PATH="$( cd $SCRIPT_PATH/../.. >/dev/null 2>&1 ; pwd -P )"

BIN_FILE_NAME="secure-rpc"
BIN_PATH="$PROJECT_ROOT_PATH/scripts/$BIN_FILE_NAME"

DATA_PATH=$PROJECT_ROOT_PATH/data
CONFIG_FILE_PATH=$DATA_PATH/Config.toml

# Copy the new version's binary to the scripts directory
if [[ -f "$PROJECT_ROOT_PATH/target/release/$BIN_FILE_NAME" ]]; then
  cp $PROJECT_ROOT_PATH/target/release/$BIN_FILE_NAME $PROJECT_ROOT_PATH/scripts
fi

# Check if the binary exists
if [[ ! -f "$BIN_PATH" ]]; then
    echo "Error: Secure RPC binary not found at $BIN_PATH"
    echo "Please run this command 'cp $PROJECT_ROOT_PATH/target/release/$BIN_FILE_NAME $PROJECT_ROOT_PATH/scripts' after building the project"
    exit 1
fi

# ONLY THE FOLLOWING VARIABLES SHOULD BE CHANGED

# ============================
# πŸ”’ Secure RPC Configuration
# ============================

# 🎯 Used to configure the RPC endpoint that can be identified and accessed 
# by users and transaction orderers.
SECURE_RPC_EXTERNAL_RPC_URL="http://127.0.0.1:6666"  # 🌐 External IP - Please update this.

# ============================
# πŸ”΅ Rollup Configuration
# ============================

# πŸ—οΈ Due to the ordering of transactions across multiple rollups, 
# the Rollup ID is required to identify the target rollup executor.
ROLLUP_ID="nodeinfra_rollup"  # ⚠️ Please update this Rollup ID.

# πŸ’‘ Since wallets support adding only a single network RPC URL, Secure-RPC must provide 
# all the methods that would be accessible without it when directly communicating 
# with the blockchain. Therefore, ROLLUP_RPC_URL is used to retrieve rollup information 
# and forward it to the wallet or client.
ROLLUP_RPC_URL="http://131.153.159.15:8123"  # 🌐 Please update this Rollup RPC URL.

# ============================
# πŸ”„ Sequencer Configuration
# ============================

# 🎯 Used to identify the target IP of the transaction orderer (tx. orderer) 
# responsible for receiving encrypted transactions and responding with order commitments.
SEQUENCER_RPC_RPC_URL="http://127.0.0.1:7777"  # 🌐 Please update this Sequencer (external) RPC URL.

# ============================
# πŸ” Encrypted Transaction Type
# ============================

# πŸ” Specifies the cryptographic scheme used for encrypting the user's transactions.
# Options: skde / pvde
ENCRYPTED_TRANSACTION_TYPE="skde"

# ============================
# πŸ”‘ DKG (Distributed Key Generator)
# ============================

# πŸ”“ Used for retrieving SKDE parameters, encryption keys, and decryption keys from the DKG.
DISTRIBUTED_KEY_GENERATOR_RPC_URL="http://127.0.0.1:7100"  # 🌐 Please update this Distributed Key Generator (external) RPC URL.

Last updated