This tutorial walks you through launching a private local network and promoting one of the nodes in that network to a full validator. This guide results in a simple deployment of a few validators and one RPC. If you want more control over the network, and additional services such as block explorers and PoL backends, refer to Local Devnet with Kurtosis.Documentation Index
Fetch the complete documentation index at: https://berachain-422fce37-feat-nodes-section-reno.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
Requirements
Before starting, ensure that you have the following installed on your computer:- Have read and understood the validator activation process
- Docker
version 25.0.2or greater - Foundry
v1.0.0or greater - MacOS — This script is made for Mac but can be modified to work with Linux
Launch local devnet
You will launch multiple Docker containers that contain execution and consensus clients for a test chain initialized from genesis.Step 1 - Obtain and build source
env.sh file, which contains important variables for running the docker-devnet and deposit testing.
CHAIN_SPEC and CHAIN_ID are used to influence the configuration of the deployed beacond. Valid values for CHAIN_SPEC are mainnet, testnet and file. The file specification uses the CHAIN_ID to look up a chainspec file in templates/beacond.
Build the Docker devnet images:
Step 2 - Start containers and monitor chain activity
Start the devnet:docker ps to view the launched containers and verify that the services are running:
Step 3 - Generate deposit scripts
Invoke the deposit script to generate the deposit transactions (but do not transmit them). The script provides twocast calls and a command to view the current validator set. There are two types of deposits: 1) initial registration and 2) top-up.
Step 4 - Run registration deposit transaction
Transmit the firstcast call, which calls deposit() for the first time with an initial stake of 10,000 $BERA.
Step 5 - Run activation deposit transaction
Send the second suggestedcast call, which stakes an additional 240,000 $BERA, sufficient to put the validator into the activation queue.
Step 6 - Observe activation
Continue to monitor the chain’s progress for three complete 10-block epochs. Upon activation, the validator status will change toactive_ongoing — fully active and eligible to propose blocks.
Step 7 - Send withdrawal transaction
Generate the withdrawal transactions:Step 8 - Send exit transaction
Using the provided call to exit the validator, you will see the validator state immediately changes toexited_unslashed state, meaning the validator can no longer produce blocks. After the required delay in epochs, the validator’s remaining stake is returned, and the status rests at withdrawal_done.