Skip to content

Witness Node Operation

yoyo edited this page May 6, 2019 · 12 revisions

1. Prepare your witness account

1.1 Generate block signing key pair using "get_dev_key" tool

./get_dev_key `cat /dev/urandom | head -100 | md5sum | awk '{print $1}'` `cat /dev/urandom | head -100 | md5sum | awk '{print $1}'`
# get_dev_key can be downloaded from https://github.com/CybexDEX/how-to-run-cybex-node/raw/master/bin/get_dev_key
# for example:
#block signing pubkey  = CYB6G3aAaCDb8XdyhZwgd7erfJsFYFm6j2gPQDfaN9hbWQ857Y4wE
#block signing privkey = 5JNfT6AUXqYobmiN32Exv3PLR5Z5pMDy3rj1gdNNQYdFuFYu1qt
# signing key will be used in step 1.3 and 2.2, please hold them carefully

1.2 Update your account to lifetime member

open web wallet->account->membership->buy lifetime subscription

1.3 Prepare empty_wallet.json file and create witness account using "cli_wallet" tool
Here is an example of empty_wallet.json of cybex main chain. Set chain_id and ws_server if you connect to other chains.

{
  "chain_id": "90be01e82b981c8f201c9a78a3d31f655743b29ff3274727b1439b093d04aa23",
  "my_accounts": [],
  "cipher_keys": "",
  "extra_keys": [],
  "pending_account_registrations": [],
  "pending_witness_registrations": [],
  "labeled_keys": [],
  "blind_receipts": [],
  "ws_server": "wss://hongkong.cybex.io",
  "ws_user": "",
  "ws_password": ""
}
# start cli_wallet and set password
# cli_wallet can be downloaded from https://github.com/CybexDEX/how-to-run-cybex-node/raw/master/bin/cli_wallet
[PROMPT]$ ./cli_wallet -w empty_wallet.json
new >>> set_password 123456
locked >>> unlock 123456
unlocked >>>
# import active private key of you cybex account (notice: active private key can be access from web wallet->account->permissions->active_permissions)
unlocked >>> import_key $ACCOUNT_NAME $ACCOUNT_ACTIVE_PRIV_KEY
# create witness account
unlocked >>> create_witness $ACCOUNT_NAME "$YOUR_URL" true
# update your new witness account with block signing public key(notice: public key is prefixed with CYB)
unlocked >>> update_witness $ACCOUNT_NAME "$YOUR_URL" $BLOCK_SIGNING_PUBKEY true

1.4 Collect votes from CYB holders to be a witness account

2.Environment Configuration

2.1 Hardware prerequisities

* 2 Core CPU or above
* 8G Memory or above
* 500G Storage or above
* 10Mbit/s bandwidth or above
* Linux OS(Ubuntu is recommended)
* Required libraries
  * libcurl
  * libssl
  * openssl
  * libcrypto
* NTP service on

2.2 Deploy and configuration

# Create running directory
mkdir cybex; cd cybex
export CYBEX_ROOT=`pwd`

# download prebuilt binaries
mkdir bin
# get prebuild binary "witness_node" from cybex

# download genesis file
wget https://raw.githubusercontent.com/CybexDEX/how-to-run-cybex-node/master/mainchain/genesis.json -O ${CYBEX_ROOT}/genesis.json

# download config files and create directory for data storage
mkdir -p ${CYBEX_ROOT}/data
wget https://raw.githubusercontent.com/CybexDEX/how-to-run-cybex-node/master/mainchain/config.ini -O ${CYBEX_ROOT}/data/config.ini

# query your witness-id
curl --data '{"jsonrpc": "2.0", "method": "lookup_witness_accounts", "params": ["$owner account name", 1], "id": 1}' $FULLNODE_URL
# you will get result in format: 
#{"id":1,"jsonrpc":"2.0","result":[["$YOUR_ACCOUNT_NAME","$YOUR_WITNESS_ID"]]}

# update the config file, input the witness-id and private key(from step 1.1)
# add or uncomment these two lines
# witness-id = "1.6.X"
# private-key = ["your-signing-pubkey-in-base58-format", "your-signing-privkey-in-wif-format"]

# Get XXX-config.xml file
mkdir -p ${CYBEX_ROOT}/config
# get XXX-config.xml from cybex and save it to ${CYBEX_ROOT}/config

3.Start witness_node

# Start witness_node
nohup ${CYBEX_ROOT}/bin/witness_node --data-dir=${CYBEX_ROOT}/data  --sync-config-file-path ${CYBEX_ROOT}/config/XXX-config.xml --genesis-json=${CYBEX_ROOT}/genesis.json --plugins "witness" >>${CYBEX_ROOT}/wn.log &

4.Node upgrade

need to cooperate with community when the chain (node) plans to upgrade.

5.Monitoring(optional)

Monitor blockchain

  • download zabbix_install.sh
  • run zabbix_install.sh

6.Maintenance and update

  • stop cq and witnessnode
  • update the program
  • start cq and witnessnode
  • status checking and data checking

7.Security(Needed for main chain)

  • open 5000 port to all witness node
  • open CQ port to ROME Server
  • close all other ports

8.Cloud Service Recommendation

  • Chinese Mainland : Alibaba Cloud
  • Other areas: AWS

开发者社区

了解CYBEX

文档中心

DEVELOPERS

GETTING STARTED

DOCUMENTATION

Clone this wiki locally