Rayls DocsRayls Custody API
Rayls Docs

Freezing participants

Overview

This guide covers the process of freezing and unfreezing a participant in a Rayls Private Subnet. Freezing a participant restricts their ability to initiate transactions or interact with the network, while unfreezing restores their full operational capabilities. These actions are typically used for compliance purposes, risk mitigation, or in response to suspicious activity.

Freezing and unfreezing a participant involves updating their status on the Subnet Hub, which is governed by the subnet’s rules. The process ensures that any unauthorized or risky behavior can be swiftly addressed, helping to maintain the security and integrity of the network.

Pre Requisites

Before proceeding with the freezing or unfreezing of a participant, ensure the following requirements are met:

  • Operational Private Subnet and Subnet Hub:
    • The Rayls Private Subnet and Subnet Hub must be fully deployed and operational.
    • The participant in question should already be registered and active in the network.
  • Access Requirements:
    • The Subnet Operator must have the necessary permissions to update the participant's status on the Subnet Hub.
    • Access to the governance smart contracts for managing participant states.
  • Environment Setup:
    • A development environment with Hardhat installed for executing scripts.
  • Required Information:
    • The public key of the participant to be frozen or unfrozen.
    • The contract address of the governance smart contract.
  • Scripts and Tools:
    • Access to scripts or commands for freezing and unfreezing participants, configured for the environment.

Step-by-Step

Follow these steps to freeze or unfreeze a participant within a Rayls Private Subnet:

1: Verify the Participant's Current Status

Check the Participant's Status:

Use the list-participants command to verify the participant's current status on the Subnet Hub and confirm whether they are active or frozen.

Example:

npx hardhat list-participants --public-key \<PARTICIPANT_PUBLIC_KEY> --contract-address \<GOVERNANCE_CONTRACT_ADDRESS> --network <network-name>

This command will list the participants along with their statuses, helping to determine whether freezing or unfreezing is needed.


2: Freezing the Participant

Freeze the Participant:

If the participant is currently active, use the freeze-participant command to freeze them. This action will restrict the participant from initiating any new transactions.

The following environment variables can be used if they are already configured:

  • PARTICIPANT_STORAGE_ADDRESS: The contract address of the deployed ParticipantStorage contract on the Subnet Hub.
  • RPC_URL_NODE_CC: The node URL of the Subnet Hub.
  • PRIVATE_KEY_SYSTEM: The Subnet Operator’s private key (the same one used to deploy the Subnet Hub contracts).

If the environment variables are not set, or you wish to use specific values without overriding your existing .env configuration, use command flags to define or override these values:

Example:

npx hardhat freeze-participant --participantChainId <chainId> --rpcUrlNodeCc <yourCCRpcURL> --contractAddress <yourParticipantStorageAddress> --privateKeySystem <yourPrivateKey>

Success:

✅ The participant with chain ID <chainId> has been successfully frozen.

Confirm the Freezing Status:

Verify the participant's status command again (list-participants) to ensure they are now marked as frozen.


3: Unfreezing the Participant

Unfreeze the Participant:

If the participant is frozen, use the freeze-participant command with the --unfreeze flag to restore the participant's ability to interact with the network.

Example:

npx hardhat freeze-participant --unfreeze --participantChainId <chainId>

Optionally, if specific values are needed, use the command flags as described for the freezing step.

Success Message:

✅ The participant with chain ID <chainId> has been successfully unfrozen.

Verify the Unfreezing Status:

Verify the participant's status command again (list-participants) to ensure they are now marked as unfrozen.