-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathstart.sh
More file actions
executable file
·68 lines (56 loc) · 2.41 KB
/
Copy pathstart.sh
File metadata and controls
executable file
·68 lines (56 loc) · 2.41 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
#!/bin/bash
# Bring the Teranode stack up for the network configured in .env.
set -eo pipefail
REPO_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
cd "$REPO_ROOT"
source "${REPO_ROOT}/lib/colors.sh"
if [ ! -f .env ]; then
echo_error ".env not found. Run ./setup.sh first."
exit 1
fi
set -a
# shellcheck disable=SC1091
source .env
set +a
case ",${COMPOSE_PROFILES:-}," in
*,blockpersister,*) HAS_PERSISTER=1 ;;
*) HAS_PERSISTER=0 ;;
esac
TRIGGER="${pruner_block_trigger:-}"
TRIGGER="${TRIGGER//[[:space:]]/}"
if [ "$HAS_PERSISTER" -eq 0 ] && [ "$TRIGGER" != "OnBlockMined" ]; then
echo_warning "pruner_block_trigger=${TRIGGER:-<unset, upstream default OnBlockPersisted>} but blockpersister is NOT in COMPOSE_PROFILES."
echo_warning "Pruner will idle and spent UTXOs will accumulate. Fix: set pruner_block_trigger=OnBlockMined in .env (or re-run ./setup.sh)."
elif [ "$HAS_PERSISTER" -eq 1 ] && [ "$TRIGGER" = "OnBlockMined" ]; then
echo_warning "pruner_block_trigger=OnBlockMined but blockpersister IS in COMPOSE_PROFILES."
echo_warning "Pruner will not wait for archival. Consider pruner_block_trigger=OnBlockPersisted for coordinated pruning (or re-run ./setup.sh)."
fi
NETWORK="${network:?network not set in .env}"
echo_info "Network: $NETWORK"
[ -n "${COMPOSE_PROFILES:-}" ] && echo_info "Profiles: $COMPOSE_PROFILES"
docker compose up -d
echo ""
"${REPO_ROOT}/lib/fsm.sh" up || echo_warning "FSM transition failed — see above. Try ./status.sh and ./cli.sh setfsmstate --fsmstate RUNNING manually."
echo ""
echo_success "Stack up. Useful URLs:"
echo " Asset viewer: http://localhost:8090"
echo " RPC endpoint: http://localhost:9292"
case ",${COMPOSE_PROFILES:-}," in
*,monitoring,*)
echo " Grafana: http://localhost:3005 (initial login: admin/admin — Grafana will prompt to change)"
echo " Prometheus: http://localhost:9090"
echo " Kafka console: http://localhost:8080"
;;
esac
if [ "${HOST_IP:-127.0.0.1}" = "0.0.0.0" ]; then
echo ""
echo_info "HOST_IP=0.0.0.0 — the asset endpoint is also reachable from another"
echo_info "machine on the LAN at this host's IP (replace 'localhost' above)."
fi
echo ""
echo_info "Tail logs: ./logs.sh blockchain"
echo_info "Status: ./status.sh"
if [ -n "$asset_httpPublicAddress" ] || [ -n "$p2p_advertise_addresses" ]; then
echo ""
"${REPO_ROOT}/lib/reachability.sh" || true
fi