Skip to content

Commit a6907c2

Browse files
committed
simplify doc
1 parent 53604f2 commit a6907c2

File tree

1 file changed

+5
-57
lines changed

1 file changed

+5
-57
lines changed

docs/subquery_network/node_operators/setup/becoming-a-node-operator.md

+5-57
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ Use the following command to download the `auto-upgrade-tool.sh` script:
215215
curl https://raw.githubusercontent.com/subquery/network-indexer-services/main/deploy/auto-upgrade-tool.sh -o auto-upgrade-tool.sh
216216
```
217217

218-
### Step 2: Basic Usage of `auto-upgrade-tool.sh`
218+
### Step 2: Usage of `auto-upgrade-tool.sh`
219219

220220
The `auto-upgrade-tool.sh` script automatically fetches the latest tags for `subquerynetwork/indexer-coordinator` and `subquerynetwork/indexer-proxy` from Docker Hub and updates the versions in your Docker Compose configuration file.
221221

@@ -227,11 +227,9 @@ The `auto-upgrade-tool.sh` script automatically fetches the latest tags for `sub
227227
./auto-upgrade-tool.sh -f my-compose.yml
228228

229229
# Force the script to run `docker compose up` without confirmation
230-
./auto-upgrade-tool.sh -u
230+
./auto-upgrade-tool.sh -y
231231
```
232232

233-
### Step 3: Sample Script Execution
234-
235233
Here’s an example of running the script:
236234

237235
```sh
@@ -266,8 +264,6 @@ Set `external: true` to use an existing network.
266264
✔ Container indexer_proxy Started 11.6s
267265
```
268266

269-
### Step 4: Docker Compose File Update Example
270-
271267
After running the script, the `docker-compose.yml` file will be updated. Below is an example of the changes:
272268

273269
```diff
@@ -288,12 +284,12 @@ After running the script, the `docker-compose.yml` file will be updated. Below i
288284
24 ⋮ 24 │ ports:
289285
```
290286

291-
### Step 5: Setting Up a Cron Job
287+
### Step 3: Setting Up a Cron Job
292288

293289
To automate the script execution, set up a cron job. Below is an example of a cron job that runs the script every 6 hours:
294290

295291
```sh
296-
0 */6 * * * /path/to/auto-upgrade-tool.sh -f /path/to/docker-compose.yml >> /var/log/auto-upgrade-cron.log 2>&1
292+
0 */6 * * * /path/to/auto-upgrade-tool.sh -y -f /path/to/docker-compose.yml >> /var/log/auto-upgrade-cron.log 2>&1
297293
```
298294

299295
This will log the output to `/var/log/auto-upgrade-cron.log` for future reference.
@@ -309,57 +305,9 @@ sudo crontab -e
309305
This will open the cron editor for the root user. Add the following line to schedule the script:
310306

311307
```sh
312-
0 */6 * * * /path/to/auto-upgrade-tool.sh -f /path/to/docker-compose.yml >> /var/log/auto-upgrade-cron.log 2>&1
308+
0 */6 * * * /path/to/auto-upgrade-tool.sh -y -f /path/to/docker-compose.yml >> /var/log/auto-upgrade-cron.log 2>&1
313309
```
314310

315311
Save and exit the editor to apply the changes.
316312

317-
To verify that the cron job has been added, run:
318-
319-
```sh
320-
sudo crontab -l
321-
```
322-
323-
This will list all cron jobs for the root user, including the one you just added.
324-
325-
#### Adding the Cron Job with `sudo` (Direct Command)
326-
327-
To add the cron job directly without opening the editor, use the following command:
328-
329-
```sh
330-
echo "0 */6 * * * /path/to/auto-upgrade-tool.sh -f /path/to/docker-compose.yml >> /var/log/auto-upgrade-cron.log 2>&1" | sudo crontab -
331-
```
332-
333-
This will overwrite the existing root user's crontab with the new entry. If you want to preserve existing cron jobs, first list them using:
334-
335-
```sh
336-
sudo crontab -l
337-
```
338-
339-
Then append the new entry like this:
340-
341-
```sh
342-
(sudo crontab -l; echo "0 */6 * * * /path/to/auto-upgrade-tool.sh -f /path/to/docker-compose.yml >> /var/log/auto-upgrade-cron.log 2>&1") | sudo crontab -
343-
```
344-
345-
To verify the cron job has been added, run:
346-
347-
```sh
348-
sudo crontab -l
349-
```
350-
351-
This will list all cron jobs for the root user, including the one you just added.
352-
353-
## 11. Upgrade Node Operator services (Ongoing)
354-
355-
To upgrade a Node Operator service, you will need to update the version of the image used in the docker-compose file. This can be done by updating the image field in the service definition to the new version you want to use.
356-
357-
Once the image version has been updated in the docker-compose file, you can restart the specific container that needs to be upgraded. This can be done by running the following command in the terminal:
358-
359-
```bash
360-
docker-compose up -d --no-deps container-service-name
361-
```
362-
363-
The `up` command starts the container in the background, while the `--no-deps` flag prevents Docker Compose from starting any linked services. Finally, the `container-service-name` argument specifies the name of the container that needs to be restarted.
364-
365313
By following these simple steps, you can upgrade your Node Operator services in Docker Compose and ensure that they are running the latest version of the image.

0 commit comments

Comments
 (0)