Wethio Network

Here you will learn about the networks on the Wethio ecosystem in detail.

Wethio Mainnet Spec

Following contains the details of the mainnet wethio blockchain

The Specifications

Chain id: 78 HD derivation path: m/44'/77777'/0'/0/ Consensus Mechanism: PoSV Block finality: >75% Consensus nodes: up to 157 (masternodes) Genesis block date: `` Transaction fee: gas price 0.25 Gwei The fee for Smart contract creation: gas price 10000 Gwei, gas limit >= 1000000 The version of Solidity Compiler: < 0.5

Resources

WethioWallet (Wethio Wallet) WethioScan (Block explorer) WethioMaster (Governance dApp)

Wethio Testnet Spec

As the name suggests, a Testnet is for testing new features and to give a demo of upcoming products. The Wethio testnet network has its own specifications that makes it possible to conduct testing processes smoothly.

The Specifications

Chain id: 79 RPC endpoint: https://rpc.testnet.wethio.io HD derivation path: m/44'/77777'/0'/0/ Consensus Mechanism: PoSV Block finality: >75% Consensus nodes: up to 150 (masternodes) Genesis block date: `` Transaction fee: gas price 0.25 Gwei The fee for Smart contract creation: gas price 10000 Gwei, gas limit >= 1000000 The version of Solidity Compiler: < 0.5

Resources

WethioWallet (Wethio Wallet) WethioScan (Block explorer) WethioMaster (Governance dApp) Faucet (To request testnet ZYN)

Zyn Command Line Interface

A list of commands that can ease the developers interaction with Wethio client Zyn

Command: $ zyn [OPTIONS]

--verbosity: log level from 1 to 5.

--datadir: path to your data directory

--keystore: path to your account's keystore

--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: [required] 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")

--store-reward: store reward report

Setting up a Private Network

In this brief tutorial, you will learn how to set up a private Wethio Testnet on a local machine. It intends to familiarize developers with Wethio's source code and initial setup.

Configuring the Wethio Private Testnet Setup

Here are step-by-step instructions for setting up a Wethio private net with three Masternodes.

Use https://golang.org/doc/install as a reference to install Golan and set environment variables

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

How to set up the Wethio Client Software

Go to cd $GOPATH/src/github.com/ethereum/go-ethereum to download source code and build

git init
<!-- git remote add git@github.com:-->
git pull origin master
make all
Get easy access by creating shortcuts/alias
alias zyn=$GOPATH/src/github.com/ethereum/go-ethereum/build/bin/zyn
alias bootnode=$GOPATH/src/github.com/ethereum/go-ethereum/build/bin/bootnode
alias puppeth=$GOPATH/src/github.com/ethereum/go-ethereum/build/bin/puppeth

How to Setup Chain Fata Folders datadir and Correspond keystore Folders for 3 Masternodes

mkdir $HOME/wethio
mkdir $HOME/wethio/nodes
mkdir $HOME/wethio/nodes/1 $HOME/wethio/nodes/2 $HOME/wethio/nodes/3
mkdir $HOME/wethio/keystore/1 $HOME/wethio/keystore/2 $HOME/wethio/keystore/3

How to Initialize / Import Accounts For the Masternodes's Keystore

  1. Initialize new accounts- Ignore this step if there are existing accounts and an option to import them

zyn account new \
--password [YOUR_PASSWORD_FILE_TO_LOCK_YOUR_ACCOUNT] \
--keystore $HOME/wethio/keystore/1
zyn account new \
--password [YOUR_PASSWORD_FILE_TO_LOCK_YOUR_ACCOUNT] \
--keystore $HOME/wethio/keystore/2
zyn account new \
--password [YOUR_PASSWORD_FILE_TO_LOCK_YOUR_ACCOUNT] \
--keystore $HOME/wethio/keystore/3
  1. Import accounts

zyn account import [PRIVATE_KEY_FILE_OF_YOUR_ACCOUNT] \
--keystore $HOME/wethio/keystore/1 \
--password [YOUR_PASSWORD_FILE_TO_LOCK_YOUR_ACCOUNT]

You must repeat this step twice in order to import two more private keys for our three masternodes

How to customize Genesis Block by Using the puppeth Tool

  1. Command puppeth and give answers to questions related to your private chain as follows:

    puppeth

  2. Now set a chain name

    > local

wethio

<

  1. For configuring new genesis, enter 2

  2. For selecting PoSV Consensus, enter 3

  3. Set blocktime (default 2 seconds)

  4. Set each epoch reward

  5. Set addresses for initial masternodes

  6. Set number of blocks of each epoch (default 900). For customizing epoch number,

  7. update the code here common/constants.go:14 EpocBlockRandomize = 900

  8. Set gap (How many blocks before the checkpoint needs to be prepared for a new masternodes < set ?)

  9. suggestedGap = 5

  10. Enter foundation address which you hold private key

    wethio

  11. Enter accounts through which you control private keys to unlock MultiSig wallet

    wethio

  12. Enter swap wallet address for fund 55 million ZYN

  13. Export genesis file by selecting 2. Manage existing genesis - Select 2. Export genesis configuration to enter genesis filename

    wethio

  14. Exit by pressing Control + C

    How to Initialize Your Private Chain with Above Genesis Block

    zyn --datadir $HOME/wethio/nodes/1 init [PATH/TO/GENESIS_FILE]
    zyn --datadir $HOME/wethio/nodes/2 init [PATH/TO/GENESIS_FILE]
    zyn --datadir $HOME/wethio/nodes/3 init [PATH/TO/GENESIS_FILE]

    How to Setup Bootnode

Initializing the bootnode key

bootnode -genkey bootnode.key

Running bootnode and copying bootnode information

bootnode -nodekey ./bootnode.key

enode://7e59324b1e54f8c282719465eb96786fb3a04a0265deee2cdb0f62e912337ca

6f118d0c91f7ebfae6f5c17825205279249cf7ff65ae54d0a1a8908ef16f80f63@[::]:30301

wethio

Operating Masternodes

  1. How to operate Masternode 1

    zyn --syncmode "full" \
    --datadir $HOME/wethio/nodes/1 --networkid [YOUR_NETWORK_ID] --port 10303 \
    --keystore $HOME/wethio/keystore/1 --password [YOUR_PASSWORD_FILE_TO_UNLOCK_YOUR_ACCOUNT] \
    --rpc --rpccorsdomain "*" --rpcaddr 0.0.0.0 --rpcport 1545 --rpcvhosts "*" \
    --rpcapi "db,eth,net,web3,personal,debug" \
    --gcmode "archive" \
    --ws --wsaddr 0.0.0.0 --wsport 1546 --wsorigins "*" --unlock "[ADDRESS_MASTERNODE_1]" \
    --identity "NODE1" \
    --mine --gasprice 2500 \
    --bootnodes [YOUR_BOOTNODE_INFORMATION] \
    console
  2. How to operate Masternode 2

    zyn --syncmode "full" \
    --datadir $HOME/wethio/nodes/2 --networkid [YOUR_NETWORK_ID] --port 20303 \
    --keystore $HOME/wethio/keystore/2 --password [YOUR_PASSWORD_FILE_TO_UNLOCK_YOUR_ACCOUNT] \
    --rpc --rpccorsdomain "*" --rpcaddr 0.0.0.0 --rpcport 2545 --rpcvhosts "*" \
    --rpcapi "db,eth,net,web3,personal,debug" \
    --gcmode "archive" \
    --ws --wsaddr 0.0.0.0 --wsport 2546 --wsorigins "*" --unlock "[ADDRESS_MASTERNODE_2]" \
    --identity "NODE2" \
    --mine --gasprice 2500 \
    --bootnodes [YOUR_BOOTNODE_INFORMATION] \
    console
  3. How to operate Masternode 3

    zyn --syncmode "full" \
    --datadir $HOME/wethio/nodes/3 --networkid [YOUR_NETWORK_ID] --port 30303 \
    --keystore $HOME/wethio/keystore/3 --password [YOUR_PASSWORD_FILE_TO_UNLOCK_YOUR_ACCOUNT] \
    --rpc --rpccorsdomain "*" --rpcaddr 0.0.0.0 --rpcport 3545 --rpcvhosts "*" \
    --rpcapi "db,eth,net,web3,personal,debug" \
    --gcmode "archive" \
    --ws --wsaddr 0.0.0.0 --wsport 3546 --wsorigins "*" --unlock "[ADDRESS_MASTERNODE_3]" \
    --identity "NODE3" \
    --mine --gasprice 2500 \
    --bootnodes [YOUR_BOOTNODE_INFORMATION] \
    console
  4. Explaining Flags

    --verbosity: log level from 1 to 5.
    --datadir: path to your data director
    --keystore: path to your account's keystore
    --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: [required] 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")
    --store-reward: store reward report

    You can check usage of all flags here: zyn --help

Verifying Your Private Chain

Follow the below steps to do so:

  1. First, connect ipc

    zyn attach $HOME/wethio/nodes/1/zyn.ipc
    admin.nodeInfo
    eth.getBlock(0)
    eth.getBlock(1)
  2. Then, connect rpc zyn attach http://localhost:1545 eth.getBlock(0) eth.getBlock(1)

  3. At last, verify Checkpoints

    After 30 minutes you can see if your chain has passed the first checkpoint wethio

    zyn attach http://0.0.0.0:1545

    eth.getBlock(900)

How to troubleshoot

  1. Resetting your chain

    rm -rf $HOME/wethio/nodes/1/zyn $HOME/wethio/nodes/2/zyn $HOME/wethio/nodes/3/zyn
    zyn --datadir $HOME/wethio/nodes/1 init genesis.json
    zyn --datadir $HOME/wethio/nodes/2 init genesis.json
    zyn --datadir $HOME/wethio/nodes/3 init genesis.json

Note: Use the Gnosis Multisig Wallet: https://github.com/gnosis/MultiSigWallet