2020-07-25 06:46:18 +03:00
|
|
|
_kill_servers() {
|
|
|
|
PROCS=`ps -e | grep -E 'chia|vdf_client' -v "chia-start-sim" | awk '!/grep/' | awk '{print $1}'`
|
|
|
|
if [ -n "$PROCS" ]; then
|
|
|
|
echo "$PROCS" | xargs -L1 kill -KILL
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
|
|
|
_kill_servers
|
|
|
|
|
|
|
|
BG_PIDS=""
|
|
|
|
_run_bg_cmd() {
|
|
|
|
"$@" &
|
|
|
|
BG_PIDS="$BG_PIDS $!"
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
_term() {
|
|
|
|
echo "Caught TERM or INT signal, killing all servers."
|
|
|
|
for PID in $BG_PIDS; do
|
|
|
|
kill -TERM "$PID"
|
|
|
|
done
|
|
|
|
_kill_servers
|
|
|
|
}
|
2019-11-04 11:27:58 +03:00
|
|
|
|
2020-01-30 11:57:47 +03:00
|
|
|
echo "Starting local blockchain simulation. Runs a local introducer and chia system."
|
2019-12-03 13:03:43 +03:00
|
|
|
echo "Note that this simulation will not work if connected to external nodes."
|
|
|
|
|
|
|
|
# Starts a harvester, farmer, timelord, introducer, and 3 full nodes, locally.
|
|
|
|
# Please note that the simulation is meant to be run locally and not connected to external nodes.
|
2020-06-27 18:44:51 +03:00
|
|
|
# NOTE: you must run install.sh when changing this file
|
2019-11-04 11:27:58 +03:00
|
|
|
|
2021-02-10 12:16:28 +03:00
|
|
|
_run_bg_cmd chia_farmer --logging.log_stdout=True --logging.log_level=INFO
|
|
|
|
_run_bg_cmd chia_harvester --logging.log_stdout=True --logging.log_level=INFO
|
|
|
|
_run_bg_cmd chia_timelord --logging.log_stdout=True --logging.log_level=INFO
|
|
|
|
_run_bg_cmd chia_timelord_launcher --logging.log_stdout=True --logging.log_level=INFO
|
2020-06-27 18:44:51 +03:00
|
|
|
_run_bg_cmd chia_introducer --logging.log_stdout=True --logging.log_level=INFO
|
2020-07-03 04:53:42 +03:00
|
|
|
_run_bg_cmd chia_full_node --port=8444 --database_path="simulation_1.db" --rpc_port=8555 --introducer_peer.host="127.0.0.1" --introducer_peer.port=8445 --logging.log_stdout=True --logging.log_level=INFO --logging.log_level=INFO
|
2020-04-21 07:29:47 +03:00
|
|
|
sleep 1
|
2020-06-27 18:44:51 +03:00
|
|
|
_run_bg_cmd chia_full_node --port=8002 --database_path="simulation_2.db" --rpc_port=8556 --introducer_peer.host="127.0.0.1" --introducer_peer.port=8445 --logging.log_stdout=True --logging.log_level=INFO
|
2021-03-22 22:36:05 +03:00
|
|
|
_run_bg_cmd python -m chia.daemon.server --logging.log_stdout=True --logging.log_level=INFO
|
2019-11-04 11:27:58 +03:00
|
|
|
|
2021-02-09 10:14:37 +03:00
|
|
|
wait
|