Rayls DocsRayls Custody API
Rayls Docs

Adding new participants

Overview

This guide provides instructions for Private Network Operators on adding a new participant Rayls Privacy Node to a Rayls Private Network. The process involves registering the participant in the network governance system and ensuring secure communication with the Private Network Hub.

Rayls Private Networks are designed for financial institutions requiring a secure, private, and scalable blockchain infrastructure. Adding new participants allows institutions to expand the network, enabling more entities to securely interact while preserving privacy and complying with the Private Network governance rules.

Pre-requisites

Ensure the following before adding a new participant Rayls Privacy Node:

  • The Rayls Private Network must be fully deployed and functioning, with the required contracts already in place on the Private Network Hub.
  • A WSL or Linux-based system with Make installed.
  • Have the following information available:
    • Private Network Hub Info:
      • COMMIT_CHAIN_URL: RPC node URL of Private Network Hub
      • COMMIT_CHAIN_ID: Chain ID of Private Network Hub
      • PRIVATE_KEY_SYSTEM: The private key used for the Private Network Hub contract deployment, known to the Private Network Operator.
      • PARTICIPANT_STORAGE_ADDRESS: Address found in the ParticipantStorageContract or RELAYER_COMMITCHAIN_PARTICIPANTSTORAGECONTRACT, provided by the Rayls Privacy Node owner.
    • Participant PL To Be Added:
      • PARTICIPANT_CHAIN_ID: The unique chain ID assigned to the participant’s Rayls Privacy Node.
      • PARTICIPANT_NAME: The name of the participant.
      • PARTICIPANT_ROLE: The role assigned to the participant in the network. There are three types of roles:
        • Participant (0): A standard role for entities that can transact within the Private Network but do not have any special permissions.
        • Issuer (1): A participant that can issue new tokens or digital assets within the Private Network.
        • Auditor (2): A role for entities that are responsible for reviewing and validating transactions, usually with read-only access to certain data for compliance purposes.

Step-by-Step

Follow these steps to add a new participant Rayls Privacy Node to a Rayls Private Network:

1. Participant Configuration

Set the Variables:

Configure the environment variables based on the provided information:

# Private Network Hub Info

export PRIVATE_KEY_SYSTEM=\<commit_chain_private_key>  
export PARTICIPANT_STORAGE_ADDRESS=\<provided_storage_contract_address> 

# Participant PL Info

export PARTICIPANT_CHAIN_ID=\<provided_chain_id>  
export PARTICIPANT_NAME="Provided Participant Name"  
export PARTICIPANT_ROLE=\<role_number>

2. Add the Participant Using Docker Compose

Update the Docker Compose Configuration:

Add a new service in the Docker Compose file to handle participant addition:

add-participant: image: registry.parfin.io/rayls-contracts:v1.8.6  
command: ["addParticipant"]  
environment: 

- RPC_URL_NODE_CC=              \<input Commit Chain's RPC node URL>
- NODE_CC_CHAIN_ID=             \<input Commit Chain's chain id>
- PRIVATE_KEY_SYSTEM=           \<input Commit Chain's private key> 
- PARTICIPANT_STORAGE_ADDRESS=  \<input Commit Chain's participant storage contract address>
- PARTICIPANT_CHAIN_ID=         \<input participant's chain id>
- PARTICIPANT_NAME=             \<input participant's name>
- PARTICIPANT_ROLE=             \<choose role Issuer(0)| Participant(1)| Auditor(2)>
- PARTICIPANT_OWNER_ADDRESS=    \<input participant's owner address>

Execute the Addition Command:

Run the following command to add the participant:

make add-participant

Confirm Success:

If successful, you will see the output: Participant Successfully added!

If the participant already exists, an error message will indicate: Participant already exists.

Here is an example of the error message:

  code: 'CALL_EXCEPTION',  
  action: 'estimateGas',  
  data: '0x08c379a00000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000001a5061727469636970616e7420616c726561647920657869737473000000000000',  
  reason: 'Participant already exists',  
  transaction: {  
    to: '0x6548DB08755D22537D731980F030E2707eC71c96',  
    data: '0x7b7dae1f000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000186355c80000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000e0000000000000000000000000000000000000000000000000000000000000002a30783030303030303030303030303030303030303030303030303030303030303030303030303030303000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001268656e72697175652d626163656e2d706f630000000000000000000000000000',  
    from: '0xf9260C378ea6E428A79EAfe443BD24EA09Af8Bc9'  
  },  
  invocation: null,  
  revert: {  
    signature: 'Error(string)',  
    name: 'Error',  
    args: [ 'Participant already exists' ]  
  },  
  shortMessage: 'execution reverted: "Participant already exists"',  
  info: {  
    error: {  
      code: -32000,  
      message: 'Execution reverted: Participant already exists',  
      data: '0x08c379a00000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000001a5061727469636970616e7420616c726561647920657869737473000000000000'  
    },  
    payload: {  
      method: 'eth_estimateGas',  
      params: [Array],  
      id: 3,  
      jsonrpc: '2.0'  
    }  
  }  
}