August 25
Morph Node Guide | Гайд по ноде Морф
Требования к серверу:
я взяла сервер на хетцнере
Видео гайд на моем youtube
Установка
sudo apt-get update -y && sudo apt upgrade -y && sudo apt-get install make build-essential unzip lz4 gcc git jq -y
#устанавливаем го sudo rm -rf /usr/local/go curl -Ls https://go.dev/dl/go1.22.3.linux-amd64.tar.gz | sudo tar -xzf - -C /usr/local eval $(echo 'export PATH=$PATH:/usr/local/go/bin' | sudo tee /etc/profile.d/golang.sh) eval $(echo 'export PATH=$PATH:$HOME/go/bin' | tee -a $HOME/.profile) go version
mkdir -p ~/.morph cd ~/.morph git clone https://github.com/morph-l2/morph.git #клонируем репощиторий cd morph git checkout v0.2.0-beta make nccc_geth cd ~/.morph/morph/node make build cd ~/.morph wget https://raw.githubusercontent.com/morph-l2/config-template/main/holesky/data.zip #скачиваем конфиги unzip data.zip openssl rand -hex 32 > jwt-secret.txt
wget -q --show-progress https://snapshot.morphl2.io/holesky/snapshot-20240805-1.tar.gz tar -xzvf snapshot-20240805-1.tar.gz mv snapshot-20240805-1/geth geth-data mv snapshot-20240805-1/data node-data rm -rf snapshot-20240805-1.tar.gz
Создаем сервисный файл для Geth:
sudo tee /etc/systemd/system/gethd.service > /dev/null << EOF [Unit] Description=Geth After=network-online.target [Service] User=$USER ExecStart=/root/.morph/morph/go-ethereum/build/bin/geth --morph-holesky --datadir "/root/.morph/geth-data" --http --http.api=web3,debug,eth,txpool,net,engine --http.port 8546 --authrpc.addr localhost --authrpc.vhosts="localhost" --authrpc.port 8551 --authrpc.jwtsecret=/root/.morph/jwt-secret.txt --miner.gasprice="100000000" --log.filename=/root/.morph/geth.log --port 30363 Restart=on-failure RestartSec=10 LimitNOFILE=65535 [Install] WantedBy=multi-user.target EOF
sudo systemctl daemon-reload sudo systemctl enable gethd sudo systemctl start gethd
sudo journalctl -u gethd -f --no-hostname -o cat
Создаем сервисный файл для ноды:
sudo tee /etc/systemd/system/morphd.service > /dev/null << EOF [Unit] Description=Morph Node After=network-online.target [Service] User=$USER ExecStart=/root/.morph/morph/node/build/bin/morphnode --home /root/.morph/node-data \ --l2.jwt-secret /root/.morph/jwt-secret.txt \ --l2.eth http://localhost:8546 \ --l2.engine http://localhost:8551 \ --log.filename /root/.morph/node.log Restart=on-failure RestartSec=10 LimitNOFILE=65535 [Install] WantedBy=multi-user.target EOF
sudo systemctl daemon-reload sudo systemctl enable morphd sudo systemctl start morphd
sudo journalctl -u morphd -f --no-hostname -o cat
curl http://localhost:26657/status
После полной синхронизации ноды переходим к валидаторской ноде
sudo systemctl stop gethd sudo systemctl stop morphd
sudo tee /etc/systemd/system/geth.service > /dev/null << EOF [Unit] Description=Geth for Validator After=network-online.target [Service] User=$USER ExecStart=/root/.morph/morph/go-ethereum/build/bin/geth \ --datadir=/root/.morph/geth-data \ --verbosity=3 \ --http \ --http.corsdomain="*" \ --http.vhosts="*" \ --http.addr=0.0.0.0 \ --http.port=8545 \ --http.api=web3,eth,txpool,net,engine \ --ws \ --ws.addr=0.0.0.0 \ --ws.port=8546 \ --ws.origins="*" \ --ws.api=web3,eth,txpool,net,engine \ --networkid=2810 \ --authrpc.addr="0.0.0.0" \ --authrpc.port="8551" \ --authrpc.vhosts="*" \ --authrpc.jwtsecret=/root/.morph/jwt-secret.txt \ --gcmode=archive \ --metrics \ --metrics.addr=0.0.0.0 \ --metrics.port=6063 \ --miner.gasprice="100000000" Restart=on-failure RestartSec=10 LimitNOFILE=65535 [Install] WantedBy=multi-user.target EOF
sudo systemctl daemon-reload sudo systemctl enable geth sudo systemctl start geth
sudo journalctl -u geth -f --no-hostname -o cat
export L1MessageQueueWithGasPriceOracle=0x778d1d9a4d8b6b9ade36d967a9ac19455ec3fd0b export START_HEIGHT=1434640 export Rollup=0xd8c5c541d56f59d65cf775de928ccf4a47d4985c export Ethereum_Holesky_RPC= #после равно вставить рпс export Ethereum_Holesky_beacon_chain_RPC= #после равно вставить рпс export Your_Validator_Key= #после равно вставить приватный ключ валидатора
sudo tee /etc/systemd/system/morph.service > /dev/null << EOF [Unit] Description=Morph Validator Node After=network-online.target [Service] User=$USER ExecStart=/root/.morph/morph/node/build/bin/morphnode --validator --home /root/.morph/node-data \ --l2.jwt-secret /root/.morph/jwt-secret.txt \ --l2.eth http://localhost:8545 \ --l2.engine http://localhost:8551 \ --l1.rpc $Ethereum_Holesky_RPC \ --l1.beaconrpc $Ethereum_Holesky_beacon_chain_RPC \ --l1.chain-id 17000 \ --validator.privateKey $Your_Validator_Key \ --sync.depositContractAddr $L1MessageQueueWithGasPriceOracle \ --sync.startHeight $START_HEIGHT \ --derivation.rollupAddress $Rollup \ --derivation.startHeight $START_HEIGHT \ --derivation.fetchBlockRange 200 \ --log.filename /root/.morph/node.log --metrics-server-enable Restart=on-failure RestartSec=10 LimitNOFILE=65535 [Install] WantedBy=multi-user.target EOF
sudo systemctl daemon-reload sudo systemctl enable morph sudo systemctl start morph
sudo journalctl -u morph -f --no-hostname -o cat