Skip to main content

Check missing sweeps for a given BLS key

Users can run the following script to check if there is some discrepancy in sweeps reported to Stakehouse Protocol for a BLS key that has exited, and the sweeps recorded on the Beacon chain before trying to claim unstaked rewards.

Copy the script to find missing sweeps

You can find the script as a part of the stakehouse-sdk package.

  1. Install stakehouse-sdk in your working directory by running npm i @blockswaplab/stakehouse-sdk in your terminal.
  2. Go to the node modules of your directory and find @blockswaplab folder.
  3. Go to stakehouse-sdk, then scripts and copy checkSweepDifference.js to your working directory.

Install the required dependencies

Install the packages required for running the script by running the following in your terminal

npm i ethers@5.5.3 graphql-request fs axios prompt-sync dotenv

Create the .env file

Create a .env file with the following variables:

  • INFURA_PROJECT_ID: Your Infura Provider project ID
  • INFURA_PROJECT_SECRET: Your Infura Provider secret
  • PRIVATE_KEY: Your private key
  • BEACON_NODE_MAINNET: Beacon node RPC URL for mainnet

NOTE: The following example uses Infura provider. If you wish to use any other provider, feel free to make changes to the script accordingly. You can check out the list of providers suppported by ethers here

Run the script

Now you can run the following command to run the script

node checkSweepDifference.js

The script will prompt you to enter your BLS key. Once you enter the BLS key, the script writes the sweep reort data into a mainnet-sweeps.json file.

In case the difference in sweeps reported is greater than 0.05 ETH, a sweep-difference.json file will also be created. The user must report the missing sweeps using the balance reporting module in this case before claiming the unstaked rewards.