Viction
  • Getting Started
  • General
    • Overview
    • Viction Blockchain
      • PoSV Consensus
      • Comparison
    • Staking
      • Staking Requirements
      • Staking Rewards
      • How to stake on Viction Wallet
    • Network Information
      • Viction Mainnet
      • Viction Testnet
    • Viction RPC API
  • Smart Contract Development
    • Solidity
      • A Simple Smart Contract
      • Solidity by Example
    • Standards & Specification
      • VRC25 Specification
      • VRC725 Specification
    • IDEs and Tools
      • Remix
      • Ethers.js
      • web3.js
      • thirdweb CLI
    • Deployment & Verification
      • Hardhat
      • Foundry
  • DApp Development
    • Integration
      • Exchange/Wallet integration
      • VRC25 Exchange/Wallet integration
      • Viction Staking Governance
      • VIC ZeroGas
      • VRRF
    • Data and analytics
    • Embedded Wallet (MPC)
    • Walkthrough: Build a Dapp on Viction
      • Setup Environment
      • Write the Smart Contract
      • Interacting with the Dapp in a browser
  • Masternode
    • Requirements
    • Run a Full Node
      • Binary
      • Create a Viction Masternode
      • Tmn
      • Docker
    • Apply Your Node
    • Slashing Mechanism
    • Chain Data Snapshots
    • Troubleshooting
  • Viction Wallet
    • User Guide
      • Authentication
      • How to create a new wallet
      • How to restore a wallet?
      • Wallet settings
      • Send & Receive Tokens
      • Add custom token
      • Manage Tokens
      • Send NFT
      • General settings
    • Developer Guide
    • Privacy Policy
    • Term and Services
  • Viction Bridge
    • Spacegate
    • Arken Bridge
    • Hyperlane
  • Viction Data Availability
    • Viction DA RPC API
    • DA Integration Use cases
      • Simple Guide for Integrating OP Stack Rollup with Viction DA Layer
  • How to
    • How to Connect to Viction Blockchain
      • Coin98 Super Wallet
      • Metamask
      • Ledger
    • How to troubleshoot when the node is up but couldn't begin to sync block
    • How to Vote for Viction Saigon Network Upgrade Proposal
    • How to issue a token via VICIssuer
    • How to verify if a contract has been issued via VICIssuer
    • How to deploy the VRC725 contract
    • How to apply ZeroGas for VRC725 contract
    • How to Migrate Dapps from Ethereum
    • How to register Token or NFT logo on Vicscan
    • How to verify a contract on Vicscan
    • How to confirm a project on Vicscan
    • How to check if a token is gas sponsored on Viction
    • How to verify gas sponsored transactions
    • How to create Telegram Mini Apps
    • How to use VictionSafe (Multisig)
  • FAQ
    • APIs
    • General
      • Viction
      • Ecosystem
      • VIC - Economics
      • Contact & Support
    • Masternodes and Voting
      • Masternodes
      • Voter
    • Products
      • VicScan (Explorer)
      • VicMaster
      • VicStats
      • VicIssuer
        • How to Verify & Publish Contract Source Code on VicScan
      • Viction Wallet
      • Viction Data Availability Network
  • Legal
    • Terms of Use
    • Privacy Policy
  • Whitepaper and Research
  • Archive
    • TOMOE
    • How to Deploy a VRC25 Token on Viction
    • How to deploy an ICO smart contract on Viction
    • How to deploy an NFT token
    • An Example of Building a Dapp on Viction
    • Migrate Ethereum Dapp to Viction
    • TomoMasterDAO
      • Introduction
      • Governance model
        • On-Chain vs Off-Chain Voting
        • Board
        • Proposals
        • Voting and Outcome
      • Tokenomics
      • How to utilize and trade tDAO
      • Proposal guidelines for TomoMasterDAO
    • Old Viction Testnet
    • Deploy on Viction
      • CLI Commands
      • Viction Private Testnet Setup
Powered by GitBook
On this page
  • Install Golang
  • Prepare tomo client software
  • Download genesis block
  • Create datadir
  • Initialize the chain from genesis
  • Initialize / Import accounts for the nodes's keystore
  • Start a node
  • See your node on stats page
  • Troubleshooting
  1. Masternode
  2. Run a Full Node

Binary

This guide shows how to run a Viction Masternode in testnet and mainnet without the need of using Docker and tmn.

Install Golang

  • Reference: https://golang.org/doc/install

  • Set environment variables

  • Supports Go 1.19+

export GOROOT=$HOME/usr/local/go
export GOPATH=$HOME/go

Prepare tomo client software

Build from source code

Create new directory for the project

mkdir -p $GOPATH/src/github.com/Viction/
cd $GOPATH/src/github.com/Viction/
  • Download source code and build

git clone https://github.com/BuildOnViction/tomochain.git Viction
cd Viction
  • Checkout the latest version (e.g v2.2.4)

git pull origin --tags
git checkout v2.2.4
  • Build the project

make all
  • Binary file should be generated in build folder $GOPATH/src/github.com/Viction/Viction/build/bin

alias tomo=$GOPATH/src/github.com/Viction/Viction/build/bin/tomo

Download Viction binary from Github release page

alias tomo=path/to/tomo/binary

Download genesis block

$GENESIS_PATH : location of genesis file you would like to put

export GENESIS_PATH=path/to/genesis.json
  • Testnet

curl -L https://raw.githubusercontent.com/buildonViction/tomochain/master/genesis/testnet.json -o $GENESIS_PATH
  • Mainnet

curl -L https://raw.githubusercontent.com/buildonViction/tomochain/master/genesis/mainnet.json -o $GENESIS_PATH

Create datadir

  • create a folder to store Viction data on your machine

export DATA_DIR=/path/to/your/data/folder
mkdir -p $DATA_DIR/tomo

Initialize the chain from genesis

tomo init $GENESIS_PATH --datadir $DATA_DIR

Initialize / Import accounts for the nodes's keystore

If you already had an existing account, import it. Otherwise, please initialize new accounts

export KEYSTORE_DIR=path/to/keystore

Initialize new accounts

tomo account new \
    --password [YOUR_PASSWORD_FILE_TO_LOCK_YOUR_ACCOUNT] \
    --keystore $KEYSTORE_DIR

Import accounts

tomo account import [PRIVATE_KEY_FILE_OF_YOUR_ACCOUNT] \    
    --keystore $KEYSTORE_DIR \
    --password [YOUR_PASSWORD_FILE_TO_LOCK_YOUR_ACCOUNT]

List all available accounts in keystore folder

tomo account list --datadir $DATA_DIR  --keystore $KEYSTORE_DIR

Start a node

Environment variables

  • $IDENTITY: the name of your node

  • $PASSWORD: the password file to unlock your account

  • $YOUR_COINBASE_ADDRESS: address of your account which generated in the previous step

  • $NETWORK_ID: the networkId. Mainnet: 88. Testnet: 89

  • $NETSTATS_PORT: The port used by the stats website (usually 443)

Let's start a node

tomo  --syncmode "full" \
    --announce-txs \
    --datadir $DATA_DIR --networkid $NETWORK_ID --port 30303 \
    --keystore $KEYSTORE_DIR --password $PASSWORD \
    --identity $IDENTITY \
    --mine --gasprice 250000000 \
    --bootnodes $BOOTNODES \
    --ethstats $IDENTITY:$WS_SECRET@$NETSTATS_HOST:$NETSTATS_PORT

If you are a dapp developer, you should open RPC and WS apis:

tomo  --syncmode "full" \
    --announce-txs \
    --datadir $DATA_DIR --networkid $NETWORK_ID --port 30303 \
    --keystore $KEYSTORE_DIR --password $PASSWORD \
    --rpc --rpccorsdomain "*" --rpcaddr 0.0.0.0 --rpcport 8545 --rpcvhosts "*" \
    --rpcapi "db,eth,net,web3,personal,debug" \
    --ws --wsaddr 0.0.0.0 --wsport 8546 --wsorigins "*" --unlock "$YOUR_COINBASE_ADDRESS" \
    --identity $IDENTITY \
    --mine --gasprice 250000000 \
    --bootnodes $BOOTNODES \
    --ethstats $IDENTITY:$WS_SECRET@$NETSTATS_HOST:$NETSTATS_PORT

If you want to run an archive node to be able to access historical data, you must add two more parameters to the command line --gcmode archive --store-reward , so the final command line will be:

tomo  --syncmode "full" \
    --announce-txs \
    --datadir $DATA_DIR --networkid $NETWORK_ID --port 30303 \
    --keystore $KEYSTORE_DIR --password $PASSWORD \
    --rpc --rpccorsdomain "*" --rpcaddr 0.0.0.0 --rpcport 8545 --rpcvhosts "*" \
    --rpcapi "db,eth,net,web3,personal,debug" \
    --ws --wsaddr 0.0.0.0 --wsport 8546 --wsorigins "*" --unlock "$YOUR_COINBASE_ADDRESS" \
    --identity $IDENTITY \
    --mine --gasprice 250000000 \
    --bootnodes $BOOTNODES \
    --ethstats $IDENTITY:$WS_SECRET@$NETSTATS_HOST:$NETSTATS_PORT
    --gcmode archive --store-reward

Some explanations on the flags

--verbosity: log level from 1 to 5. Here we're using 4 for debug messages

--datadir: path to your data directory created above.

--keystore: path to your account's keystore created above.

--identity: your full-node's name.

--password: your account's password.

--networkid: our network ID.

--port: your full-node's listening port (default to 30303)

--rpc, --rpccorsdomain, --rpcaddr, --rpcport, --rpcvhosts: your full-node will accept RPC requests at 8545 TCP.

--ws, --wsaddr, --wsport, --wsorigins: your full-node will accept Websocket requests at 8546 TCP.

--mine: your full-node wants to register to be a candidate for masternode selection.

--gasprice: Minimal gas price to accept for mining a transaction.

--targetgaslimit: Target gas limit sets the artificial target gas floor for the blocks to mine (default: 4712388)

--bootnode: bootnode information to help to discover other nodes in the network

--gcmode: blockchain garbage collection mode ("full", "archive")

--synmode: blockchain sync mode ("fast", "full", or "light". More detail: https://github.com/BuildOnViction/Viction/blob/master/eth/downloader/modes.go#L24)

--ethstats: send data to stats website

--tomo-testnet: required when the networkid is testnet(89)

--store-reward: store reward report

To see all flags usage

tomo --help

See your node on stats page

Troubleshooting

If your node seems run smooth with no error logs but still get slash frequently. You need to check system time on your node, your system time have to be synced from NTP server

E.g:

$ timedatectl
Local time: Fri 2019-07-26 05:57:40 CEST
  Universal time: Fri 2019-07-26 03:57:40 UTC
        RTC time: Fri 2019-07-26 03:58:01
       Time zone: Europe/Berlin (CEST, +0200)
 Network time on: yes
NTP synchronized: no
 RTC in local TZ: no

NTP synchronized: no means your node does not use NTP, you have to enable it.

PreviousRun a Full NodeNextCreate a Viction Masternode

Last updated 1 year ago

Download tomo binary from our

$BOOTNODES: The comma separated list of bootnodes. Find them

$WS_SECRET: The password to send data to the stats website. Find them

$NETSTATS_HOST: The stats website to report to, regarding to your environment. Find them

Testnet:

Mainnet:

releases page
here
here
here
https://stats-testnet.viction.xyz/
https://stats.viction.xyz/