LOGOSNODOS
  • LOGOSNODOS
  • 🖥️Mainnet Node
    • Avail Network
      • ▶️Installation
      • ▶️Staking / Bonding
    • BlockX
      • ▶️Installation
      • ▶️Cheat Sheet
    • Muon Network
      • ▶️Installation
      • ▶️Troubleshooting
    • RaiblocksOne
      • ▶️Installation
      • ▶️Cheat Sheet
    • SGE Network
      • ▶️Installation
      • ▶️Cheat Sheet
    • Quicksilver Protocol
      • ▶️Installation
      • ▶️Cheat Sheet
  • 🛠️TESTNET NODE
    • 0gchain
      • ▶️Installation
      • ▶️Cheat Sheet
    • Airchains
      • ▶️Installation
      • ▶️Cheat Sheet
    • Avail Network
      • ▶️Installation
      • ▶️Challenge Set Identity
      • ▶️Challenge Add Pool
    • Cortensor
      • ▶️Staking and Funding
      • ▶️Installation
      • ▶️Node Management
      • ▶️Monitoring
    • CrossFi
      • ▶️Installation
      • ▶️Cheat Sheet
    • Juneo Network
      • ▶️Installation
      • ▶️Create Supernet
      • ▶️Deploy a VM
    • Namada
      • ▶️Installation
      • ▶️Cheat Sheet
    • Pryzm
      • ▶️Installation
      • ▶️Cheat Sheet
    • Quicksilver Protocol
      • ▶️Installation
      • ▶️Cheat Sheet
    • Swisstronik
      • ▶️Installation
      • ▶️Cheat Sheet
    • Symphony
      • ▶️Installation
      • ▶️Cheat Sheet
  • ⛑️Solidity Compiler
    • Hardhat
      • ▶️Installation
      • ▶️Setup Hardhat on Swisstronik Network
      • ▶️Write and compile the smart contract
      • ▶️Deploy the smart contract
      • ▶️Interact with the contract-Transaction
      • ▶️Interact with the contract-Call
      • ▶️Crafts and Mint Token ERC20
      • ▶️PERC20 (Private ERC20) Deploy, Mint and Transfer.
      • ▶️JSON RPC Call using ETH getStorage
Powered by GitBook
On this page
  • Installation
  • Install dependencies

Was this helpful?

  1. TESTNET NODE
  2. 0gchain

Installation

The complete infrastructure for cross-chain smart contracts, applications, and modular functionality.

Chain ID: zgtendermint_16600-1 | Latest Version Tag: | Wasm:

Installation

Install dependencies

Update system and install build tools

sudo apt -q update
sudo apt -qy install curl git jq lz4 build-essential tmux libgmp3-dev flex bison
sudo apt -qy upgrade

Install Go

rm -rf $HOME/go
sudo rm -rf /usr/local/go
cd $HOME
curl https://dl.google.com/go/go1.19.5.linux-amd64.tar.gz | sudo tar -C/usr/local -zxvf -
cat <<'EOF' >>$HOME/.profile
export GOROOT=/usr/local/go
export GOPATH=$HOME/go
export GO111MODULE=on
export PATH=$PATH:/usr/local/go/bin:$HOME/go/bin
EOF
source $HOME/.profile
go version

Set Variable

echo "export OGCHAIN_WALLET="YOUR WALLET NAME"" >> $HOME/.bash_profile
echo "export OGCHAIN_MONIKER="YOUR NODE NAME"" >> $HOME/.bash_profile
echo "export OGCHAIN_CHAIN_ID="rhye-1"" >> $HOME/.bash_profile
echo "export OGCHAIN_PORT="23"" >> $HOME/.bash_profile
source $HOME/.bash_profile

Download and build binaries

git clone -b v0.1.0 https://github.com/0glabs/0g-chain.git
cd 0g-chain
make install
0gchaind version

Set config and init app

0gchaind config node tcp://localhost:${QUICKSILVER_PORT}657
0gchaind config keyring-backend os
0gchaind config chain-id rhye-1
0gchaind init "YOUR NODE NAME" --chain-id rhye-1

Set custom ports in app.toml

sed -i.bak -e "s%:1317%:${OGCHAIN_PORT}317%g;
s%:8080%:${OGCHAIN_PORT}080%g;
s%:9090%:${OGCHAIN_PORT}090%g;
s%:9091%:${OGCHAIN_PORT}091%g;
s%:8545%:${OGCHAIN_PORT}545%g;
s%:8546%:${OGCHAIN_PORT}546%g;
s%:6065%:${OGCHAIN_PORT}065%g" $HOME/.0gchaind/config/app.toml

Set custom ports in config.toml

sed -i.bak -e "s%:26658%:${OGCHAIN_PORT}658%g;
s%:26657%:${OGCHAIN_PORT}657%g;
s%:6060%:${OGCHAIN_PORT}060%g;
s%:26656%:${OGCHAIN_PORT}656%g;
s%^external_address = \"\"%external_address = \"$(wget -qO- eth0.me):${OGCHAIN_PORT}656\"%;
s%:26660%:${OGCHAIN_PORT}660%g" $HOME/.0gchaind/config/config.toml

Config pruning

sed -i -e "s/^pruning *=.*/pruning = \"nothing\"/" $HOME/.0gchaind/config/app.toml
sed -i -e "s/^pruning-keep-recent *=.*/pruning-keep-recent = \"100\"/" $HOME/.0gchaind/config/app.toml
sed -i -e "s/^pruning-interval *=.*/pruning-interval = \"50\"/" $HOME/.0gchaind/config/app.toml

Set minimum gas price, enable prometheus and disable indexing

sed -i "s/^minimum-gas-prices *=.*/minimum-gas-prices = \"0ua0gi\"/" $HOME/.0gchain/config/app.toml
sed -i "s/^indexer *=.*/indexer = \"kv\"/" $HOME/.0gchain/config/config.toml
sed -i -e 's/address = "127.0.0.1:8545"/address = "0.0.0.0:8545"/' \
       -e 's/ws-address = "127.0.0.1:8546"/ws-address = "0.0.0.0:8546"/' $HOME/.0gchain/config/app.toml

Create a service

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

[Service]
User=root
Type=simple
ExecStart=$(which 0gchaind) start --json-rpc.api eth,txpool,personal,net,debug,web3 --home $HOME/.0gchain
Restart=on-failure
RestartSec=10
LimitNOFILE=65535
Environment="DAEMON_HOME=$HOME/.0gchain"
Environment="DAEMON_NAME=0gchaind"
Environment="UNSAFE_SKIP_BACKUP=true"
Environment="PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:$HOME/.0gchain/cosmovisor/current/bin"

[Install]
WantedBy=multi-user.target
EOF

Snapshot

sudo systemctl stop ogd
cp $HOME/.0gchain/data/priv_validator_state.json $HOME/.0gchain/priv_validator_state.json.backup
0gchaind tendermint unsafe-reset-all --home $HOME/.0gchain --keep-addr-book
curl https://snapshots-testnet.nodejumper.io/0g-testnet/0g-testnet_latest.tar.lz4 | sudo lz4 -dc - | sudo tar -xf - -C $HOME/.0gchain
mv $HOME/.0gchain/priv_validator_state.json.backup $HOME/.0gchain/data/priv_validator_state.json
sudo systemctl restart ogd && sudo journalctl -u ogd -f -o cat

Start service and check the logs

sudo systemctl daemon-reload
sudo systemctl enable ogd
sudo systemctl restart ogd && sudo journalctl -u quicksilverd -f

Last updated 11 months ago

Was this helpful?

🛠️
▶️