Skip to content

Ejector Client

The Ejector service plays an important role in PLS LSD stack. As users are free to unstake vPLS and withdraw PLS at anytime, the system needs to dynamically responed to these demands. Every validator should run an ejector service to properly handle the validator exiting process to facilitate the user requirements.

Installation

Install Build Tools

On your Validating Node make sure you have the following tools installed, you will need these to continue.

Install makegcc and git

bash
sudo apt update
sudo apt install -y make gcc git build-essential

Install Go

Here we will install Go and set the environment variables:

  • Existing Go version binary will be removed
  • Go will be installed in /usr/local/go
  • the downloaded zipped file will be deleted
  • File Path locations will be added to .bashrc
bash
cd $HOME
wget -O go1.21.3.linux-amd64.tar.gz https://go.dev/dl/go1.21.3.linux-amd64.tar.gz
sudo rm -rf /usr/local/go && sudo tar -C /usr/local -xzf go1.21.3.linux-amd64.tar.gz && rm go1.21.3.linux-amd64.tar.gz
echo 'export GOROOT=/usr/local/go' >> $HOME/.bashrc
echo 'export GOPATH=$HOME/go' >> $HOME/.bashrc
echo 'export GO111MODULE=on' >> $HOME/.bashrc
echo 'export PATH=$PATH:/usr/local/go/bin:$HOME/go/bin' >> $HOME/.bashrc && . $HOME/.bashrc
go version

If you have issues with the above you can always install go by following the official docs. Remember to set your $PATH environment variable, see above example.

Install Ejector Client

Below we will clone the requried Ejector repo from the Vouch github repository and install it.

  • repo will be cloned into ~/pls-lsd-ejector
  • install script will download required components and create an Ejector binary file called pls-lsd-ejector
bash
cd $HOME
git clone https://github.com/Vouchrun/pls-lsd-ejector.git
cd pls-lsd-ejector
make install

This will install the pls-lsd-ejector application in the default GOPATH location which is ~/go/bin. If you wish to change the applications location, simply move it to the location of your choice e.g. /blockchain/ejector

Running the Ejector Client

There are some configuration items which need to be set to run the Ejector Client. We will pass these items to the client at startup.

Configuration Items

💡 The below exmaples are using Geth and Lighthouse, you will need to make sure the ports used match your client configuration.

configdescriptionexample value
execution_endpointExecution RPC endpointhttp://127.0.0.1:8545
consensus_endpointConsensus (Beacon chain) RPC endpointhttp://127.0.0.1:5052 or public RPC
keys_dirkeystore path created by pulse-staking-deposit-cli./validator_keys
withdraw_addressContract address of NetworkWithdraw0xNETWORK_WITHDRAW

Withdraw Address Setting: 0xNETWORK_WITHDRAW

Prority Fee Address Setting: 0xFEE_POOL

Start Command

⚠️ You will need your Keystore password (the password you used when creating your keys), as we will be passing this to the client at startup when prompted.

bash
pls-lsd-ejector start \
    --consensus_endpoint 'BEACON_CHAIN_RPC_ENDPOINT' \
    --execution_endpoint 'EXECUTION_RPC_ENDPOINT'  \
    --keys_dir ./validator_keys \
    --withdraw_address '0x_NETWORK_WITHDRAW_CONTRACT_ADDR'

When you run the Ejector client using the above command, you will be requried to input the password used to secure the keystores running on the validator:

> Enter the password for your imported accounts:

That is it, just make sure the Ejector client runs at all times!

Additional Configuration and Start Options

Running using Tmux

It is preferred to run your Ejector client using something like systemd TMUX or Screen which will give you more control and flexibilty when running the client. You can use TMUX by doing the following:

💡 If you are unfamiliar with Running TMUX you should learn how to navigate it first before running the below commands. This TMUX guide might help.

sudo apt install tmux
tmux new-session -s ejector

Then Issue the above Start Command in the TMUX terminal using the instructions in the preceeding section.

When Using Complex or Custom keys_dir Paths

If your environment has mulitple keys_dir locations or you have used multiple keystore passwords, it is possible to run mulitple version of the ejector client on the same Node. The ejector will also detect keystores in subdirectories if required.

In this case TMUX will be a big help for starting and monitoring your Ejector client.