Skip to content

Instantly share code, notes, and snippets.

@rlaace423
Created May 20, 2018 19:31
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rlaace423/0857a5c3ad42de7cd704a97c902f7043 to your computer and use it in GitHub Desktop.
Save rlaace423/0857a5c3ad42de7cd704a97c902f7043 to your computer and use it in GitHub Desktop.
#!/bin/bash
NODEOS_ROOT_DIR=/root/eos_data/nodeos
CONFIG_DIR=/root/eos_data/nodeos/config
DATA_DIR=/root/eos_data/nodeos/data
LOG_DIR=/root/eos_data/nodeos/log
## WALLET DIR 은 config.ini 파일 안의 datadir 로 정의!!!
## plugin들도 config.ini 파일 안에 정의!!!
## server address 도 config.ini 파일 안에 정의!!!
CURTIME=$(date +"%Y%m%d_%H%M%S")
LOG_FILENAME=$CURTIME".log"
PRODUCER_NAME=eosio
PROCESS_COUNT=$(ps -ef | grep nodeos | grep -v grep | awk '{print $2}' | wc -l)
if [ $PROCESS_COUNT -ne 0 ]; then
printf "이미 실행중인 nodeos가 존재합니다.\n"
exit 1
fi
printf "GOD EOS 데몬을 시작 중...\n"
nohup nodeos -e -p $PRODUCER_NAME --config-dir $CONFIG_DIR --data-dir $DATA_DIR $1 &> $LOG_DIR/$LOG_FILENAME &
sleep 1s
PROCESS_COUNT=$(ps -ef | grep nodeos | grep -v grep | awk '{print $2}' | wc -l)
if [ $PROCESS_COUNT -ne 1 ]; then
printf "EOS 실행에 문제가 있습니다. (실행 실패 혹은 1개 이상의 프로세스가 실행됨)\n"
printf " * 로그파일 이름 : %s\n" $LOG_DIR"/"$LOG_FILENAME
echo
exit 1
fi
printf "GOD EOS 데몬이 시작되었습니다.\n"
printf " * 설정파일 경로 : \t%s\n" $CONFIG_DIR
printf " * 데이터 파일 경로 : \t%s\n" $DATA_DIR
printf " * 로그파일 이름 : \t%s\n" $LOG_DIR"/"$LOG_FILENAME
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment