Run DKG
Repository: Distributed Key Generation GitHub
Clone the repository
git clone https://github.com/radiusxyz/distributed_key_generationBuild the binary
cd distributed_key_generation cargo build --releaseSet up environment variables in
./scripts/execute/env.sh.Initialize the system:
./scripts/execute/01_init_key_generator.shStart the system:
./scripts/execute/02_run_key_generator.shSet up environment variables in
./scripts/rpc-call/env.sh.Initialize RPC: This action serves for registering a key generator by submitting its address and RPC endpoints to an internal system.
./scripts/rpc-call/10_initialize.sh
Environment Variables
distributed_key_generation/scripts/execute/env.sh
#!/bin/bash
#!/bin/bash
CURRENT_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="key-generator"
BIN_PATH="$PROJECT_ROOT_PATH/scripts/$BIN_FILE_NAME"
DATA_PATH=$PROJECT_ROOT_PATH/data
CONFIG_FILE_PATH=$DATA_PATH/Config.toml
PRIVATE_KEY_PATH=$DATA_PATH/signing_key
# 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: Keygenerator 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
# Below are the environment variables required for setting up the Distributed Key Generator.
# ============================
# 🔄 RPC Endpoints
# ============================
# Internal RPC URL
# Used to add a node to the Distributed Key Management System (DKG).
KEY_GENERATOR_INTERNAL_RPC_URL="http://127.0.0.1:7200" # Internal IP - Please change this IP.
# Cluster RPC URL
# Used for communication within the DKG cluster.
KEY_GENERATOR_CLUSTER_RPC_URL="http://127.0.0.1:7300" # External IP - Please change this IP.
# External RPC URL
# Used for retrieving SKDE parameters, encryption keys, and decryption keys from the DKG.
KEY_GENERATOR_EXTERNAL_RPC_URL="http://127.0.0.1:7100" # External IP - Please change this IP.
# ============================
# 🔑 Wallet Address
# ============================
# Key Generator Address
# Used to retrieve the list of RPC URLs from the seeder,
# registered through the Liveness Radius contract (TBD).
KEY_GENERATOR_ADDRESS="0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266" # Please change this key generator address.
Last updated