### Install Go 1.12.1 and Set Environment Variables (Shell) Source: https://github.com/thetatoken/guardian-mainnet-guide/blob/master/docs/COMPILE.md Installs Go version 1.12.1 on Ubuntu-like systems and configures essential environment variables (GOROOT, GOPATH, PATH, THETA_HOME) required for compiling and running the Theta Guardian Node. This step ensures the Go toolchain is correctly set up. ```shell screen -S theta sudo apt-get update sudo apt-get install build-essential sudo apt-get install gcc sudo apt-get install make sudo apt install libstdc++-7-dev sudo wget https://dl.google.com/go/go1.12.1.linux-amd64.tar.gz sudo tar -C /usr/local -xzf go1.12.1.linux-amd64.tar.gz echo 'export GOROOT=/usr/local/go' >> ~/.bashrc echo 'export GOPATH=$HOME/go' >> ~/.bashrc echo 'export PATH=$PATH:$GOROOT/bin:$GOPATH/bin' >> ~/.bashrc echo 'export THETA_HOME=$GOPATH/src/github.com/thetatoken/theta' >> ~/.bashrc source ~/.bashrc ``` -------------------------------- ### Install Theta Guardian Node (Linux) Source: https://github.com/thetatoken/guardian-mainnet-guide/blob/master/docs/CLI.md Downloads the latest Linux binaries for the Theta node and CLI, sets up necessary directories, and fetches the snapshot and configuration files. It also makes the binaries executable. Instructions for macOS and Windows are similar, differing only in the 'os' parameter. ```shell screen -S theta_mainnet mkdir ~/theta_mainnet cd ~/theta_mainnet mkdir bin mkdir -p guardian_mainnet/node curl -k --output bin/theta `curl -k 'https://mainnet-data.thethetatoken.org/binary?os=linux&name=theta'` curl -k --output bin/thetacli `curl -k 'https://mainnet-data.thethetatoken.org/binary?os=linux&name=thetacli'` wget -O guardian_mainnet/node/snapshot `curl -k https://mainnet-data.thethetatoken.org/snapshot` curl -k --output guardian_mainnet/node/config.yaml `curl -k 'https://mainnet-data.thethetatoken.org/config?is_guardian=true'` chmod +x bin/theta chmod +x bin/thetacli cd bin/ ``` -------------------------------- ### Clone and Compile Theta Guardian Source Code (Shell) Source: https://github.com/thetatoken/guardian-mainnet-guide/blob/master/docs/COMPILE.md Clones the Theta Ledger repository from the 'release' branch into the specified GOPATH and compiles the Theta Guardian source code. It sets GO111MODULE to 'on' and uses 'make install' to build the necessary binaries. This step requires the environment variables set previously. ```shell git clone --branch release https://github.com/thetatoken/theta-protocol-ledger.git $GOPATH/src/github.com/thetatoken/theta cd $THETA_HOME export GO111MODULE=on make install ``` -------------------------------- ### Launch Theta Guardian Node Source: https://github.com/thetatoken/guardian-mainnet-guide/blob/master/docs/CLI.md Starts the Theta guardian node. The first launch requires setting a secure password for the signing key. The node may take time to sync with the network. ```shell ./theta start --config=../guardian_mainnet/node ``` -------------------------------- ### Guardian Node Vote Log Example Source: https://github.com/thetatoken/guardian-mainnet-guide/blob/master/docs/CLI.md An example log entry showing a guardian node broadcasting a vote for a checkpoint block. This indicates the node is actively participating in the network after successful staking. ```text [2019-10-10 10:01:46] DEBUG [guardian] Boardcasting guardian vote vote=AggregatedVotes{Block: 0xab2a360ed292a14bb675837d1b1fe26de87414bdd8b9838d8d3646ca2c004844, Gcp: 0xd717f1d2bbdf0d8314341afcb30dc0d7d5419914c59754158cfa7a830c9d4c74, Multiplies: [1, 3, 0, ...., 1, 2]} ``` -------------------------------- ### Download Guardian Node Data (Shell) Source: https://github.com/thetatoken/guardian-mainnet-guide/blob/master/docs/COMPILE.md Downloads the necessary snapshot and configuration files for the Theta Guardian Node from the official mainnet data sources. It creates a directory structure for the node data and saves the snapshot and config.yaml files. ```shell cd $THETA_HOME mkdir -p ../guardian_mainnet/node curl -k --output ../guardian_mainnet/node/snapshot `curl -k https://mainnet-data.thetatoken.org/snapshot` curl -k --output ../guardian_mainnet/node/config.yaml `curl -k 'https://mainnet-data.thetatoken.org/config?is_guardian=true'` ``` -------------------------------- ### Query Theta Guardian Node Summary Source: https://github.com/thetatoken/guardian-mainnet-guide/blob/master/docs/GCP_MARKETPLACE.md Runs the thetacli command to retrieve the summary information for the Guardian node. The 'Summary' field from the output is needed for the subsequent staking process. ```bash thetacli query guardian ``` -------------------------------- ### Query Guardian Node Information for Staking Source: https://github.com/thetatoken/guardian-mainnet-guide/blob/master/docs/CLI.md Retrieves essential information about the guardian node, including its address, BLS public key, and a 'Summary' field which acts as the node's fingerprint. This fingerprint is required for staking Theta tokens. ```shell ./thetacli query guardian ``` ```json { "Address": "0x8f3B...E819", "BlsPubkey": "a1225b...16ebe", "BlsPop": "b49fd2a...d025c", "Signature": "14deb5e...52500", "Summary": "0x8f3Bc...952500" } ``` -------------------------------- ### Check Theta Node Status Source: https://github.com/thetatoken/guardian-mainnet-guide/blob/master/docs/CLI.md Queries the Theta node to check its synchronization status with the network. The 'syncing' field indicates if the node is still downloading blocks; 'false' means it's up-to-date. ```shell ./thetacli query status ``` -------------------------------- ### Check Theta Node Synchronization Status Source: https://github.com/thetatoken/guardian-mainnet-guide/blob/master/docs/GCP_MARKETPLACE.md Executes the thetacli command to query the current synchronization status of the Theta node. This is crucial to ensure the node is up-to-date with the network before proceeding with staking. ```bash thetacli query status ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.