Skip to content

Commit

Permalink
fix: update ckb-node-monit to fit esmodule
Browse files Browse the repository at this point in the history
  • Loading branch information
linkdesu committed Jul 8, 2024
1 parent 6615901 commit 3251924
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,11 @@ The `testnet` script will load `config/local-testnet.yaml` and `config/testnet.y

## CKB Node Restart Script

Because of unstable network, sometimes the CKB node may disconnect from peers and stop syncing blocks. To solve this problem, the script `scripts/ckb-node-monit.js` can restart the CKB node automatically:
Because of unstable network, sometimes the CKB node may disconnect from peers and stop syncing blocks. To solve this problem, the script `scripts/ckb-node-monit.mjs` can restart the CKB node automatically:

```bash
pm2 start --cron-restart="* * * * *" \
./scripts/ckb-node-monit.js -- \
./scripts/ckb-node-monit.mjs -- \
--log /path_to_ckb_node_log_dir/run.log \
--data ./ckb-node-status.json
```
Expand Down
8 changes: 4 additions & 4 deletions scripts/ckb-node-monit.js → scripts/ckb-node-monit.mjs
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
// Start command:
// pm2 start --cron-restart="* * * * *" \
// ./ckb-node-monit.js -- \
// ./ckb-node-monit.mjs -- \
// --log /path_to_ckb_node_log_dir/run.log \
// --data ./ckb-node-status.json


const fs = require('fs');
const readline = require('readline');
const { spawn } = require('child_process');
import fs from 'fs'
import readline from 'readline'
import { spawn } from 'child_process'

const newBlockTimeout = 180 * 1000; // 3 minutes
const restartTimeout = 300 * 1000; // 5 minutes
Expand Down

0 comments on commit 3251924

Please sign in to comment.