exSat Network
  • ๐Ÿ”—Important Links
  • ๐ŸŒŒOur Approach
    • What is exSat
      • exSatโ€™s Docking Layer Approach
      • The Paradigm Shift of the Bitcoin Economic Ecosystem
      • Challenges Addressed by exSat
    • Architecture
      • Data Consensus Protocol
        • Network launch phases
        • Decentralized UTXO index
        • Synchronizers and Validators
        • Hybrid Consensus Mechanism
        • Decentralized execution
      • Decentralized Asset Custody (Coming soon)
      • Enhancing the Bitcoin Ecosystem with Smart Contract Capabilities
      • Expanding Possibilities with Rollups
    • $XSAT Tokenomics
      • Total Supply and Issuance
      • Rewards to Synchronizers and Validators
  • ๐Ÿ› ๏ธGuides of Data Consensus
    • Quick Start
    • UTXO Initialization
      • Data preparation
      • Analysis on the UTXO data tobe uploaded
      • Verify the data uploaded to exSat
    • Run a Sychronizer
      • Requirements for Synchronizers
      • Rewards for synchronizers
      • Run as Synchronizer
        • Run from source code
        • Run with Docker
    • Run a BTC Validator
      • Requirements and rewards for BTC Validators
      • Run as BTC validator
        • Run from source code
        • Run with docker
    • Run a XSAT Validator
      • Run as XSAT Validator
        • Run from source code
        • Run with docker
      • Run multiple XSAT Validators
    • Others
      • Operation references
        • Preparation Before You Start
          • Account Preparation
          • Run a BTC node
          • Environment requirements
          • Prerequisites
        • Synchronizer operations
          • Create New Synchronizer Account
          • Synchronizer Registration
          • Execute the synchronizer client
          • Revote For Consensus
          • Change Reward Address
          • Check and claim rewards for synchronizer
          • Update to new Docker version for Synchronizer
        • Validator operations
          • Create New BTC Validator Account
          • Create New XSAT Validator Account
          • Stake for Validator and claim rewards
          • Change Stake Address
          • Change Commission Address
          • Change Commission Ratio
          • Configure Display Information for Your Validator Account
          • Execute the validator client
          • Update to new Docker version for Validator
        • Common operations
          • Import from seed phrase
          • Import from Private Key
          • Set BTC RPC Node
          • Refill BTC for Gas Fees
          • Export private key
          • Remove Your Account
          • Upgrade to new version
          • View Logs
          • Environment variables
  • ๐Ÿ‘จโ€๐Ÿ’ปDeveloper Guides
    • Quick Start
    • Native Layer Developer Guides
      • exSat consensus contracts
        • Pool Register Contract
        • UTXO Management Contract
        • Reward Distribution Contract
        • Block Consensus Contract
        • Block Synchronization Contract
        • Validator Management Contract
        • Staking Contract
      • Run exSat native layer RPC Node
  • ๐Ÿ–ฅ๏ธUser Guides
    • Wallet Setup
    • Bridge Your Assets
    • Earn Rewards via BTC Staking
    • Explore Our Ecosystem
  • Popular Token Contract Addresses
  • ๐Ÿ“šReference
  • ๐Ÿ“ฆCutodian Guides
  • ๐Ÿ”Security Reports
    • Audit Report From Blocksec
  • ๐Ÿ”กTerms and Conditions
    • Terms Of Service
    • Privacy Policy
  • ๐ŸŽPR & Press
  • โ˜Ž๏ธContact US
Powered by GitBook
On this page
  • Roles Within the Company
  • Assumptions
  • Preparations Before Operation
  • Batch Operation Steps
  1. Guides of Data Consensus
  2. Run a XSAT Validator

Run multiple XSAT Validators

PreviousRun with dockerNextOthers

Last updated 1 day ago

If your company plans to operate multiple XSAT Validator nodes, follow this structured approach to streamline the process:

Roles Within the Company

  • Operations Team: Handles the initialization of XSAT Validator accounts and manages node operations.

  • Finance Team: Manages XSAT (for staking) and BTC (for gas fees) and oversees the collection of XSAT rewards.

Assumptions

  1. You aim to run 10 nodes named sat1, sat2, sat3, ..., sata on a single server.

Preparations Before Operation

1. Server Setup

For running 10 XSAT Validator nodes, the recommended server configuration is:

  • CPU: 2 cores

  • RAM: 8 GB

  • Disk: 40 GB

Ensure that all necessary is installed on the server.

2. Account Setup

The finance team should prepare the following accounts:

  • Stake Account:

    • Should hold at least 21,000 XSAT (2,100 XSAT per validator) for staking.

    • Should hold sufficient BTC to cover gas fees (approximately 0.0005 BTC per validator per month according to current gas fee level).

    • The private key for this EVM account is retained exclusively by the finance team.

  • Temporary Account:

    • Used specifically to pay network resource fees for creating XSAT Validator accounts.

    • Each XSAT Validator account requires 0.000102 BTC (0.0001 BTC for creating the exSat Validator account and 0.000002 BTC for gas fee) for creation. For 10 validators, prepare at least 0.00102 BTC.

    • The private key for this account should be shared with the operations team to facilitate account creation.

3. BTC Node Setup

Batch Operation Steps

1. Initialize the XSAT Validator Accounts

Clone the Repository and Configure the .env File

git clone https://github.com/exsat-network/batch-reg-xsat-validators
cd batch-reg-xsat-validators
cp .env.example .env
vim .env

Configure the .env File

Below is an example .env file. Update the values as needed. By default, it is configured for the mainnet, but you can modify it for the Hayek testnet if required.

# Network name | testnet
NETWORK=mainnet

# exsat node |testnet https://chain-tst3.exactsat.io
EXSAT_RPC_URLS=["https://rpc-us.exsat.network"]

# exsat-evm node and chainId | testnet https://evm-tst3.exsat.network
EVM_RPC_URL=https://evm.exsat.network

# exsat-evm node and chainId | testnet 839999
EVM_CHAIN_ID=7200

# Private key of the Tempory account - starts with 0x,needs sufficient BTC for creating exSat Validator accounts (e.g., 10*0.0001 BTC for 10 exSat Validators)
PRIVATE_KEY=0x00000000000

# Stake Address, needs sufficient $XSAT for staking & $BTC for refilling gas fees, starts with 0x
# Only Address is needed
STAKER_REWARD_ADDRESS=0x00000000000

# Path to the keystore files exsited,e.g.,"./keystores"
KEYSTORE_PATH="."

# Password for the keystore files generated.
# All keystore files share the same password
KEYSTORE_PASSWORD=123456

# rpc url of bitcoin node, configure the username and password if needed
BTC_RPC_URL=http://your-btc-rpc:8332
BTC_RPC_USERNAME=
BTC_RPC_PASSWORD=

# XSAT Validator account prefix to generate, 
# example: ACCOUNT_PREFIX=ex, the account name will be ex1.sat, ex2.sat, ex3.sat, ...
# the prefix can't be longer than 6 characters. 
# Charaters allowed: a-z, 1-5
ACCOUNT_PREFIX=ex

# Number of XSAT Validator accounts to generate
TOTAL=10

# Amount of xsat tokens for registering one xsat staker, don't modify this.
DEPOSIT_AMOUNT=2100000000000000000000

# testnet contract 0xe9C82be5C9eD3Cee4B99465Bec857395D0d0e502
XSAT_STAKE_HELPER_CONTRACT=0x10CECB61325db0C49201Fc72c50c27AeBd0Ac523

Required Parameters:

  • KEYSTORE_PATH: The directory path to store keystore files. Use a relative path, such as ./keystores, as an example. The keystore file securely stores the private key of the XSAT Validator account. It is encrypted and requires the "KEYSTORE_PASSWORD" for decryption.

  • KEYSTORE_PASSWORD: The password for the keystore files. All keystore files share the same password.

  • BTC_RPC_URL: The URL of your BTC RPC node. If authentication is required, also provide:

    • BTC_RPC_USERNAME

    • BTC_RPC_PASSWORD

  • ACCOUNT_PREFIX: The prefix for your XSAT Validator account names. The complete account names will include this prefix followed by sequential numbers or letters. e.g., If ACCOUNT_PREFIX is "ex" , the XSAT Validator names will be "ex1.sat", "ex2.sat", ... "exa.sat" in our example. Notes on ACCOUNT_PREFIX:

    • The total length must not exceed 6 characters.

    • It can only include lowercase letters (a-z) and numbers (1-5).

  • TOTAL: The total number of XSAT Validators to create. For example, set this to 10 to run 10 validators.

Why Separate the Temporary Account and Stake Account? Why Provide the Private Key for the Temporary Account but Only the Address for the Stake Account?

This separation ensures both security and convenience.

Organizations operating multiple XSAT Validators need a clear division of responsibilities between the operations and financial teams.

The operations team handles the deployment and management of XSAT Validators on servers. To streamline this process, the fees for registering XSAT Validator accounts are kept in the Temporary Account. The private key for this account is provided to the script used for batch registration, simplifying operations. Since the Temporary Account contains only enough funds for account registration, it's secure to supply the private key here.

In contrast, the Stake Account holds substantial funds, including XSAT for staking and BTC for gas fees, and is managed by the financial team. For enhanced security, only the Stake Account address is required. The financial team can connect the Stake Account to the dApp interface to perform staking and top up gas fees. Thus, providing just the Stake Account address in the script is sufficient and secure.

Generate XSAT Validator Accounts

Create the KEYSTORE_PATHfolder, take "keystores" in current folder as example.

mkdir keystores

To generate XSAT Validator accounts, execute the following commands:

yarn install  
yarn cracc

This command performs the following actions:

  1. Generate Keystore Files:

    • Creates a private key for each XSAT Validator.

    • Saves the private keys as encrypted keystore files in the KEYSTORE_PATH folder.

    • Secures each keystore file with the KEYSTORE_PASSWORD.

  2. Account Creation:

    • Uses the Temporary Account to cover the on-chain resources required for account creation.

    • Uses the Temporary Account to Create the XSAT Validator accounts on-chain, with names prefixed by ACCOUNT_PREFIX.

After executing these commands, you will have 10 XSAT Validator accounts on the exSat network. The private keys of these accounts will be securely stored as keystore files in the KEYSTORE_PATH directory, and the keystore files will be encrypted with the KEYSTORE_PASSWORD.

2. Stake for Validators and Refill Gas Fees

This task should be handled by the financial team.

  1. Use the "Switch" button to toggle between different XSAT Validator accounts as needed.

3. Generate Docker Compose Configuration File and Run Containers in Batch

Modify ognize_cli.sh File

vim ognize_cli.sh

Modify the red parts in the ognize_cli.sh file

  • BASE_DIR: Replace the portion after :- with the path specified in the .env file for KEYSTORE_PATH.

    BASE_DIR="${1:-./keystores}"
  • NETWORK: Ensure the value matches the NETWORK setting in the .env file.

  • EXSAT_RPC_URLS: Update this value to match the EXSAT_RPC_URLS in the .env file.

  • KEYSTORE_PASSWORD: Set this value to match the KEYSTORE_PASSWORD in the .env file.

  • BTC_RPC_URL: Provide the URL of your BTC RPC node.

    • If authentication is required, replace "user" and "password" in BTC_RPC_USERNAME and BTC_RPC_PASSWORD with your BTC RPC credentials.

Execute the Following Commands:

chmod +x ognize_cli.sh
./ognize_cli.sh

This command will do below actions:

  1. Organize Keystore Files:

    • Creates a folder for each XSAT Validator account under the KEYSTORE_PATH.

    • Moves the keystore file for each Validator into its corresponding folder.

  2. Generate docker-compose.yml:

    • Creates a docker-compose.yml file in the KEYSTORE_PATH directory for batch deployment of Docker containers.

After running these commands, the contents of the KEYSTORE_PATH directory will appear as follows:

Start Docker Containers:

Enter the KEYSTORE_PATH folder and Run the command to start the containers. Ensure both Docker and Docker Compose are installed beforehand.

cd keystores
docker compose up -d

After executing the command, your 10 XSAT Validators will be running in Docker containers. You can monitor the logs for each Validator to verify their operations.

2025-02-28T12:25:23.325+00:00 info: ExsatApi initialized successfully.
2025-02-28T12:25:24.051+00:00 info: Validator[xsatval1.sat] client configurations are correct, and the startup was successful
2025-02-28T12:25:25.499+00:00 info: Endorse task is running
2025-02-28T12:25:26.158+00:00 info: Endorse task is finished

A BTC node is required to provide BTC RPC services. Both full nodes and light nodes are supported. Follow to set up a BTC node.

PRIVATE_KEY: The private key of the "", which holds BTC for creating XSAT Validator accounts. To create 10 XSAT Validator accounts, ensure this account has a minimum balance of a little more than 0.001 BTC (10 ร— 0.0001 BTC) and a little more BTC for gas fee). Provide the private key starting with "0x" here.

STAKER_REWARD_ADDRESS: The address of the "", which holds XSAT for staking and BTC for Validator gas fees. To operate 10 XSAT Validators, ensure this account holds at least 21,000 XSAT (10 ร— 2,100 XSAT) and sufficient BTC to refilling gas fees for maintaining these validators. At the current gas fee level, each XSAT Validator requires approximately 0.0005 BTC per month. Just provide the EVM address of the Stake Account here.

Open the and connect to your .

(2100 $XSAT each) and . At the current gas price level, each XSAT Validator requires approximately 0.0005 BTC per month for gas fees.

The finance team can also directly on the same page.

Generates an .env configuration file for each Validator to be used by Docker, you can if needed.

If your Validator Client is operating correctly, the following logs should appear in Docker. Here's :

๐Ÿ› ๏ธ
software
this
Stake XSAT for your XSAT Validator accounts
refill their gas fees
edit the .env file
Temporary Account
Stake Account
Validators Portal
Stake Account
how to view the Docker logs
claim XSAT rewards