how to check witness node status?[solved]

4년 전

**Solved * Thanks @drakos and @timcliff for your kind support. Here is my new config.ini for my 16G RAM/200G SSD witness node.

root@crypto:~/steem-docker# cat data/witness_node_data_dir/config.ini
# Endpoint for P2P node to listen on
#p2p-endpoint = 0.0.0.0:2001

# Maxmimum number of incoming connections on P2P endpoint
# p2p-max-connections =

# Shared file size
shared-file-size = 15G
shared-file-dir = /shm/

# Target blocks to flush
flush = 100000

# P2P nodes to connect to on startup (may specify multiple times)
seed-node = anyx.co:2001                # @anyx (CA)
seed-node = gtg.steem.house:2001        # @gtg (PL)
seed-node = seed.jesta.us:2001          # @jesta (US)
seed-node = 212.117.213.186:2016        # @liondani (SWISS)
seed-node = seed.riversteem.com:2001    # @riverhead (NL)
seed-node = 52.74.152.79:2001           # @smooth (SG)
seed-node = seed.steemd.com:34191       # @roadscape (US)
seed-node = seed.steemnodes.com:2001    # @wackou (NL)


# Pairs of [BLOCK_NUM,BLOCK_ID] that should be enforced as checkpoints.
# checkpoint =

# Endpoint for websocket RPC to listen on
rpc-endpoint = 0.0.0.0:8090

# Endpoint for TLS websocket RPC to listen on
# rpc-tls-endpoint =

# The TLS certificate file for this server
# server-pem =

# Password for this certificate
# server-pem-password =

# Block signing key to use for init witnesses, overrides genesis file
# dbg-init-key =

# API user specification, may be specified multiple times
# api-user =

# Set an API to be publicly available, may be specified multiple times
public-api = database_api login_api network_node_api network_broadcast_api

# Plugin(s) to enable, may be specified multiple times
enable-plugin = witness

# Defines a range of accounts to track as a json pair ["from","to"] [from,to)
# track-account-range =

# RPC endpoint of a trusted validating node (required)
# trusted-node =

# Track market history by grouping orders into buckets of equal size measured in seconds specified as a JSON array of numbers
bucket-size = [15,60,300,3600,86400]

# How far back in time to track history for each bucket size, measured in the number of buckets (default: 5760)
history-per-size = 5760

# Defines a range of accounts to private messages to/from as a json pair ["from","to"] [from,to)
# pm-account-range =

# Enable block production, even if the chain is stale.
enable-stale-production = false

# Percent of witnesses (0-99) that must be participating in order to produce blocks
required-participation = false

# name of witness controlled by this node (e.g. initwitness )
witness = "fuli"

# name of miner and its private key (e.g. ["account","WIF PRIVATE KEY"] )
# miner =

# Number of threads to use for proof of work mining
# mining-threads =

# WIF PRIVATE KEY to be used by one or more witnesses or miners
 private-key = 

# Account creation fee to be voted on upon successful POW - Minimum fee is 100.000 STEEM (written as 100000)
# miner-account-creation-fee =

# Maximum block size (in bytes) to be voted on upon successful POW - Max block size must be between 128 KB and 750 MB
# miner-maximum-block-size =

# SBD interest rate to be vote on upon successful POW - Default interest rate is 10% (written as 1000)
# miner-sbd-interest-rate =

# declare an appender named "stderr" that writes messages to the console
[log.console_appender.stderr]
stream=std_error

# declare an appender named "p2p" that writes messages to p2p.log
[log.file_appender.p2p]
filename=logs/p2p/p2p.log
# filename can be absolute or relative to this config file

# route any messages logged to the default logger to the "stderr" logger we
# declared above, if they are info level are higher
[logger.default]
level=warn
appenders=stderr

# route messages sent to the "p2p" logger to the p2p appender declared above
[logger.p2p]
level=warn
appenders=p2p

This screen has been lasting for more than 24 hours.

Screen Shot 2017-08-06 at 9.59.25 AM.png

Screen Shot 2017-08-06 at 10.00.22 AM.png

Is my witness node working fine? I broadcasted my witness last night and I was able to vote myself.

Screen Shot 2017-08-06 at 9.58.53 AM.png

Screen Shot 2017-08-06 at 9.58.11 AM.png

Here is my config file

root@crypto:~/# cat ~/steem-docker/data/witness_node_data_dir/config.ini
# Endpoint for P2P node to listen on
#p2p-endpoint = 0.0.0.0:2001

# Maxmimum number of incoming connections on P2P endpoint
# p2p-max-connections =

# Shared file size
shared-file-size = 50G
shared-file-dir = /shm/

# Target blocks to flush
flush = 100000

# P2P nodes to connect to on startup (may specify multiple times)
seed-node = gtg.steem.house:2001        # @gtg (PL)

# Pairs of [BLOCK_NUM,BLOCK_ID] that should be enforced as checkpoints.
# checkpoint =

# Endpoint for websocket RPC to listen on
rpc-endpoint = 0.0.0.0:8090

# Endpoint for TLS websocket RPC to listen on
# rpc-tls-endpoint =

# The TLS certificate file for this server
# server-pem =

# Password for this certificate
# server-pem-password =

# Block signing key to use for init witnesses, overrides genesis file
# dbg-init-key =

# API user specification, may be specified multiple times
# api-user =

# Set an API to be publicly available, may be specified multiple times
public-api = database_api login_api

# Plugin(s) to enable, may be specified multiple times
enable-plugin = witness

# Defines a range of accounts to track as a json pair ["from","to"] [from,to)
# track-account-range =

# RPC endpoint of a trusted validating node (required)
# trusted-node =

# Track market history by grouping orders into buckets of equal size measured in seconds specified as a JSON array of numbers
bucket-size = [15,60,300,3600,86400]

# How far back in time to track history for each bucket size, measured in the number of buckets (default: 5760)
history-per-size = 5760

# Defines a range of accounts to private messages to/from as a json pair ["from","to"] [from,to)
# pm-account-range =

# Enable block production, even if the chain is stale.
enable-stale-production = false

# Percent of witnesses (0-99) that must be participating in order to produce blocks
required-participation = false

# name of witness controlled by this node (e.g. initwitness )
witness = "fuli"

# name of miner and its private key (e.g. ["account","WIF PRIVATE KEY"] )
# miner =

# Number of threads to use for proof of work mining
# mining-threads =

# WIF PRIVATE KEY to be used by one or more witnesses or miners
 private-key =

# Account creation fee to be voted on upon successful POW - Minimum fee is 100.000 STEEM (written as 100000)
# miner-account-creation-fee =

# Maximum block size (in bytes) to be voted on upon successful POW - Max block size must be between 128 KB and 750 MB
# miner-maximum-block-size =

# SBD interest rate to be vote on upon successful POW - Default interest rate is 10% (written as 1000)
# miner-sbd-interest-rate =

# declare an appender named "stderr" that writes messages to the console
[log.console_appender.stderr]
stream=std_error

# declare an appender named "p2p" that writes messages to p2p.log
[log.file_appender.p2p]
filename=logs/p2p/p2p.log
# filename can be absolute or relative to this config file

# route any messages logged to the default logger to the "stderr" logger we
# declared above, if they are info level are higher
[logger.default]
level=warn
appenders=stderr

# route messages sent to the "p2p" logger to the p2p appender declared above
[logger.p2p]
level=warn
appenders=p2p


I can't find clue from the log file --> logs/p2p/p2p.log . Most of the messages are similar to this one:

2017-08-06T02:14:11 p2p:message read_loop process_ordinary_mes ] client rejected message sent by peer 192.151.158.106:12150, {"code":10,"name":"assert_exception","message":"Assert Exception","stack":[{"context":{"level":"error","file":"database.cpp","line":2826,"method":"_apply_transaction","hostname":"","thread_name":"th_a","timestamp":"2017-08-06T02:14:11"},"format":"(skip & skip_transaction_dupe_check) || trx_idx.indices().get<by_trx_id>().find(trx_id) == trx_idx.indices().get<by_trx_id>().end(): Duplicate transaction check failed","data":{"trx_ix":"4c422accc12c3af3304cc870918942e97b12d008"}},{"context":{"level":"warn","file":"database.cpp","line":2889,"method":"_apply_transaction","hostname":"","thread_name":"th_a","timestamp":"2017-08-06T02:14:11"},"format":"","data":{"trx":{"ref_block_num":38289,"ref_block_prefix":1131685322,"expiration":"2017-08-06T02:15:09","operations":[["comment",{"parent_author":"dadview","parent_permlink":"usian-bolts-loses-final-100m-race-201785t22849737z","author":"lukestokes","permlink":"re-dadview-usian-bolts-loses-final-100m-race-201785t22849737z-20170806t021410506z","title":"","body":"He's a legend in his sport, like a Tiger Woods, Michael Jordan, or Kelly Slater. Unequaled.","json_metadata":"{\"tags\":[\"100m\"],\"app\":\"steemit/0.1\"}"}]],"extensions":[],"signatures":["1f2b29e6559dae42efb955901331a4f1510af7ada7b96e5ea7b5b6886d2c535e8c3d77d63d99c7ba6ea8c9223ba8b2555f4935e2fb30865d842a9648c7ac27c7a1"]}}},{"context":{"level":"warn","file":"database.cpp","line":660,"method":"push_transaction","hostname":"","thread_name":"th_a","timestamp":"2017-08-06T02:14:11"},"format":"","data":{"trx":{"ref_block_num":38289,"ref_block_prefix":1131685322,"expiration":"2017-08-06T02:15:09","operations":[["comment",{"parent_author":"dadview","parent_permlink":"usian-bolts-loses-final-100m-race-201785t22849737z","author":"lukestokes","permlink":"re-dadview-usian-bolts-loses-final-100m-race-201785t22849737z-20170806t021410506z","title":"","body":"He's a legend in his sport, like a Tiger Woods, Michael Jordan, or Kelly Slater. Unequaled.","json_metadata":"{\"tags\":[\"100m\"],\"app\":\"steemit/0.1\"}"}]],"extensions":[],"signatures":["1f2b29e6559dae42efb955901331a4f1510af7ada7b96e5ea7b5b6886d2c535e8c3d77d63d99c7ba6ea8c9223ba8b2555f4935e2fb30865d842a9648c7ac27c7a1"]}}},{"context":{"level":"warn","file":"application.cpp","line":535,"method":"handle_transaction","hostname":"","thread_name":"th_a","timestamp":"2017-08-06T02:14:11"},"format":"","data":{"transaction_message":{"trx":{"ref_block_num":38289,"ref_block_prefix":1131685322,"expiration":"2017-08-06T02:15:09","operations":[["comment",{"parent_author":"dadview","parent_permlink":"usian-bolts-loses-final-100m-race-201785t22849737z","author":"lukestokes","permlink":"re-dadview-usian-bolts-loses-final-100m-race-201785t22849737z-20170806t021410506z","title":"","body":"He's a legend in his sport, like a Tiger Woods, Michael Jordan, or Kelly Slater. Unequaled.","json_metadata":"{\"tags\":[\"100m\"],\"app\":\"steemit/0.1\"}"}]],"extensions":[],"signatures":["1f2b29e6559dae42efb955901331a4f1510af7ada7b96e5ea7b5b6886d2c535e8c3d77d63d99c7ba6ea8c9223ba8b2555f4935e2fb30865d842a9648c7ac27c7a1"]}}}}]}                      node.cpp:3874
Authors get paid when people like you upvote their post.
If you enjoyed what you read here, create your account today and start earning FREE STEEM!
STEEMKR.COM IS SPONSORED BY
ADVERTISEMENT
Sort Order:  trending

Congratulations @fuli! You have completed some achievement on Steemit and have been rewarded with new badge(s) :

You got a First Vote

Click on any badge to view your own Board of Honor on SteemitBoard.
For more information about SteemitBoard, click here

If you no longer want to receive notifications, reply to this comment with the word STOP

By upvoting this notification, you can help all Steemit users. Learn how here!

  ·  3년 전

root@crypto:~/steem-docker# cat run.sh
#!/bin/bash

Steem node manager

Released under GNU AGPL by Someguy123

DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
DOCKER_DIR="$DIR/dkr"
FULL_DOCKER_DIR="$DIR/dkr_fullnode"
DATADIR="$DIR/data"
DOCKER_NAME="seed"

BOLD="$(tput bold)"
RED="$(tput setaf 1)"
GREEN="$(tput setaf 2)"
YELLOW="$(tput setaf 3)"
BLUE="$(tput setaf 4)"
MAGENTA="$(tput setaf 5)"
CYAN="$(tput setaf 6)"
WHITE="$(tput setaf 7)"
RESET="$(tput sgr0)"

default. override in .env

PORTS="2001"

if [[ -f .env ]]; then
source .env
fi

if [[ ! -f data/witness_node_data_dir/config.ini ]]; then
echo "config.ini not found. copying example (seed)";
cp data/witness_node_data_dir/config.ini.example data/witness_node_data_dir/config.ini
fi

IFS=","
DPORTS=""
for i in $PORTS; do
if [[ $i != "" ]]; then
if [[ $DPORTS == "" ]]; then
DPORTS="-p0.0.0.0:$i:$i"
else
DPORTS="$DPORTS -p0.0.0.0:$i:$i"
fi
fi
done

help() {
echo "Usage: $0 COMMAND [DATA]"
echo
echo "Commands: "
echo " start - starts steem container"
echo " dlblocks - download and decompress the blockchain to speed up your first start"
echo " replay - starts steem container (in replay mode)"
echo " shm_size - resizes /dev/shm to size given, e.g. ./run.sh shm_size 10G "
echo " stop - stops steem container"
echo " status - show status of steem container"
echo " restart - restarts steem container"
echo " install_docker - install docker"
echo " install - pulls latest docker image from server (no compiling)"
echo " install_full - pulls latest (FULL NODE FOR RPC) docker image from server (no compiling)"
echo " rebuild - builds steem container (from docker file), and then restarts it"
echo " build - only builds steem container (from docker file)"
echo " logs - show all logs inc. docker logs, and steem logs"
echo " wallet - open cli_wallet in the container"
echo " remote_wallet - open cli_wallet in the container connecting to a remote seed"
echo " enter - enter a bash session in the container"
echo " feedstop - stop feed publishing"
echo " feedlogs"
echo " feedstart - start feed publishing"

echo
exit

}

optimize() {
echo 75 | sudo tee /proc/sys/vm/dirty_background_ratio
echo 1000 | sudo tee /proc/sys/vm/dirty_expire_centisecs
echo 80 | sudo tee /proc/sys/vm/dirty_ratio
echo 30000 | sudo tee /proc/sys/vm/dirty_writeback_centisecs
}

build() {
echo $GREEN"Building docker container"$RESET
cd $DOCKER_DIR
docker build -t steem .
}

build_full() {
echo $GREEN"Building full-node docker container"$RESET
cd $FULL_DOCKER_DIR
docker build -t steem .
}

dlblocks() {
if [[ ! -d "$DATADIR/blockchain" ]]; then
mkdir "$DATADIR/blockchain"
fi
echo "Removing old block log"
sudo rm -f $DATADIR/witness_node_data_dir/blockchain/block_log
sudo rm -f $DATADIR/witness_node_data_dir/blockchain/block_log.index
echo "Download @gtg's block logs..."
if [[ ! $(command -v xz) ]]; then
echo "XZ not found. Attempting to install..."
sudo apt update
sudo apt install -y xz-utils
fi
wget https://gtg.steem.house/get/blockchain.xz/block_log.xz -O $DATADIR/witness_node_data_dir/blockchain/block_log.xz
echo "Decompressing block log... this may take a while..."
xz -d $DATADIR/witness_node_data_dir/blockchain/block_log.xz
echo "FINISHED. Blockchain downloaded and decompressed"
echo "Remember to resize your /dev/shm, and run with replay!"
echo "$ ./run.sh shm_size SIZE (e.g. 8G)"
echo "$ ./run.sh replay"
}

install_docker() {
sudo apt update
sudo apt install curl git
curl https://get.docker.com | sh
if [ "$EUID" -ne 0 ]; then
echo "Adding user $(whoami) to docker group"
sudo usermod -aG docker $(whoami)
echo "IMPORTANT: Please re-login (or close and re-connect SSH) for docker to function correctly"
fi
}

install() {
echo "Loading image from someguy123/steem"
docker pull someguy123/steem
echo "Tagging as steem"
docker tag someguy123/steem steem
echo "Installation completed. You may now configure or run the server"
}

install_full() {
echo "Loading image from someguy123/steem"
docker pull someguy123/steem:latest-full
echo "Tagging as steem"
docker tag someguy123/steem:latest-full steem
echo "Installation completed. You may now configure or run the server"
}
seed_exists() {
seedcount=$(docker ps -a -f name="^/"$DOCKER_NAME"$" | wc -l)
if [[ $seedcount -eq 2 ]]; then
return 0
else
return -1
fi
}

seed_running() {
seedcount=$(docker ps -f 'status=running' -f name=$DOCKER_NAME | wc -l)
if [[ $seedcount -eq 2 ]]; then
return 0
else
return -1
fi
}

start() {
echo $GREEN"Starting container..."$RESET
seed_exists
if [[ $? == 0 ]]; then
docker start $DOCKER_NAME
else
docker run $DPORTS -v /dev/shm:/shm -v "$DATADIR":/steem -d --name $DOCKER_NAME -t steem
fi
}

replay() {
echo "Removing old container"
docker rm $DOCKER_NAME
echo "Running steem with replay..."
docker run $DPORTS -v /dev/shm:/shm -v "$DATADIR":/steem -d --name $DOCKER_NAME -t steem steemd --replay
echo "Started."
}

shm_size() {
echo "Setting SHM to $1"
mount -o remount,size=$1 /dev/shm
}

stop() {
echo $RED"Stopping container..."$RESET
docker stop $DOCKER_NAME
docker rm $DOCKER_NAME
}

enter() {
docker exec -it $DOCKER_NAME bash
}

wallet() {
docker exec -it $DOCKER_NAME cli_wallet
}

remote_wallet() {
docker run -v "$DATADIR":/steem --rm -it steem cli_wallet -s wss://steemd.steemit.com
}

logs() {
echo $BLUE"DOCKER LOGS: "$RESET
docker logs --tail=30 $DOCKER_NAME
#echo $RED"INFO AND DEBUG LOGS: "$RESET
#tail -n 30 $DATADIR/{info.log,debug.log}
}

feedlogs() {
echo $BLUE"DOCKER feed LOGS: "$RESET
docker logs --tail=30 feed
#echo $RED"INFO AND DEBUG LOGS: "$RESET
#tail -n 30 $DATADIR/{info.log,debug.log}
}

feedstart() {
echo $GREEN"Starting container..."$RESET
docker run -it --rm --name feed steemfeed-js
}
feedstop() {
echo $RED"Stopping container..."$RESET
docker stop feed
docker rm feed
}

status() {

seed_exists
if [[ $? == 0 ]]; then
    echo "Container exists?: "$GREEN"YES"$RESET
else
    echo "Container exists?: "$RED"NO (!)"$RESET
    echo "Container doesn't exist, thus it is NOT running. Run $0 build && $0 start"$RESET
    return
fi

seed_running
if [[ $? == 0 ]]; then
    echo "Container running?: "$GREEN"YES"$RESET
else
    echo "Container running?: "$RED"NO (!)"$RESET
    echo "Container isn't running. Start it with $0 start"$RESET
    return
fi

}

if [ "$#" -lt 1 ]; then
help
fi

case $1 in
build)
echo "You may want to use '$0 install' for a binary image instead, it's faster."
build
;;
build_full)
echo "You may want to use '$0 install_full' for a binary image instead, it's faster."
build_full
;;
install_docker)
install_docker
;;
install)
install
;;
install_full)
install_full
;;
start)
start
;;
replay)
replay
;;
shm_size)
shm_size $2
;;
stop)
stop
;;
restart)
stop
sleep 5
start
;;
rebuild)
stop
sleep 5
build
start
;;
optimize)
echo "Applying recommended dirty write settings..."
optimize
;;
status)
status
;;
wallet)
wallet
;;
remote_wallet)
remote_wallet
;;
dlblocks)
dlblocks
;;
enter)
enter
;;
logs)
logs
;;
feedlogs)
feedlogs
;;
feedstart)
feedstart
;;
feedstop)
feedstop
;;
*)
echo "Invalid cmd"
help
;;
esac

Congratulations @fuli! You have completed some achievement on Steemit and have been rewarded with new badge(s) :

You made your First Comment

Click on any badge to view your own Board of Honor on SteemitBoard.
For more information about SteemitBoard, click here

If you no longer want to receive notifications, reply to this comment with the word STOP

By upvoting this notification, you can help all Steemit users. Learn how here!

Congratulations @fuli! You have received a personal award!

1 Year on Steemit
Click on the badge to view your Board of Honor.

Do you like SteemitBoard's project? Then Vote for its witness and get one more award!

Congratulations @fuli! You received a personal award!

Happy Birthday! - You are on the Steem blockchain for 2 years!

You can view your badges on your Steem Board and compare to others on the Steem Ranking

Vote for @Steemitboard as a witness to get one more award and increased upvotes!