#!/usr/bin/env bash # Start the network: nodes and block logs first, miners once every RPC answers. # ./start.sh nodes, then miners # ./start.sh nodes nodes and block logs only # ./start.sh miners miners only . "$(dirname "$0")/lib/common.sh" require_nodes what="${1:-all}" if [ "$what" = all ] || [ "$what" = nodes ]; then log "starting igneumd and igneum-blocklog on $(node_count) nodes" on_all 'systemctl restart igneumd && sleep 1 && systemctl restart igneum-blocklog && systemctl is-active igneumd' log "waiting for the RPC on every node" for try in $(seq 1 24); do bad=0 while IFS=$'\t' read -r name idx reg ip; do nssh "$ip" "python3 /opt/igneum/bin/wrpc.py call getInfo >/dev/null 2>&1" || bad=$((bad + 1)) done < "$NODES_FILE" [ "$bad" = 0 ] && break log "$bad nodes not answering yet (try $try), 5 s"; sleep 5 done [ "$bad" = 0 ] || log "WARNING: $bad nodes still not answering; check: ./status.sh and journalctl -u igneumd on the node" fi if [ "$what" = all ] || [ "$what" = miners ]; then log "starting the trickle miners ($MINER_THREADS thread each; the first block needs the 256 MiB cache built, about 10 to 30 s on one vCPU, approximate)" on_all 'systemctl restart igneum-miner && systemctl is-active igneum-miner' fi log "started at $(date -u +%Y-%m-%dT%H:%M:%SZ). Watch with ./status.sh (every 30 s: watch -n 30 ./status.sh)" printf '%s\tstart %s\n' "$(date -u +%Y-%m-%dT%H:%M:%SZ)" "$what" >> "$(results_dir_for)/events.log"