Skip to content

Commit 471dd36

Browse files
committed
Update Makefile and Readme for the (up/down)-prom targets
1 parent f604aac commit 471dd36

2 files changed

Lines changed: 28 additions & 10 deletions

File tree

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,11 +107,11 @@ up-genesis: genesis
107107

108108
up-prom:
109109
@echo "Starting $(PROJECT) prometheus monitoring"
110-
docker compose -f docker/docker-compose.prom.yml --profile default -p $(PROJECT) up -d
110+
docker compose -f docker/docker-compose.prom.yml --profile default -p monitoring up -d
111111

112112
down-prom:
113113
@echo "Shutting down $(PROJECT) prometheus monitoring"
114-
docker compose -f docker/docker-compose.prom.yml --profile default -p $(PROJECT) down
114+
docker compose -f docker/docker-compose.prom.yml --profile default -p monitoring down
115115

116116
# Shut down the network (chainstate and logs will be preserved)
117117
down: backup-logs current-chainstate-dir

README.md

Lines changed: 26 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ make log stacks-signer-1 -- -f
5858
make log stacks-signer-1
5959
```
6060

61+
### Container management
6162
#### Pause/Unpause service
6263
To pause all services on the network
6364
```sh
@@ -88,6 +89,19 @@ Restart the stopped service
8889
make start <service name>
8990
```
9091

92+
#### Force stop the hacknet network
93+
If the network is in a "stuck" state where the Makefile targets are not stopping the services (i.e. the `.current-chainstate-dir` file was removed while network was running), `down-force` may be used to force stop the network.
94+
95+
```sh
96+
make down-force
97+
```
98+
99+
Additionally, `clean` target will call `down-force` *and also* delete any chainstates on disk in `./docker/chainstate/*`
100+
```sh
101+
make clean
102+
```
103+
104+
### Additional Features
91105
#### Stress the CPU
92106
To simulate CPU load. Can be modified with:
93107
- `STRESS_CORES` to target how many worker threads (default will use all cores)
@@ -99,6 +113,12 @@ make stress
99113
STRESS_CORES=10 STRESS_TIMEOUT=60 make stress
100114
```
101115

116+
#### Monitor chain heights
117+
Run a script outputting the current chain heights of each miner
118+
```sh
119+
make monitor
120+
```
121+
102122
#### Create a chainstate snapshot
103123
- Setting the env var `PAUSE_HEIGHT` is optional to pause the chain at a specific height, else a default of Bitcoin block `999999999999` is used.
104124
- Setting the env var `MINE_INTERVAL_EPOCH3` is recommended to reach the `PAUSE_HEIGHT` more quickly to create the snapshot
@@ -129,19 +149,17 @@ ex:
129149
CHAINSTATE_ARCHIVE=./docker/chainstate_new.tar.zstd make up
130150
```
131151

132-
#### Force stop the hacknet network
133-
If the network is in a "stuck" state where the Makefile targets are not stopping the services (i.e. the `.current-chainstate-dir` file was removed while network was running), `down-force` may be used to force stop the network.
134-
152+
#### Prometheus sidecar
153+
##### Run prometheus and cadvisor
154+
Runs a prometheus container to record data collected by `cadvisor` for tracking host/container metrics
135155
```sh
136-
make down-force
156+
make up-prom
137157
```
138-
139-
Additionally, `clean` target will call `down-force` *and also* delete any chainstates on disk in `./docker/chainstate/*`
158+
##### Stop prometheus and cadvisor
140159
```sh
141-
make clean
160+
make down-prom
142161
```
143162

144-
145163
## Containers
146164

147165
- **bitcoin**: Runs a bitcoin regtest node

0 commit comments

Comments
 (0)