Giter Club home page Giter Club logo

0g-newton-node-guide's Introduction

0G-Newton-Node-Guide

0G Newton Node Guide

Official Twitter 0G_Labs

https://x.com/0G_labs

Discord Role

Go to Discord and Take Roles https://discord.gg/Fh5kCkjy

Faucet

https://faucet.0g.ai/

Explorer

https://dashboard.nodebrand.xyz/0G

Requirements

COMPONENTS MINIMUM REQUIREMENTS
CPU 4
RAM 8+ GB
Storage +500 GB SSD

Update Upgrade Machine

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

Installation Go

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

Clone project repository and Build Binary

cd && rm -rf 0g-chain
git clone https://github.com/0glabs/0g-chain
cd 0g-chain
git checkout v0.1.0
make install

Node Configuration

0gchaind config chain-id zgtendermint_16600-1
0gchaind config keyring-backend test
0gchaind config node tcp://localhost:26657

Change your Moniker Name

0gchaind init "MONIKER_NAME" --chain-id zgtendermint_16600-1

Genesis

rm ~/.0gchain/config/genesis.json
curl -Ls https://github.com/0glabs/0g-chain/releases/download/v0.1.0/genesis.json > $HOME/.0gchain/config/genesis.json
curl -Ls https://raw.githubusercontent.com/Core-Node-Team/Testnet-TR/main/0G-Newton/addrbook.json > $HOME/.0gchain/config/addrbook.json

Set Minimum Gas Prices

sed -i -e 's|^minimum-gas-prices *=.*|minimum-gas-prices = "0.0025ua0gi"|' $HOME/.0gchain/config/app.toml

Peers Seeds

PEERS="[email protected]:16656,[email protected]:26656,[email protected]:26666,[email protected]:26656,[email protected]:26656,[email protected]:26656,[email protected]:26656,[email protected]:26656,[email protected]:26656,[email protected]:30397,[email protected]:26656,[email protected]:26656,[email protected]:26656,[email protected]:16656"
sed -i 's|^persistent_peers *=.*|persistent_peers = "'$PEERS'"|' $HOME/.0gchain/config/config.toml
sed -i -e 's|^seeds *=.*|seeds = "[email protected]:26656,[email protected]:26656,[email protected]:26656"|' $HOME/.0gchain/config/config.toml

Pruning

sed -i \
  -e 's|^pruning *=.*|pruning = "custom"|' \
  -e 's|^pruning-keep-recent *=.*|pruning-keep-recent = "100"|' \
  -e 's|^pruning-interval *=.*|pruning-interval = "17"|' \
  $HOME/.0gchain/config/app.toml

Create a Service

sudo tee /etc/systemd/system/0gchaind.service > /dev/null << EOF
[Unit]
Description=0G node service
After=network-online.target
[Service]
User=$USER
ExecStart=$(which 0gchaind) start
Restart=on-failure
RestartSec=10
LimitNOFILE=65535
[Install]
WantedBy=multi-user.target
EOF

Daemon Reload and Start Service

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

Check the logs

sudo journalctl -u 0gchaind.service -f --no-hostname -o cat

Create a new Wallet

DON'T FORGET TO SAVE YOUR KEYS

0gchaind keys add wallet --eth

Recovery Wallet

IF YOU REINSTALL NEW MACHINE WITH OLD WALLET USE THIS CODE FOR RECOVERY

0gchaind keys add wallet --eth --recover

Get Evm Address For Faucet

echo "0x$(0gchaind debug addr $(0gchaind keys show wallet -a) | grep hex | awk '{print $3}')"

Get Fauce

https://faucet.0g.ai/

Wallet List

0gchaind keys list

Check Sync

Before Create validator command, check your sync with this code. If shows false, run the create validator command.

0gchaind status 2>&1 | jq

Wallet Balance Check

0gchaind q bank balances $(0gchaind keys show wallet -a)

Create Validator (Change Moniker_Name)

0gchaind tx staking create-validator \
--amount=1000000ua0gi \
--pubkey=$(0gchaind tendermint show-validator) \
--moniker="Moniker_Name" \
--identity= \
--details="Details" \
--chain-id=zgtendermint_16600-1 \
--commission-rate=0.10 \
--commission-max-rate=0.20 \
--commission-max-change-rate=0.01 \
--min-self-delegation=1 \
--from=wallet \
--gas-prices=0.0025ua0gi \
--gas-adjustment=1.5 \
--gas=auto \
-y 

IF YOU ARE USING DIFFERENT PORT YOU NEED TO ADD THIS LINE CREATE VALIDATOR COMMAND.

--node=http://localhost:PORTNUMBER \

FOR EXAMPLE: --node=http://localhost:15657
!! PLEASE BACKUP YOUR PRIV VALID JSON

Fill the Form

https://www.shorturl.at/fgkoR

Edit Validator

0gchaind tx mstaking edit-validator \
--moniker "NEW MONIKER NAME" \
--from wallet \
--gas-adjustment 1.4 \
--gas auto \
--gas-prices 0.15uinit \
-y

Validator Info

0gchaind tx mstaking validator $(0gchaind keys show wallet --bech val -a)

Delegation

0gchaind tx staking delegate $(0gchaind keys show wallet --bech val -a) 1000000ua0gi --from wallet -y

Unjail

0gchaind tx slashing unjail --from wallet --gas=500000 --gas-prices=99999neuron -y

Restart Service

sudo systemctl restart 0gchaind

Stop Service

sudo systemctl stop 0gchaind

Check Log

sudo journalctl -u 0gchaind -f -o cat

Port Update

CUSTOM_PORT=110
sed -i -e "s%^proxy_app = \"tcp://127.0.0.1:26658\"%proxy_app = \"tcp://127.0.0.1:${CUSTOM_PORT}58\"%; s%^laddr = \"tcp://127.0.0.1:26657\"%laddr = \"tcp://127.0.0.1:${CUSTOM_PORT}57\"%; s%^pprof_laddr = \"localhost:6060\"%pprof_laddr = \"localhost:${CUSTOM_PORT}60\"%; s%^laddr = \"tcp://0.0.0.0:26656\"%laddr = \"tcp://0.0.0.0:${CUSTOM_PORT}56\"%; s%^prometheus_listen_addr = \":26660\"%prometheus_listen_addr = \":${CUSTOM_PORT}66\"%" $HOME/.0gchaind/config/config.toml
sed -i -e "s%^address = \"tcp://0.0.0.0:1317\"%address = \"tcp://0.0.0.0:${CUSTOM_PORT}17\"%; s%^address = \":8080\"%address = \":${CUSTOM_PORT}80\"%; s%^address = \"0.0.0.0:9090\"%address = \"0.0.0.0:${CUSTOM_PORT}90\"%; s%^address = \"0.0.0.0:9091\"%address = \"0.0.0.0:${CUSTOM_PORT}91\"%" $HOME/.0gchaind/config/app.toml

Removing Node

DON'T FORGET TO BACKUP YOUR PRIV VALIDATOR JSON KEY FROM CONFIG FOLDER.

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

0g-newton-node-guide's People

Contributors

kivancbeser avatar

Watchers

 avatar

Forkers

wsc-junior

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.