Giter Club home page Giter Club logo

sepolia-deploy's Introduction

Деплой ноды Sepolia / Goerli | draft

не валидаторская!

Структурно нода (ethereum client) состоит из двух элементов:

  • Execution client (Geth, Nethermind, Besu, Erigon)
  • Consensus client (Lighthouse, Lodestar, Nimbus, Prysm, Teku)

Рассмотрим простейший пример связки Geth + Lighthouse / Prysm.

Клиент Goerli деплоится аналогичным образом после изменения некоторых параметров.

Geth

Добавляем репо + ставим Geth

sudo apt install software-properties-common
sudo add-apt-repository -y ppa:ethereum/ethereum
sudo apt-get update
sudo apt-get install ethereum

geth version

Каталог Geth

mkdir $HOME/ethereum/execution

Создаем сервис клиента Sepolia (синхронизация со снапа, для запуска полной ноды добавляем ключ --syncmode full. Информация о ключах)

sudo tee /etc/systemd/system/geth.service > /dev/null <<EOF
[Unit]
Description=Ethereum go client
After=network.target 
Wants=network.target

[Service]
User=root 
Group=root
Type=simple
Restart=always
RestartSec=5
ExecStart=/usr/bin/geth --sepolia --port 30303 --http --http.api debug,eth,net,web3,txpool --http.addr 0.0.0.0 --authrpc.port 8551 --ws --ws.api debug,eth,net,web3,txpool --ws.addr 0.0.0.0 --datadir /root/ethereum/execution --authrpc.jwtsecret /root/ethereum/execution/geth/jwtsecret --bootnodes "enode://9246d00bc8fd1742e5ad2428b80fc4dc45d786283e05ef6edbd9002cbc335d40998444732fbe921cb88e1d2c73d1b1de53bae6a2237996e9bfe14f871baf7066@18.168.182.86:30303,enode://ec66ddcf1a974950bd4c782789a7e04f8aa7110a72569b6e65fcd51e937e74eed303b1ea734e4d19cfaec9fbff9b6ee65bf31dcb50ba79acce9dd63a6aca61c7@52.14.151.177:30303"

[Install]
WantedBy=default.target
EOF

Стартуем

sudo systemctl daemon-reload
sudo systemctl enable geth.service
sudo systemctl restart geth.service && journalctl -u geth.service -f -o cat

Далее на выбор рассмотрим два консенсус клиента Lighthouse и Prysm.

Lighthouse

Качаем последний релиз

wget https://github.com/sigp/lighthouse/releases/download/v4.0.1/lighthouse-v4.0.1-x86_64-unknown-linux-gnu.tar.gz

tar -C /usr/local/bin/ -vxzf lighthouse-v4.0.1-x86_64-unknown-linux-gnu.tar.gz

lighthouse --version

Сервис (синхронизация с чекпойнта, для запуска полной ноды убираем ключ --checkpoint-sync-url). Документация

Необходим корректный путь JWT Secret! --execution-jwt /root/ethereum/geth/geth/jwtsecret

sudo tee /etc/systemd/system/lighthoused.service > /dev/null <<EOF
[Unit]
Description=Lighthouse Beacon Node
After=network.target 
Wants=network.target

[Service]
User=root
Group=root
Type=simple
Restart=always
RestartSec=5
ExecStart=/usr/local/bin/lighthouse bn --network sepolia --execution-endpoint http://localhost:8551 \
--execution-jwt /root/ethereum/execution/geth/jwtsecret --checkpoint-sync-url https://checkpoint-sync.sepolia.ethpandaops.io \
--disable-deposit-contract-sync

[Install]
WantedBy=default.target
EOF

Запускаем

sudo systemctl daemon-reload
sudo systemctl enable lighthoused.service
sudo systemctl restart lighthoused.service && journalctl -u lighthoused.service -f -o cat

В случае если на хосте уже имеется запущенный клиент Lighthouse (распространенная ситуация в докер клиентах) запуск второго невозможен. В этом случае следует использовать альтернативный клиент. Рассмотрим в качестве такового Prysm

Prysm

Ставим Prysm

cd $HOME
mkdir -p $HOME/ethereum/consensus
mkdir $HOME/ethereum/execution

cd ethereum/consensus
mkdir prysm && cd prysm---
curl https://raw.githubusercontent.com/prysmaticlabs/prysm/master/prysm.sh --output prysm.sh && chmod +x prysm.sh

Генерируем JWT Secret

./prysm.sh beacon-chain generate-auth-secret

Качаем генезис Sepolia

wget -O genesis.ssz https://github.com/eth-clients/merge-testnets/blob/main/sepolia/genesis.ssz?raw=true

Привожу для примера, запускать не надо, все запихнем в сервис.

Строка запуска Geth. Обращаю внимание на необходимость изменения ключа --authrpc в сервисе geth созданном ранее.

geth --sepolia --http --http.api eth,net,engine,admin,web3 --authrpc.jwtsecret /root/ethereum/consensus/prysm/jwt.hex

Строка запуска Prysm. Меняем ключ --suggested-fee-recipient на свой ERC20 адрес

./prysm.sh beacon-chain --execution-endpoint=http://localhost:8551 --sepolia \
--suggested-fee-recipient=0x01234567722E6b0000012BFEBf6177F1D2e9758D9 --jwt-secret=jwt.hex --genesis-state=genesis.ssz

Закидываем скрипт в сервис (синхронизация с чекпойнта, для запуска полной ноды убираем ключ --checkpoint-sync-url).

sudo tee /etc/systemd/system/prysm.service > /dev/null <<EOF
[Unit]
Description=Ethereum go client
After=network.target 
Wants=network.target

[Service]
User=root 
Group=root
Type=simple
Restart=always
RestartSec=5
ExecStart=/root/ethereum/consensus/prysm/prysm.sh beacon-chain --execution-endpoint=http://localhost:8551 --sepolia \
--checkpoint-sync-url=https://checkpoint-sync.sepolia.ethpandaops.io --suggested-fee-recipient=<0x56...06483> \
--jwt-secret=jwt.hex --genesis-state=genesis.ssz

[Install]
WantedBy=default.target
EOF

Стартуем

sudo systemctl daemon-reload
sudo systemctl enable prysm.service
sudo systemctl restart prysm.service && journalctl -u prysm.service -f -o cat

compiled by road

sepolia-deploy's People

Contributors

ryssroad avatar

Stargazers

 avatar SNSMLN avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.