Skip to content

Latest commit

 

History

History
192 lines (147 loc) · 5.61 KB

README.md

File metadata and controls

192 lines (147 loc) · 5.61 KB

0G Node

Sistem gereksinimleri

  • CPU 8 Cores
  • Ram 16 GB
  • Disk 1 TB SSD
  • Ubuntu 22.04

Hazırsanız başlayalım

Sunucumuzu güncelleyelim

sudo apt update && \
sudo apt install curl git jq build-essential gcc unzip wget lz4 -y

Go yükleyelim

cd $HOME && \
ver="1.22.0" && \
wget "https://golang.org/dl/go$ver.linux-amd64.tar.gz" && \
sudo rm -rf /usr/local/go && \
sudo tar -C /usr/local -xzf "go$ver.linux-amd64.tar.gz" && \
rm "go$ver.linux-amd64.tar.gz" && \
echo "export PATH=$PATH:/usr/local/go/bin:$HOME/go/bin" >> ~/.bash_profile && \
source ~/.bash_profile && \
go version

Binary Oluşturalım

git clone -b v0.2.3 https://github.com/0glabs/0g-chain.git
./0g-chain/networks/testnet/install.sh
source .profile

Değişkenleri Ayarlayalım

  • Moniker ve Wallet kısmını kendimize göre ayarlayalım. (Moniker sizin node isminiz olacak)
echo 'export MONIKER="Moniker"' >> ~/.bash_profile
echo 'export CHAIN_ID="zgtendermint_16600-2"' >> ~/.bash_profile
echo 'export WALLET_NAME="Wallet"' >> ~/.bash_profile
source $HOME/.bash_profile

Node'u başlatalım

cd $HOME
0gchaind config chain-id $CHAIN_ID
0gchaind init $MONIKER --chain-id $CHAIN_ID

Genesis.json dosyasını indirelim

curl -Ls https://github.com/0glabs/0g-chain/releases/download/v0.2.3/genesis.json > $HOME/.0gchain/config/genesis.json

Config dosyasını güncelleyelim

PEERS="[email protected]:26656,[email protected]:26656,[email protected]:26656,[email protected]:26656,[email protected]:26656,[email protected]:36656,[email protected]:26656,[email protected]:26656,[email protected]:26656,[email protected]:26656,[email protected]:26656,[email protected]:26656,[email protected]:27856,[email protected]:26656,[email protected]:26656,[email protected]:26656,[email protected]:26656,[email protected]:26656,[email protected]:13456" && \
SEEDS="[email protected]:26656,[email protected]:26656,[email protected]:26656,[email protected]:26656" && \
sed -i -e "s/^seeds *=.*/seeds = \"$SEEDS\"/; s/^persistent_peers *=.*/persistent_peers = \"$PEERS\"/" $HOME/.0gchain/config/config.toml

sed -i 's|^\s*#\?\s*laddr\s*=\s*"tcp://127.0.0.1:26657"|laddr = "tcp://0.0.0.0:26657"|' $HOME/.0gchain/config/config.toml

sed -i 's|^\s*#\?\s*api\s*=.*|api = "eth,txpool,personal,net,debug,web3"|' $HOME/.0gchain/config/app.toml

sed -i 's|^\s*#\?\s*address\s*=\s*"127.0.0.1:8545"|address = "0.0.0.0:8545"|' $HOME/.0gchain/config/app.toml

sed -i 's|^\s*#\?\s*ws-address\s*=\s*"127.0.0.1:8546"|ws-address = "0.0.0.0:8546"|' $HOME/.0gchain/config/app.toml

Servis oluşturalım

sudo tee /etc/systemd/system/0gchaind.service > /dev/null <<EOF
[Unit]
Description=0gchaind Validator Node
After=network.target

[Service]
User=root
ExecStart=/root/go/bin/0gchaind start
Environment="G0GC=900"
Environment="G0MELIMIT=40GB"
Restart=on-failure
RestartSec=3
LimitNOFILE=65535

[Install]
WantedBy=multi-user.target
EOF

Başlatalım

sudo systemctl daemon-reload
sudo systemctl enable 0gchaind 
sudo systemctl start 0gchaind

Logları kontrol edelim

sudo journalctl -u 0gchaind -f -o cat

Cüzdan oluşturalım

  • Cüzdan isminizi kendinize göre belirleyin
  • Çıktıyı kaydetmeyi unutmayalım
0gchaind keys add cüzdanismi --eth

Private Keyimizi dışa aktarıp Metamask'a ekleyelim

0gchaind keys unsafe-export-eth-key cüzdanismi

Musluktan token isteyelim

Faucet

Validator oluşturalım

  • Moniker, Wallet ve diğer bilgilerinizi değiştirip eklemeyi unutmayalım.
0gchaind tx staking create-validator \
  --amount=1000000ua0gi \
  --pubkey=$(0gchaind tendermint show-validator) \
  --moniker=MONIKER \
  --chain-id=zgtendermint_16600-2 \
  --commission-rate=0.05 \
  --commission-max-rate=0.10 \
  --commission-max-change-rate=0.01 \
  --min-self-delegation=1 \
  --from=CüzdanAdı \
  --identity="" \
  --website="" \
  --details="" \
  --node=http://localhost:56657 \
  -y

Yararlı Bilgiler

Eski cüzdanınızı ekleme

0gchaind keys add wallet --eth --recover

Cüzdanları Listeleme

0gchaind keys list

Cüzdanı Silme

0gchaind keys delete wallet

Kendine delege etme

  • Wallet kısımlarını cüzdan isminizle değiştirelim
0gchaind tx staking delegate $(0gchaind keys show wallet --bech val -a)  1000000ua0gi --from wallet -y

Node'u Silme

cd $HOME
sudo systemctl stop 0gchaind
sudo systemctl disable 0gchaind
sudo rm /etc/systemd/system/0gchaind.service
sudo systemctl daemon-reload
sudo rm -f $(which 0gchaind)
sudo rm -rf $HOME/.0gchain
sudo rm -rf $HOME/0g-chain
sudo rm -rf $HOME/go