Skip to main content

Tutorial: Node Runner Provisioning For Gated LSD Networks

This SDK tutorial will guide you through how to configure and provision node runners in your gated LSD network.

Assumptions

  1. You have deployed an LSD network. If not, you can use our deployer: https://deploylsd.joinstakehouse.com/
  2. You are comfortable with using the LSD wizard SDK in a JS / TS script

Pre-requisites

Your script will require installing the LSD wizard SDK which uses Ethers.js version 5 signers. We are working on version 6 support.

To install the Wizard SDK and Ethers.js, you can use your favourite package manager such as yarn:

yarn add @blockswaplab/lsd-wizard [email protected]

The SDK is a typescript SDK so we will show you a step by step guide in typescript.

Step by step guide

1) Firstly we need to intialize the SDK within a basic script

import { Wizard } from '@blockswaplab/lsd-wizard';
async function main() {
const settings = { signerOrProvider: yourEthersSigner };
const sdk = new Wizard(settings);
}
main();

It is assumed you have already got an ethers signer ready to go. Otherwise create one from scratch like this tutorial

2) Collect the required information for your transaction

Your transaction will require:

  • The smart contract address of your LSD Manager contract that was deployed when your LSD network was deployed
  • The list of the node runner(s) Ethereum address(es) that you will be provisioning or banning

If you are unsure what your LSD Manager address is, then please use the LSD subgraph: https://thegraph.com/hosted-service/subgraph/stakehouse-dev/lsd

Here's a query you can run where you filter by the ticker of your LSD network:

{
liquidStakingNetworks(where: { ticker: "DENVR" }) {
liquidStakingManager
}
}

3) Fire the transaction

Notice the updated settings that includes the liquid staking manager:

import { Wizard } from '@blockswaplab/lsd-wizard';
async function main() {
const settings = { signerOrProvider: yourEthersSigner, liquidStakingManagerAddress: '' };
const sdk = new Wizard(settings);
const nodeRunnerAddresses: Array<string> = [];
const enabled: boolean = true; e; // Set to false if you are removing the node operators in the ar
const transaction = await sdk.utils.updateNodeRunnerWhitelistStatus(nodeRunnerAddresses, enabled);
console.log(`Transaction hash: ${transaction.hash}`);
}
main();

That's it

That's all you need to do to manage the gatekeeping of the node operators in your LSD network. The node operators that are added to the inclusion list for your LSD network will be able to propose BLS keys to the LSD network whilst those not in the inclusion list will not be able to register their BLS keys or join from outside the LSD network.